3
votes
2answers
3k views

EF Code First uses nvarchar(max) for all strings. Will this hurt query performance?

I have some databases created using Entity Framework Code First; the apps are working and in general I'm pretty happy with what Code First lets me do. I am a programmer first, and a DBA second, by ...
1
vote
3answers
1k views

restore could not start database

Restore failed for Server 'servername'. (Microsoft.SqlServer.SmoExtended) System.Data.SqlClient.SqlError: RESTORE could not start database 'ECP'. (Microsoft.SqlServer.Smo) The database is ...
1
vote
1answer
501 views

Advice needed for Querying DateTimeOffset data by end users

We are building an Operational Data Store (ODS). The data is coming from our production databases which are located in the United States and Asia. The data in our production databases store date/time ...
1
vote
1answer
683 views

Disabling triggers in stored procedures

I am building a database application that uses functions and triggers. One trigger I have limits the possible data that can be put in on INSERT to make sure a record goes through a defined set of ...
1
vote
4answers
8k views

Query to list all tables in a schema

I am using Rational Application Developer to run querys on a database. We are unable to locate anyone who has a list of the tables on the schema and so far the queries we have found to get a list of ...
1
vote
2answers
151 views

Does mongodb support non readable file?

I have uploaded PDF/PST file in mongodb by mongofiles but by retrieving them in R(BSON) and converting it to "Character" type i didnt find the PDF/PST file,so is it possible to upload PDF file or PST ...
1
vote
1answer
3k views

Passing column names dynamically to UNPIVOT

I have a table with following data First Second Third Fourth Fifth Sixth 2013-08-20 2013-08-21 2013-08-22 2013-08-23 2013-08-24 2013-08-25 And ...
4
votes
1answer
6k views

Moving from SQL 2005 [SQL_Latin1_General_CP1_CI_AS] to 2008 - will I lose any features by using 'backwards compatibility'

We're moving from SQL 2005 [Instance and DB have collation of SQL_Latin1_General_CP1_CI_AS] to SQL 2008 [which defaults to Latin1_General_CI_AS]. I completed a SQL 2008 R2 installation, and used ...
-2
votes
1answer
350 views

SQL Server 2008 component is cluster-aware? [closed]

Which SQL Server 2008 components are cluster-aware? Notification Services Tuning Advisor Full Text Search Reporting Services Integration Service
0
votes
1answer
120 views

Use surrogate or natural PK if a row is uniquely identified by two or more columns?

I am having a hard time choosing between natural and surrogate PK for my database table. The database is for a ranking system for an MOBA game. Here is more or less what I would do if I were to go ...
1
vote
1answer
445 views

showing locks from all postgres relations

I'm trying to show all locks (DBMS-wide) in Postgres. I initially tried adapting the documented example to: SELECT pg_database.datname AS database, relation::regclass, pg_locks.database AS db_oid, ...
1
vote
1answer
968 views

Schema Change/Update script for Database deploy [closed]

I have a need to change the database schema . I'm planning to write Schema change and update scripts for tracking database changes and updating them. I followed Versioning Databases – Change Scripts ...
0
votes
2answers
368 views

Why isn't postgres prompting me about a new user?

I'm following these instructions to get postgres working with rails on Windows 7: Run "Start Command Prompt with Ruby" then... createuser -U postgres -P NewUserName When it prompts for a ...
5
votes
1answer
3k views

Can listen_addresses really be set to a list?

I have a VM with IP address 192.168.0.192 running postgreSQL. If I specify listen_addresses = '*' then I can connect from another VM at 192.168.0.191 and from localhost. But I can't seem to use a ...
1
vote
1answer
44 views

Show clients with staff assigned and no staff assigned

I am trying to write a query to show a client list including whether or not there is a staff member assigned. If I use this query: SELECT g.name AS group, cl.name_lastfirst_cs AS client FROM clients ...
5
votes
2answers
1k views

Dividing DBCC CHECKDB over multiple days

I'm working on implementing Paul Randal's method of manually spreading DBCC CHECKDB over several days for very large databases, which basically consists of: Dividing the tables in the database ...
2
votes
1answer
447 views

Configuring PostgreSQL to match server configuration

We are currently running web application and database server on singe dedicated machine. This is hardware configuration - http://www.hetzner.de/en/hosting/produkte_rootserver/ex10. Around 50Gb of ram ...
-1
votes
1answer
83 views

Problems working with decode function when there is more then one expression

I am using Oracle 11g. I have these two tables: Table acct: acctnbr || Name || Mailing address 000001 || Slater || 000002 || Baker || Alt 000003 || Parke || Table addruse: ...
3
votes
1answer
295 views

Index will be removed

I'm trying to simply change the length of a column within a table through SQL Server Management Studio, but receive a 'Validation Warning': 'MyTable' table -Warning: The following schema-bound ...
3
votes
1answer
871 views

How to troubleshoot db/app latency during transaction log backup

I have an application that uses a SQL server (2008 R2) database and we are periodically having performance problems with the application and it coincides with our 15-minute transaction log backups. ...
0
votes
1answer
962 views

startup mount issues with Oracle

I am a newbie with Oracle so bear with me. I am trying to simply shutdown and restart an Oracle db instance on a Windows Server 2008 machine (Oracle 11.2.0). Logged in via sqlplus, I issue the ...
3
votes
1answer
430 views

Improve performance of transactional replication

I 'm testing implementing transactional replication . The replication works fine if I insert/update handful of rows. The problem occurs when I have a sql job running which deletes/updates & ...
0
votes
3answers
411 views

Dividing in SQL

can anyone explain to me why this query returns 0.000? SELECT CAST(20/1024 AS NUMERIC(10,3)) I am just trying to do a simple conversion of MB to GB Thanks
0
votes
1answer
273 views

SQL Server 2008 - Question about index behaviour

I have a general question about advanced issues regarding index behaviour. In short, roughly one year ago, we dynamically dropped and recreated a number of indexes with different filters, but using ...
1
vote
1answer
207 views

Non-clustered index with all columns for “select * from”?

I have a simple SELECT * FROM MyTable WHERE DataDate = '18-AUG-2013' query on a table that contains 340 columns and 3.4M rows. Running estimated Execution plan in SSMS (Ctrl-L) suggests I create a ...
1
vote
1answer
62 views

SQL SERVER 2012 error [closed]

am trying to restore a backup, the backup is from a database in the current instance, want to restore the backup with a different name for test purposes, this was possible in 2008 R2 but in 2012 its ...
2
votes
1answer
1k views

“Use Database” command inside a stored procedure

I would like to dynamically use a database inside a stored procedure but the use database_name command is not supported inside procedures. What alternatives are there?
0
votes
1answer
57 views

Connecting to Oracle with encrypted pwd

I am reading my userid , pwd from a file with 400 permissions to connect to the external oracle application. Now my requirement is that i should not use the plain text pwd present in the file . I ...
2
votes
1answer
454 views

Subselect dependent on first select value

I wish to do a select of all data matching a particular id. I would also like to return a selection of all data matching the alt_id field in the first select. This example works fine for the main ...
0
votes
1answer
170 views

How does MySQL or PostgreSQL deal with multi-column indexes in ActiveRecord?

I'm creating indexes for my models right now and I want to know how MySQL and PostgreSQL deal with an index with more than 1 column like: add_index :users, [:username, :created_at] That should ...
3
votes
2answers
333 views

Truncated copy of a DB for a developer

I have an access to a DB (SQL Server 2008 R2). The size of the DB is about 40GB. I am a developer and I'd like to have a local copy of that DB to be able to work offline. Is there an easy way to get ...
0
votes
1answer
412 views

Oracle 11G Startup failed after altering the number of system processes

When I alter the number of system processes to 100000 and restart the database, I get the error below: ORA-27154: post/wait create failed ORA-27300: OS system dependent operation:semids_per_proc ...
1
vote
1answer
1k views

Creating a USER using the imp command [duplicate]

I was told I can use exp to export a certain USER, then DROP the user and with the imp command I can recreate that USER with all of its tables. Is it true? How do I do it? I already have an ADMIN ...
0
votes
1answer
102 views

MySQL Cluster - strange syntax error

I have MySQL Cluster instance and want one column (BLOB) to be stored on disk instead of memory. I tried to follow this tutorial: ...
1
vote
0answers
302 views

hbase vs postgres performance comparison? [closed]

I know that this is comparing apples to oranges, but sometimes you have to choose what to eat... I'm trying to find a rule of thumb as to the magnitudes for which to choose hbase over postgres. E.g., ...
1
vote
1answer
2k views

Merge multiple tables in a database

I have a MySQL database with table names like 1,2,3... upto 1000 Each tables have 2000 rows and has the same structure. This is how all my 2000 table's structure look like id,url,title,content id ...
0
votes
0answers
730 views

MYSQL 5.6.12 Lock wait timeout exceeded, yet no transactions\locks currently taking place?

On a development database with no other users other than myself, I'm getting the following error #1205 - Lock wait timeout exceeded; try restarting transaction when trying to run a simple alter ...
6
votes
1answer
91 views

Why are some aggregates treated differently in the RHS of a rule in the model clause?

With my limited understanding of the model clause, I'd expected the following three queries to return the same results because there are no nulls in the data, and the functions are equivalent: select ...
5
votes
1answer
217 views

My log file is large, what should I do? [duplicate]

My transaction log is larger than I'd like it to be, and I want to know how I can fix that.
3
votes
1answer
2k views

How to get SQL Server 2012 to use the invariant culture in format()?

This has now been posted to Connect: The invariant culture identifier is rejected by the FORMAT() function in SQL Server 2012. I'm trying to get the built-in format() function in SQL Server ...
0
votes
1answer
126 views

Whether or not to create separate tables

I am working on a project, where I need to store the information related to A and B, the A and B both have identical columns.There might be thousands of As and Bs. Should I use "type" column to ...
1
vote
2answers
770 views

Error in running SQL Server script

I copied oldDatabase as newDatabase. Modified newDatabase's schema. Meanwhile, oldDatabase's data are processing and updating. I want to copy oldDatabase's data to newDatabase. What I have done ...
0
votes
0answers
286 views

Oracle prevent CPU usage per process/session

I have an Oracle instance to which several applications from different machines connect (http servers). Normally Oracle CPU usage is ~5-10% even on high server loads. But from time to time, one of ...
1
vote
1answer
55 views

MySQL Grouping Order

Is it possible to force the order in which a result set is grouped? I have a table with multiple languages in it, and I'm doing a GROUP_CONCAT to get a comma separated list of the product name in each ...
1
vote
1answer
4k views

Dynamic SQL is not allowed error for creating function in MySQL

According to this question and answer of Angelo I create a MySQL function as below: DELIMITER $$ CREATE FUNCTION hierarchy_connect_by_parent_eq_prior_id(value INT, reqdTable VARCHAR(50)) RETURNS INT ...
1
vote
2answers
439 views

Run Multiple Scripts In One Transaction Across Multiple Servers [duplicate]

We have deployment scripts that we need to run on databases that are spread across multiple servers. One script only runs on one database, but the scripts depend on each other. We are looking for a ...
3
votes
2answers
2k views

SQL Server 2012 High Availability on VMware virtualization

We're going to host a large SQL Server 2012 under a VMware virtualization and we need it to be highly available. These are the three options I found supported, but couldn't find a lot of info and ...
0
votes
1answer
375 views

Which databases can have row and column level security based upon Active Directory? [closed]

I have various database types, Oracle 11g, MySQL 5, Sql Server 2012. I have direct access. I can have other databases if I need them such as PostgreSQL. What I'm doing is protecting data at the ...
0
votes
0answers
19 views

SQL Server 2012 High Availability on VMware virtualization [duplicate]

We're going to host a large SQL Server 2012 under a VMware virtualization and we need it to be highly available. These are the three options I found supported, but couldn't find a lot of info and ...
1
vote
0answers
361 views

Ghost Cleanup process has high CPU usage in SQL Server 2012 SP1

Has anyone encountered this? We are using SQL Server 2012 Enterprise Edition with SP1. During a time of low/no activity, I noticed the Ghost Cleanup process is utilizing CPU at a very high rate, ...

15 30 50 per page