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)

3
votes
2answers
1k views

Log all errors in queries

I have a database Microsoft SQL Server 2008r2 I have some applications in different programming languages. Some of them are legacy and I would not like to modify. Is there a way to log at server level ...
3
votes
1answer
532 views

Are there problems with using SQL Server AlwaysOn Availability Groups with Windows 2008R2?

[Cross post from StackOverflow] Brent Ozar published this webcast (slides, video with free registration) entitled "Real-Life SQL Server 2012: AlwaysOn Lessons Learned", in which he repeatedly states, ...
3
votes
1answer
337 views

What are the implications of changing the SQL Server Service Logon Account?

What are the implications of changing the SQL Server Service Logon Account? My default instance currently uses Network Service. I want to change this to a domain account. Are there any implications?
1
vote
2answers
192 views

Move named instance to another server

To be honest I'm not a DBA expert. I get asked by one of my clients in terms of moving a SQL Server development instance that is stored in the production server (source) to another server ...
1
vote
3answers
96 views

Live monitoring SQL statements on SQL Server

How can i monitor running SQL Statements for my SQL-Server, is it possible using only SQL Server without 3rd part tools? As an alternative can anybody recommend any free tool which can monitor ...
3
votes
2answers
2k views

Resetting a SQL Server 2012 sequence

I'm in the process of testing and populating a specific table that leverages the SEQUENCE object. In this process I'm testing populating the table with tens of thousands of insert lines (as I'm ...
3
votes
2answers
2k views

Find orphaned users

In SQL Server 2005, is there a way to find users that either don't exist at the server level (an account that was deleted at server level but wasn't disassociated from databases before it was deleted) ...
4
votes
1answer
373 views

dbo.DTA_* tables in MSDB

I ran Brent Ozar's sp_blitz on one of my production server. IT tagged a few tables in the MSDB database as being user created. They all follow the pattern dbo.DTA_*. Do these table come with MSDB, ...
2
votes
2answers
5k views

ORDER BY clause is allowed over column that is not in SELECT list?

In theory, every statement in SQL Server create virtual table passed to next statement. In other words, when FROM and Where clause are finished, next step is SELECt columns from virtual group created ...
13
votes
4answers
5k views

Can I launch a stored procedure and immediately return without waiting for it to finish?

We have a stored procedure that users can run manually to get some updated numbers for a report that's used constantly throughout the day. I have a second stored procedure that should be run after ...
5
votes
3answers
253 views

Everyone warns against shrinking a database, but will it work in my case? 1 GB db with tables removed now 100 MB

Everyone is warning against shrinking a database, e.g. SQLAuthority But will it be a valid option in my case? The database was originally more than 1 GB, but with a table removed from it (moved to ...
5
votes
1answer
117 views

Safe to kill SPID as long as its a SELECT

We just ran into a problem, where a server process running a select was blocking our entire public website. What we ended up doing was killing the server process. My question is: Is it considered ...
3
votes
1answer
440 views

SQl Server 2008 R2 - sa can login but not access database

Up until this morning I had no problems accessing our database. This morning, something has changed and I can no longer access our database (called EMS_Main) using the sa login. I can log into the ...
3
votes
1answer
635 views

Execution of sequential delete and uncommitted read

We are running the following queries using dynamic SQL, which is erroring out for few cases when we run concurrent instances. The error is: Could not continue scan with NOLOCK due to data ...
7
votes
1answer
567 views

How does sampling work when updating statistics?

I have several massive tables. I'd like to ensure their statistics are up to date via a weekly maintenance plan. However, doing so is taking too much time. If I specify WITH SAMPLE 50 PERCENT ...
4
votes
1answer
306 views

Stored procedure performance metrics

I am taking over a new project which is having ~2500 SPs! and would like to know at current state what is the maximum / minimum time taken by each of the stored procs. Also IO, Logical Reads used by ...
6
votes
2answers
465 views

SSIS Validation slow. OLTP OLAP running on same server

I have four identical servers 2 are used in production and the other two are demo machines/emergency fail over boxes. The more powerful machine a 16 core 127 gigs of Ram hosts both our Datawarehouse ...
2
votes
0answers
102 views

SQL Server 2008 Restore from D2D

In that past year we started using a D2D network device to store our SQL Server backups. This device does dedup and compression. It looks just like any standard CIFS share (\\d2d\sql_backups\...). ...
3
votes
1answer
94 views

What to do with duplicate lookup information

I have multiple databases that I want to store in one data warehouse database. I am wondering how I design the import process to handle multiple lookup tables. For example, say I have 5 databases all ...
7
votes
1answer
1k views

Why does sql server need to convert count(*) result into int before comparing it with an int variable?

I have many queries in my application where in the having clause, I have comparison of count aggregate function with int variable. In the query plans, I can see an implicit_convert before the ...
3
votes
1answer
552 views

LIKE character length limitation

The background to this question can be found here. The following part of my stored procedure does not work. Is there a character length limitation for the LIKE clause? t1.ProductList sometimes can be ...
4
votes
1answer
303 views

Is it possible in SQL Server to change default “order by” direction from asc to desc?

This question came up in a discussion at work... given the following T-SQL statement: select firstname, lastname from users order by lastname; the default sort order on the order by clause is asc. ...
5
votes
2answers
385 views

Stored Procedure as Create Table proxy?

With SQL Server it was my understanding, I thought, that you could elevate a users permissions with specific constraints. For example, you need a user to create a specific table object in a specific ...
0
votes
1answer
443 views

How to remove symbol from file

I am using ssis to generate some .dat files which are then sent to linux server for automated load. It looks as windows add some symbol character in file which is not easily identifiable first but if ...
5
votes
2answers
6k views

SAN block size for SQL Server on 4KB NTFS

A potential customer wants to evaluate our storage system. They run Windows 2008R2 x64 with 4KB NTFS on a virtual test machine they've sent us. They did not seem to know this at hand, so I think it's ...
4
votes
2answers
1k views

Can I recover a TDE certificate by restoring the MASTER database?

(We are, fortunately, not currently in this situation, just planning ahead to see what our options would be if it ever occurred.) For a database encrypted with Transparent Date Encryption (TDE), a ...
4
votes
2answers
814 views

SQL Server replication for off site copy

We have our Primary SQL Servers in-house (15 primary servers at the moment (500 databases approx overall), most of the servers have hex core processors). These are mirrored to other backup servers in ...
9
votes
2answers
3k views

Why are non-digits LIKE [0-9]?

My server's default collation is Latin1_General_CI_AS, as determined by this query: SELECT SERVERPROPERTY('Collation') AS Collation; I was surprised to discover that with this collation I can match ...
0
votes
1answer
804 views

Does TRUNCATE TABLE affects isolation level in Sql Server?

As I am working on the project which has SQL SERVER as a database....I'm maintaining isolation level in my project where I enabled snapshot isolation level for my project.... As I have to make some ...
1
vote
1answer
113 views

Does a transaction cover the subroutines?

When I begin transaction and exec a stored procedure, does that transaction cover the changes made by the stored procedure I executed? Would a rollback transaction cancel the changes made by the ...
-7
votes
2answers
108 views

I have table with 17 Indexes if i add 1 more index for search in two columns [closed]

I have table with 17 Indexes if i add 1 more index for search in two columns insert , update and delete queries will be slow.I dont want them to slow...what to do
1
vote
1answer
430 views

SQL Server connection failed for domain user from Mac OS machine

I have SQL Server 2008 R2 SP1. I am using connection string to connect to SQL Server. In connection string I am passing the driver path, server name, TCP port number, user name with which I want to ...
2
votes
0answers
55 views

Is it possible to have a valid backupset with null position?

In database restore process I need to rely on position column exists in backupset record to restore the latest backupset. Restore the latest backup on the database I noticed sometimes position is ...
4
votes
1answer
290 views

Adding indices to views

I have a table that contains XML data in a varchar type field. This field is used to store data from a variety of different XML schemas some of which are related via a record stored in another table. ...
2
votes
1answer
295 views

PK Fragmentation on INT IDENTITY column

Have simple Int Identity as my PK. Table has 2.2 million rows. Zero row deleted, never disabled the Identity. Inserts were via .NET a row at a time with every insert retrieving the ...
3
votes
1answer
472 views

How can I make sure the SQL Server query optimizer uses the exact tables in the query

I have a query running in SQL Server 2008: select count(*) from table1 join table2 on table1.col1 = table2.col2 In the data warehouse where this script runs, a table called thin_table1 is ...
8
votes
3answers
3k views

Restrict access for Windows administrator

As the SQL Server best practices says, "Windows Authentication mode is more secure than SQL Authentication". And now I want to know: is there a way to protect SQL Server from user with Windows ...
1
vote
1answer
52 views

Should I update to sql server 2008 sp2 before restoring the db's or do the update after?

I'm making a move from SQL Server 2008 to SQL Server 2008 R2 (Azure VM) as part of a hosting provider switch (from MyHosting to Azure). Should I update the VM to R2 SP2 before restoring the db's or do ...
5
votes
1answer
211 views

Logical reads amount difference with almost identical indexes

I'm trying to figure out why two identical queries are taking slightly different times when executed under two indexes that are almost identical, in SQL Server. The mentioned query is quite simple, ...
2
votes
2answers
170 views

Using SQL Server 2012 for Business Intelligence Features Only, No Database Engine

I would like to implement SQL Server 2012 purely for the Business Intelligence Features: SSIS, SSAS and SSRS on its own server. I current have SQL Server 2008R2 Database Engine installed on another ...
0
votes
0answers
1k views

SQL Server 2012 SSIS\SharePoint Kerberos auth [closed]

I have some issues setting up Kerberos together with SQL Server and SharePoint. Any help will be much appreciated! =) GOAL: Use Kerberos to avoid double-hop issue. USAGE: User logs onto ...
0
votes
2answers
93 views

Getting the exact edited data from a column in SQL Server

I have two Tables: Articles(artID, artContents, artPublishDate, artCategoryID, publisherID). ArticleUpdated(upArtID, upArtContents, upArtEditedData, upArtPublishDate, upArtCategory, ...
2
votes
1answer
816 views

Should I use Asynchronous Mirroring?

I plan on setting up mirroring on a SQL 2012 database which is currently in production. My concern though is how much it will affect the performance of the principal database. I am using mirroring ...
1
vote
1answer
2k views

SQL Server - Must be first statement in query batch - what and why?

I cannot find a list of type of objects that while being created the command must be the first statement in query batch. So far I ve found that function/stored_procedure/view must be the first. Does ...
1
vote
1answer
366 views

Installing Full Text Search on SQL Server 2008 R2 Express

I can't for the life of me install full text search on my SQL Server 2008 R2 instance. Every installer I have tried shows me this: I've tried: SQLEXPRADV_x64_ENU.exe SQLEXPRWT_x64_ENU.exe ...
0
votes
1answer
122 views

Changing data type from DATE to CHAR(10) with a query

I want to alter the date type in a database that has 40 tables from DATE type to CHAR(10) type, without opening the tables and manipulating them in Management Studio. i.e. only with a script/query. I ...
1
vote
1answer
1k views

Installing SQL Server 2000 x86 Enterprise on Windows 2003 x64

I have inherited (lucky me) a very old accounting system which will be retired over the next 18 months. In the meantime, for various reasons, I need to upgrade the DB server. It's currently running ...
4
votes
1answer
557 views

Replication between SQL Server 2005 and Azure database

Is it possible to set up transitional replication between a SQL Server 2005 and a SQL Azure database? My server is nearing end of life and I would rather migrate to a cloud infrastructure instead of ...
4
votes
1answer
237 views

Error in SQL Server 2012 OUTPUT clause

Given the following SQL code against the AdventureWorks Database: begin transaction; drop trigger Sales.iduSalesOrderDetail; alter table Sales.SalesOrderDetail add LineNumber int null; go with ...
0
votes
1answer
247 views

SQL Server merge replication across domains

I'm getting the following message when trying to set up merge replication on SQL Server 2008 R2: The Merge Agent failed to locate the partitioned snapshot for this subscription in the expected ...