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)

6
votes
4answers
3k views

SQL Server script to delete accounts no longer in Active Directory

We have a SQL Server 2000 that will shortly be migrated to SQL Server 2005. It has years of Windows Authentication accounts created that no longer exist in Active Directory, which prevent the Copy ...
2
votes
2answers
2k views

Restore SQL Server database using Windows Powershell 3.0

I'm trying to restore a SQL Server database with a PowerShell script, but I'm having problems. Here is the error I'm getting: Exception calling "SqlRestore" with "1" argument(s): "Restore failed ...
2
votes
1answer
659 views

Right Trimming Binary Data in SQL Server

Scenario: I am inserting a string into a binary field (CONTEXT_INFO) and then later attempting to pull it out and convert it back to a string. When I do, the resulting string has a length of 128 ...
1
vote
1answer
2k views

SQL Server - how transactions and transaction log work (simplified)

I have a theory on how transactions work, but I would like if someone could verify it or correct some points if possible. Let's consider we have a database with full recovery model. Now, everything ...
1
vote
1answer
154 views

SQL Server 2005 Blocking Issue

I am experiencing a blocking issue in sql server 2005. An end user executes a query (e.g. select statements) and seems to get into a never-ending blocking until i kill the process e.g. for hours on ...
4
votes
3answers
191 views

Easiest Way to Move 100 Databases

I need to move about 150 databases from one server to another server. SQL Server 2008 Web Edition SQL Server 2012 Preview (in a different datacenter - East Coast Azure) I was planning on moving ...
7
votes
1answer
654 views

Equality query on NVARCHAR column yields multiple results in SQL Server 2012

I am in the process of moving a pet project from PostgreSQL (9.2.2) to SQL Server (2012 Standard). I've noticed an interesting phenomenon when querying unicode words. Given the definition: CREATE ...
3
votes
1answer
427 views

Why SQL server unload CLR assembly every midnight

Every midnight not a specific time, the sql server will unload the CLR assembly. The reason is that due to memory pressure, the assembly is marked with unload and will be unloaded soon. How to make ...
1
vote
2answers
3k views

Multiple triggers vs a single trigger [closed]

Scenario: Each time data is inserted/updated/deleted into/in/from a table, multiple unrelated items of business logic need to be executed. Question Given that the solution is to use database ...
2
votes
1answer
145 views

can you run sql server 2005 and sql server 2008 r2 in mirror mode?

Must all db servers be running the exact same version to enable mirroring without a witness server? How about with a witness server in place?
2
votes
2answers
4k views

SQL Server drop and create all users in every DB

I would like to drop and recreate every user in a database without having to manually do this for 500 users. I have this so far: USE [Maintenance] GO IF EXISTS (SELECT * FROM ...
1
vote
3answers
576 views

Point in time recovery from the same database - what does it mean?

I have two questions. I have a database in full recovery mode. Lets call transaction log an LDF file for short. SQL Server allows me to restore to point in time in the past when restoring from ...
4
votes
1answer
2k views

What is the difference between NORECOVERY and RECOVERY when restoring database?

Can anyone explain the main differences? Any help appreciated.
5
votes
2answers
1k views

SQL Server - contents of transaction log file in more detail

I have a question regarding transaction log (let’s just call it LDF for short) contents. I am assuming a database with full recovery model. I have read that LDF file contains (logs) each and every ...
0
votes
2answers
231 views

How can I make only *one* user controlled database

How can I system admin let it be me, but another users and admins must be cannot access my database. My database located on customer server. I deleted all sql users, there's only sa user. This ...
1
vote
3answers
629 views

Support both stored procedures and functions with same TSQL code base?

We have a need for both Microsoft SQL Server 2008 functions (ITVFs) and stored procedures to provide the same interface and functionality to end-user reporting frontends. Given the following ...
2
votes
2answers
356 views

Advantages of Database Snapshot

Can someone please highlight the advantages of Database Snapshot in SQL2008. I read some where that "When a Database Snapshot is created, SQL Server doesn’t allocate space on disk equivalent to the ...
2
votes
0answers
340 views

SQL Server 2008 R2 - Deadlock Trace, Need Help Understanding It

I really need help on understanding this deadlock, i've already replaced the values, mind if anyone helps me interpreting where my deadlocks are coming from? What does e_waitpipegetrow mean? btw, i'm ...
9
votes
1answer
3k views

How to manage 3.1 billion rows of data?

I am currently tasked with implementing a storage schema for a relatively large amount of data. The data will primarily be accessed to determine a current data point value, but I am also required to ...
2
votes
0answers
94 views

SQL Server Online Training [closed]

I recently took an intro class for MySQL from www.oreillyschool.com and it was very helpful. The next class they offer is administering MySQL but I currently work with SQL Server. The first class was ...
6
votes
2answers
379 views

SQL Server Select Count READ_COMMITTED_SNAPSHOT QUESTION

I seem to be getting a lot of deadlocks when doing select count(*) on a particular table. I have already changed all the required parameters and made them into row only locking. I've also changed the ...
4
votes
1answer
5k views

Safe way to truncate SQL Server Error Log

We are running out of space. What is the safe way to clear the error log?
1
vote
0answers
39 views

Query Regarding Database Instance not proper

Please sort out one issue regarding SQL Server instances. I have one instance of SQL Server named 'Test\Connect' and other one is 'local' by default. So the issue is when I connect to local and ...
2
votes
0answers
398 views

Tables not shown in SQL Server Enterprise Manager

For some reason 3 tables which are clearly in use by the application are not listed in the Tables view in SQL Server Enterprise Manager. It's SQL Server 2000. When generating a diagram, a popup ...
0
votes
1answer
327 views

SQL Server 2000 export database to csv

I need to move an SQL Server 2000 database to MySQL. I'm running into several complications. I'm no expert on SQL Server. To get going I'd like to have a csv-dump of structure and data. First issue, ...
4
votes
2answers
4k views

Transaction and Try-catch in SQL Server Job

We have DML operations in each step of a SQL Server job. To ensure the update/insert will be rolled back in case something goes wrong, I have wrapped the data modifications of each step in TRY CATCH ...
0
votes
1answer
234 views

Is this schema usable for multi-tenant clients?How to remove multi-cascade paths?

I am newbie to database design. I want to build multi-tenant application that will have the following schema for its data: School(*schoolid*, schoolname, schooltype); ...
6
votes
2answers
259 views

Why would a SELECT INTO cause an arithmetic overflow?

I am doing this SELECT * INTO table1 FROM Table0 I get an arithmetic overflow on a datetime column (error converting to smalldatetime), however the destinations schema that got created has a ...
3
votes
1answer
2k views

Does this mean the 'public' has full select, insert, update, and delete access?

I'm trying to create a new DB user in SQL Server 2008 R2 that can only select from one SQL View. But no matter what I try when I login as this new user I can select from any table. I ran this query: ...
0
votes
1answer
91 views

Is it possible to use Native Clients from previous releases to connect SQL Server 2012?

Is it possible to use SQL Server Native Clients from previous SQL Server releases (e.g. SQL Server 2008 R2 Natice Client) to connect SQL Server 2012 database?
2
votes
0answers
484 views

Network issues with sql server

There are two servers on co-location. First is Windows Server Standard 2008 R2 SP1. Second is Windows Server 2012 + Sql Server Standard 2012 SP1. First server has a task with a report against tables ...
6
votes
2answers
7k views

SQL Server gets slow over time until we have to restart it

We have a database with a mixed OLAP/OLTP workload. The queries are quite ad-hoc and are dynamically created in the mid-tier application server. When we start the server, the performance is quite ...
0
votes
1answer
335 views

SQL Server Job logging best practice

To be able to design a robust Job in SQL Server, we need to have log for each step of the job. I know there are different options available which help us for troubleshooting a job, but what if we want ...
2
votes
3answers
352 views

Performance impact of Splitting Table across files

EDIT: I think the original question (below) was not worded very well, and probably caused confusion. The basic question is: If I have a SQL Server 2005 database using a single .mdf file and I change ...
3
votes
1answer
2k views

Unable to open BCP host data-file error

Having problem using BCP via xp_cmdshell. I exported the table data to a file as .dat but when I try to import the file to a new table, I am getting the below error. The SQL Server service and the ...
2
votes
2answers
87 views

Log shipping and log file: Can the log on the master or slave every be truncated/shrunk?

SQL Server 2008, standard log shipping setup (well, using redgate, but it is a pretty normal flow). On the replica, the log file is pretty big. Wondering if on the backup/replica servers it is OK to ...
3
votes
1answer
302 views

SQL Server Plan Guide vs Plan Freezing

I am bit confused with terminology as official Microsoft SQL Server documentation including BOL refers to plan guide the one you create using sp_create_plan_guide proc. Does plan freezing is same ...
0
votes
1answer
600 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.
2
votes
3answers
12k 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
131 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
155 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
1k 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
308 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
1k 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
465 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
2k 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
85 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
371 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
731 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: ...