Microsoft's SQL Server is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. It originated from the Sybase SQL Server codebase, which is why both products use the extension of SQL called Transact-SQL (T-SQL).

learn more… | top users | synonyms (2)

0
votes
1answer
576 views

How to split the comma separated list in the stored procedure

I am working on small module in which we pass the column name as comma-separated string to a stored procedure. In the stored procedure, we want to separate the column names out.
1
vote
3answers
10k views

Max connections SQL Server Express could have?

I have SQL Server 2005 Express edition installed on one of my client's machine, and lots of other users are also connected to that SQL Server through the C# application that I have provided them as an ...
2
votes
2answers
130 views

Rebuilding system and tables, should I change primary key to int?

I am in the process of rebuilding a current system (orders, invoicing, payments, Vendors, etc), which includes normalizing the current tables with more tables and lookup tables to spead up ...
8
votes
1answer
3k views

Upgrade SQL Server 2005 to SQL Server 2012

I have a test environment set up with the following: Virtual Machine (Hyper-V) Windows Server 2008 R2 SP1(x64-bit) Windows SQL Server 2005 Developer Edition SP4 (x64-bit)(default instance name) 1 ...
3
votes
2answers
153 views

Proper Index for WHERE X <> 1 AND Y <> 1 ORDER BY Z

I have a relatively large table that is accessed in exactly one way, by exactly one query (on the read side). The query filters the table by two columns (both bit), and sorts by a third column (an ...
1
vote
2answers
901 views

Changing field length when foreign keys reference primary key field in table

I have a situation where a number of foreign keys are referencing a column in Table "A". I would like to change the length of the column in table "A". What is the best way to accomplish this in SQL ...
4
votes
1answer
280 views

Large Transaction Log Backups in Service Broker-enabled system

We have a system that uses Service Broker for asynchronous messaging, with a fairly high throughput of messages. We don't really care about the persistent features of SSB in this scenario -- the ...
2
votes
2answers
945 views

How can I capture queries that fail on the SQL Server due to connection failures?

How can I capture queries that fail on the SQL Server due to connection failures? Profiler doesnt seem to capture if there is a connectivity loss. This is scenario: DB server running in Domain A ...
0
votes
2answers
440 views

SQL Server account delegation setup

I am try to run bulk insert command on SQL Server 2008 but I am having issues with the security. after researching via internet, the problem has something to do with account delegation and ...
12
votes
5answers
1k views

Sequential GUID or bigint for 'huge' database table PK

I know this type of question comes up a lot, but I've yet to read any compelling arguments to help me make this decision. Please bear with me! I have a huge database - it grows by about 10,000,000 ...
0
votes
0answers
82 views

Error message installing SQL Server 2005 Enterprise on my Windows 7 Enterprise [closed]

I have a problem installing SQL Server 2005 on my Windows 7 Enterprise 32 bit operating system. The installation never completes. The error log file states I need to have IIS installed (I do and it ...
2
votes
2answers
356 views

How to login in database if we have lost password? [duplicate]

Possible Duplicate: gain admin access to sql express 2008 Is there any idea if we lost our password to login in database using sql express management studio? Is there any place where ...
4
votes
3answers
683 views

SQL Server Log Shipping: Where is the hottest IO during RESTORE LOG: To db or to log?

Using SQL Server 2008. I have used SQL log shipping for years. Works great. Working with a new standby server (recipient of log shipping), I am seeing very poor log restore performance, and wonder: ...
1
vote
0answers
264 views

Powershell to dump database schema to text file

I want to be able to dump a database schema to a sql text file using Powershell. I want this because our DBAs want to be able to do a diff on the file that is committed to SVN. They won't execute it ...
5
votes
2answers
2k views

I lost my database in SQL server 2008 R2

My database suddenly stopped working and from checking the error logs it says that the master database was corrupted. So I tried rebuilding the system database with the command: setup ...
6
votes
3answers
964 views

SQL Server Leaked Transactions

I have a database accessed by around 50 clients via TDS over TCP which does not seem to be releasing log space. The number of processes stays around the expected 50, and some of them are quite long ...
3
votes
1answer
71 views

a query that shows the load request received through GPRS by salesman

I have mobile sales system, in which the salesman sends their stock request in handheld device and through GPRS the data comes to MS SQL database. I need o show a report that shows the which request ...
2
votes
1answer
590 views

Sql server update query locking stages?

Looking at update MyTable set Status = 1 where Status = 0 of course- the where is calculated before the actual update. but does this filtering (where Status = 0) is also inside the lock ? I mean ...
2
votes
1answer
456 views

What causes Transactional SQL Server Replication to need to be rebuilt/re-initialised

In a company I've recently joined we have two SQL Server instances, connected via transactional replication. I'm a developer and hadn't really come across SQL replication before so am a complete ...
2
votes
1answer
871 views

what is difference between last_worker_time and last_elapsed_time in DMV sys.dm_exec_query_stats?

what is meaning of last_worker_time and last_elapsed_time in DMV sys.dm_exec_query_stats and what is differnce between them? when I fire below query SELECT TOP 20 qs.last_worker_time, ...
1
vote
2answers
565 views

New login is created but 'sa' cant assign grant/deny permissions to user in SQL Server 2008 R2?

I created users with login option in security tab in SQL Server 2008 R2 running on windows 7 successfully and grant permissions to : Use dummydb Grant REFERENCES ON OBJECT::vuUser TO nvp GO Use ...
1
vote
0answers
443 views

Cannot remove .bak file

I have a java application that: Reads a .bak file from a windows fileshare and restores it in SQL Server on a remote windows server Does various modifications on the database restored from the .bak ...
6
votes
1answer
475 views

LOCK error after creating a clustered index

I just created a clustered index on a 1MM row table (page and row locking turned on). I now try to run queries and I get this error: "The instance of the SQL Server Database Engine cannot obtain a ...
8
votes
3answers
760 views

I'm using the SQL Server Agent to schedule even non-database tasks - is this a bad idea?

Since I'm a DBA (and in many cases, the de-facto sysadmin), SQL Server is installed on pretty much every server I have to work with regularly. I realized recently that I've been using the SQL Agent as ...
5
votes
1answer
398 views

Inline table-valued function vs inline sql

I'm seeing some odd behavior in trying to tune an inline table-valued function. Specifically, if I take the guts of the function and it with the same parameters as I'd have called the function with, I ...
3
votes
1answer
683 views

Normalized Table Structure for Logging

How can I normalize a table that has four columns for logging the latest activity for a single record: Created On Created By Modified On Modified By We have dozens of tables, all with these 4 ...
1
vote
0answers
153 views

Distribution Agent running but subscription does not exist?

I have an issue where in my replication topology, the distribution agent is running, and says there are no commands to distribute. However, checking the undistributed commands, it shows there are a ...
1
vote
1answer
97 views

Monitor Sql Server 2000

I was wondering if there is a free tool to monitor state of SQL Server 2000. I would prefer a web tool. I would like to see if some database is accessible, or are there any problems on server, etc. ...
3
votes
2answers
673 views

Cannot generate reports from SQL Management Data Warehouse

I'm running SQL Server 2008 R2 and have installed the MDW on one server and have a Data Collector collecting and uploading the server activity, query results, and Disk activity data to the MDW. When I ...
1
vote
2answers
337 views

Size of TempDB Microsoft SQL Server 2005

Are there drawbacks to having a large tempdb in a SQL Server database? Assuming the disk is not full. I am creating large temporary tables in a couple of queries. Once I am finished running queries, ...
17
votes
2answers
2k views

Optimising plans with XML readers

Executing the query from here to pull the deadlock events out of the default extended events session SELECT CAST ( REPLACE ( REPLACE ( XEventData.XEvent.value ...
5
votes
3answers
346 views

Reducing the size of a database

SQL Server newbie here. I'm a MySQL guy. I'm having a look at something for a client in their 2008 SQL Server, and need some advice. Whoever designed the database chose to log insane amounts of stuff ...
1
vote
1answer
140 views

Transposing data

I have a table with 31 columns which contain values for each day in a month and I want to create a tranpose table like the example below. Real data in the database is really big so I don't expect to ...
2
votes
1answer
399 views

Error deleting more than 1 row

I have a stored procedure that is supposed to delete several rows from a table. It does not work and gives me the error: The transaction ended in the trigger. The batch has been aborted I tried ...
5
votes
1answer
296 views

Why am I missing some output?

Archiving to avoid ID Exhaustion We are about to run out of IDs in one of the tables of our OLTP logging system. It's my job to find a way to 'archive' the existing row data in the full table and in ...
5
votes
2answers
543 views

SQL Server SMO and PowerShell formatting

I have probably been looking at this for too long to figure this out... What is the easiest way I could get this exported to a CSV format? Would it be better to dump this to a table in a database ...
5
votes
2answers
274 views

SQL Server 2008 R2 database is suspect, tried it all. Final destination?

This night my hosting provider made a "hard reset" on my VPS hosted in their farm. And one of most important databases (SQL Server 2008R2 database) is now in Suspect mode. My provider has backups ...
2
votes
2answers
753 views

Accessing a network share via a SQL Server 2012 Availability Group

If you have a SQL Server Cluster called CLS, with machines CLS1 and CLS2, accessing: \\CLS\network\path is equivalent to accessing either \\CLS1\network\path or \\CLS2\network\path depending ...
5
votes
2answers
911 views

Bulk Data Loading and Transaction Log

im currently working on a project which bulk import data from flat files(csv) about 18 differents files each linking to a specific table through some store procedure. I followed the steps as advised ...
1
vote
0answers
152 views

SQL Server BCP imports, but table still has 0 records

I ran the following command from the command line on SQLServer 2008 R2 BCP C4L.dbo.districts in C:\TEMP\districts.sdf -f C:\TEMP\districts_import.fmt -T' No errors were reported and it ran as ...
5
votes
1answer
488 views

Recovery time effects of Availability Groups

We did different kinds of basic Tests and AlwaysOn passed in many tests. We finally did a heavy write test for AlwaysOn and it gave surprising results. The actual Test details are here, the goal is ...
2
votes
1answer
2k views

Error in restore database

I use this query in SQL Server 2008 R2 to restore DB1 database: RESTORE DATABASE [DB1] FROM DISK = N'D:\new.bak' WITH RESTRICTED_USER, FILE = 1, NOUNLOAD, REPLACE, STATS = 10; The following error ...
1
vote
0answers
27 views

database sharding - handling common/universal tables [duplicate]

Possible Duplicate: sql server database sharding - what to do with common data / non sharded data We have a very large scale enterprise level database. As part of our business model all web ...
6
votes
3answers
6k views

How can I backup a large SQL Server database without impacting performance?

We've had reports of queries running slowly or timing out early in the morning, and the only job I see running that I think could affect this is our database backup job. The database itself is about ...
8
votes
3answers
589 views

sql server database sharding - what to do with common data / non sharded data

We have a very large scale enterprise level database. As part of our business model all web users hit our web servers at the same time each month which in turn hammer our sql box. The traffic is very ...
6
votes
1answer
2k views

Timeout expired error while using copy database wizard

Microsoft made me believe that SQL Server 2012 Copy Database Wizard is the most optimal way of copying a SQL Server 2000 database to SQL Server 2012. After struggling a few hours, I was able to get ...
3
votes
3answers
646 views

How to delete large amount of data from a sql table?

We ran out of disk space and we have a table with about 10million records. We'd like to delete the old records which are about 2million. What are the impact of just deleting these using a simple ...
4
votes
2answers
2k views

How do I configure SQL Server 2012 so that it can restore and see files in my user account?

I have an SQL Server 2012 instance running as a service on my computer, and according to the service page it logs on as account "NT Service\MSSQLSERVER". However I can't see that account name ...
4
votes
1answer
1k views

SQL Server 2008 Setup Error 0x80070490

I am trying to install SQL Server 2008 x64 on Windows 2008 R2 and keep getting the following error: SQL Server Setup has encountered the following error: Element not found. (Exception from ...
17
votes
1answer
6k views

MERGE a subset of the target table

I am trying to use a MERGE statement to insert or delete rows from a table, but I only want to act on a subset of those rows. The documentation for MERGE has a pretty strongly worded warning: It ...