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)

2
votes
1answer
690 views

SQL Server 2008 r2: What events/queries hit tempdb

We had a slowdown on a db server this morning. Checking the logs, the only thing that happened during the 2-minute slowdown worth noting was an object being created and deleted in tempdb over the span ...
2
votes
2answers
602 views

SQL Server 2008 R2 Query For Failed Email Notifications

Is there a SQL query I can run to see if there has been any failed attempts to send database mail in the last X Minutes?
4
votes
2answers
260 views

Backup VLDB replicated database in SQL Server?

I have a problem with my backup strategy. Currently I'm doing a Full Backup every night and transaction log backup every 2 hours to TAPE. This used to work without problems, but the size of the DB ...
4
votes
3answers
2k views

Query the Owner of SQL Server 2008 R2 Jobs

Is there a way to query the owner of all jobs in SQL Server 2008 R2? I discovered when maintenance plans are edited the owner gets changed, so I want to make sure they are all owned by sa.
7
votes
1answer
10k views

How can I recover data from the LDF file?

We are using SQL 2005 Express Edition. We want to read the data from the LDF file in order to restore some deleted records. We tried using a trial version of ApexSQL which helped us a lot. Instead of ...
6
votes
4answers
241 views

Query Performance depending on parameter 21seconds vs. > 14hours

I have the following query: SELECT DISTINCT DATEADD(ms,DATEDIFF(ms,0,[Time]),DATEADD(dd,0,DATEDIFF(dd,0,[DATE]))), [DATE], DATEPART(YY,[DATE]), ...
0
votes
2answers
797 views

Mirroring after restoring the database on a new machine

We've had alot of problems with one of our database servers and two days ago the call was made to change a disk and reinstall the OS. Now this server functioned as part of a mirroring setup. Basically ...
4
votes
1answer
1k views

Alternatives to LIKE and FTS for mid name search

I have a question about what are the alternatives for LIKE '%%' and Full-Text Search when it comes to searching organisation names, firstnames, surnames, etc. The LIKE '%%' causes table scan, however ...
1
vote
1answer
122 views

Log all user error messages for retrospective troubleshooting

Suppose I want to log all severity 16 (and higher) user error messages to a database table in order to allow some retrospective application troubleshooting (since the answer to "Can you send me the ...
1
vote
2answers
145 views

why doesn't time for a simple update scale linearly with the number of records?

I am running some performance tests and I started with a dataset of 900.000 records the update took 10 seconds or about 90000 records per second. Then I increased the number of records to 9.000.000 ...
6
votes
4answers
2k views

How does SQL Server reduce index fragmentation?

If a user never runs REBUILD or REORGANIZE on their database, does SQL Server still somehow defragment the indexes? MSDN suggests that if an index is over 30% fragmented, it is recommended to run ...
3
votes
1answer
758 views

Index fragmentation increase as more row being deleted

I have a table that contains more than 18 million records. I have a process that clears data out of that table everyday. Index fragmentation was low. This table has high transaction throughput. ...
1
vote
1answer
331 views

Buffer Pool and Multiple instances of SQL Server

If you have multiple instances of SQL Server running on the same windows server system, a) Does buffer pool is shared amount multiple instances? b) What is the effect of running DBCC ...
2
votes
1answer
5k views

Behavior of Varchar with spaces at the end

When I use a Varchar with spaces it ignores the spaces at the end. ex: declare @X varchar(50) This... set @X= 'John' ...is the same as... set @X= 'John ' It considers these to be ...
-1
votes
1answer
298 views

Does SQL Server full restore set the differential base?

Differential backups are taken as the difference between the current state, and the last full backup called the "differential base". Does restoring a full backup reset the differential base? If so, ...
4
votes
1answer
4k views

Converting Microsoft SQL Server collation to UTF 8

I've a Rails-Application, which reads data from a Microsoft SQL Server 2008 R2 Database. All umlauts are represented by a '?', so I checked the encoding of the database. The encoding is 'Latin 1'. ...
2
votes
2answers
495 views

Alternatives to sp_indexoption for Row Locks and Page Locks in SQL Server 2008

Are there better alternatives to setting the Row Locks and Page Locks in SQL Server 2008? The case here is to set the row and page locks to false on the table. The lock is in effect during a series ...
1
vote
2answers
813 views

SQL Server 2008 R2 - user disk quota

Is it possible to apply restrictions on how much data a user / login may store in a database? I found no way to apply such restrictions to schemas, for instance. If there is no built-in mechanism ...
2
votes
2answers
796 views

Unable to locate database.mdf in production server

1) I want to attach a database from my development server to my production server. The database ESpiceHerbs from my development server is located at: C:\Program Files\Microsoft SQL ...
4
votes
1answer
455 views

database design issue

This is my first time on this beautiful content rich site. I have a sql server 2008 database, but am not too experienced with good relational database design. My project is this: I have a school ...
13
votes
1answer
1k views

What's the anatomy of a columnstore index?

One of the new features in SQL Server 2012 codenamed Denali is the Columnstore index. I know a good bit about regular old row-store indexes, like the b-tree structure, differences in storage between ...
10
votes
1answer
5k views

Are there any risks to granting users SQL Server SHOWPLAN permission?

I'm doing some performance tuning on a large SQL server 2008 database, and the IT group is unwilling to give SHOWPLAN permission. In the past, "Show Execution Plan" has been the most effective way to ...
3
votes
1answer
322 views

What do I need to sync a local site office SQL Server with the Head Office SQL Server

The company has a desktop application powered by SQL Server from the head office that is dependent on an internet connection to our remote sites. Usually when we move to a new site there is a good ...
3
votes
3answers
2k views

Does ORDER BY on a clustered key effect performance?

Say I have a table clustered on PrimaryKey, and in all cases I want my results to be ordered by PrimaryKey so I additionally always ORDER BY PrimaryKey in all queries. Does this ORDER BY affect ...
3
votes
2answers
2k views

Max number of tables (objects) in SQL Server editions (compact, express)

What are the maximum number of tables that you can have in: SQL CE4 SQL 2008 R2 Express Numbers here http://msdn.microsoft.com/en-us/library/ms143432.aspx I guess is for SQL Server 2008, but are ...
0
votes
3answers
543 views

SQL Server : primary keys advice to my whitepaper needed

I've tired to explain to every new junior developer in our r&d team why he should use Primary Keys and how to do that. So I decided to write small whitepaper, which every new developer should ...
1
vote
4answers
2k views

SQL Server error log monitoring

In SQL server instance(s) I manage; I see a lot of activity and messages in SQL server error log for e.g. backup or transaction log backup completed etc.. We have quite a few databases in one instance ...
1
vote
1answer
2k views

SQL Server 2012 Create index with Sort In TempDb On - Gains False?

If I create an index e.g Create nonclustered index(Path, Value, Id) with(sort_in_tempdb=on); It doesn't fail but when looking at the index in SMMS, it says False. Any ideas why? EDIT: Can not find ...
3
votes
4answers
158 views

What is the optimal set of database maintenance tasks for high volume of transactions

I have a database that has a high volume of data being inserted and deleted each week. Every week there are approximately one million rows of data being deleted and inserted. Each month the base ...
99
votes
18answers
21k views

Should developers be able to query production databases?

Should developers be given permission to query (SELECT / read only) production databases? The previous place I worked, the development team had the db_datareader role; where I work now the ...
9
votes
2answers
5k views

How to create an Event Notification that runs a Job/procedure when mirroring state changes

I'm asking this question in the sequence of this one Can I send a string over TCP using T-SQL? Remus Rusanu exposes what it seems to be an optimal solution for my problem, but... I'm too immature to ...
1
vote
4answers
828 views

Update column of a large set of records with a calculated value

I am trying to figure out what a good way would be to write the pseudo query below in TSQL taking into account that there will be about 50 actualResult records and 100.000 prediction records per ...
6
votes
1answer
178 views

Was I right with locking?

Regarding the this question I want to ask Comparing two queries: (1) DELETE dbA.dbo.tableA FROM dbA.dbo.tableA a WITH(NOLOCK) JOIN dbB.dbo.tableB b WITH(NOLOCK) ON b.colA = a.colA AND ...
1
vote
0answers
344 views

How to manage SQL Server Log file? [closed]

I have an application build on SharePoint 2007 platform, and currently I encounter a common issue where the Database Log file growth rapidly and fill up the hard disk space. In my situation, I wanted ...
0
votes
1answer
440 views

which DBMS should i go for? [closed]

I am interested in learning a DBMS. As a beginner which DBMS should i go for ? I know few DBMS by name like Oracle,Sql Server,My Sql . How are these DBMS different from each other ? As a beginner ...
2
votes
2answers
1k views

Best practices for creating partition schemes and functions

I'm implementing partitioning for the first time in SQL Server 2008 R2. I've several large tables that I am partitioning. My main question is: Should I use the same Partition Scheme and Function for ...
4
votes
1answer
340 views

Is there a way to make SQL Server's Database Tuning Advisor use more than one core?

I'm using SQL Server's Database Engine Tuning Advisor to generate recommendations for performance improvements on my database server. For the "consuming workload" step, it appears to use all ...
4
votes
1answer
2k views

SQL Server 2012 replication permissions with virtual user and agent credentials

For development/testing I set up replication in SQL Server 2012 RC0 (11.0.1750) using the default permissions on the agent, and I'm getting this error: Message: Access to the path 'C:\Program ...
3
votes
3answers
887 views

SQL Server 2008 R2 - Specify the Full Backup to use when doing a Differential Backup

When I backup my Database, I do a Full Backup every day who goes on a tape. I am trying to use the Sunday's Full backup to set up an additionnal Differential Backup, how can I do this? It only takes ...
0
votes
1answer
1k views

Can Microsoft Log Parser 2.2 open SQL LDF files?

From the technet article for Microsoft's Log Parser 2.2 it states that "Can't find an input format you need? The new COM input format makes it possible to create your own custom Input Format and ...
0
votes
1answer
498 views

SQL Server collation mismatch

I have database server with collation: SQL_Latin1_General_CP1_CI_AS I got database backup file which collation is: Latin1_General_CI_AS When I'm restoring this database and executing some SQL, I'm ...
11
votes
2answers
4k views

SQL Server Frozen Ghost Cleanup workaround needed

I have several tables with amount of rows between 5M and 1.5G Each table has its BLOB field, which size varies from 100 bytes to 30 MBytes and which is stored as 'large value types out of row' = ON ...
5
votes
1answer
1k views

Nested queries or temp (#) tables in SQL Server

I have written a web application which aggregates and presents data from a SQL Server. The data involved is large, and there is a lot of aggregation involved. Currently, under advice from an 'expert' ...
2
votes
4answers
20k views

How to create and send mail in SQL Server 2008?

I want to send E-mail from SQL Server 2008. What are the basic steps for that? Can you explain me if someone used this facility. Any help will appreciated. this link will helpful as commented by ...
8
votes
5answers
1k views

Inclusion of ORDER BY on query that returns no rows drastically affects performance

Given a simple three table join, query performance changes drastically when ORDER BY is included even with no rows returned. Actual problem scenario take 30 seconds to return zero rows but is instant ...
6
votes
4answers
953 views

Four db servers all identical, one is much slower than the others

The setup We have an application loading a lot of transaction data for later querying. It's sharded on 4 SQL Server 2008R2 Enterprise Edition on Windows Server 2008 64 bits. All servers are ...
4
votes
2answers
2k views

Is there a way to ensure that a SQL Server trigger will be executed?

My supervisor is hesitant to use a trigger in a process because if there is a network interruption at just the right time, the process would not complete. Does SQL Server include the trigger in the ...
1
vote
3answers
5k views

Select Which Database Mail Profile is used in SQL Server 2008 R2

I am confused about Database mail profiles in SQL Server 2008 R2. When setting up severity notifications as well as "notify operator tasks" in maintenance plans, what determines what mail profile is ...
5
votes
3answers
7k views

Shrink database after drop table?

I had a table with 70+ Million records in a msSql database, I drooped that table to free up space on the disk. But it looks like the size didn't change much. but I do see that I could shrink the db ...
2
votes
4answers
879 views

Does a full transaction log cause a rollback?

Will a transaction that is trying to write something into the transaction log be rolled back if the transaction log is full?