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
11 views

SQL Server Replication across firewall

We would like to set up replication between two SQL Server 2012 instances. Server "Internal" can see and make connections to server "External". External is completely firewalled from the internal ...
0
votes
1answer
31 views

How user options works at SQL Server?

I'm searching one way to set ARITHABORT ON for all opened connections, and I found this question. Some answers says to run the following command, and it really works: EXEC sys.sp_configure N'user ...
11
votes
3answers
960 views

Is a weekly rebuild of indexes a good idea? [duplicate]

We had a SQL expert suggest rebuilding our table indexes weekly. We're currently doing this Saturday night and it causes lots of timeouts during the rebuild process. I'd like to avoid the timeouts ...
0
votes
1answer
25 views

Need to make sense of FileTable permissions

I'm setting up a FileTable to allow users to quickly stuff some PDF report files into a database for later searching via an intranet application (to be built later). Sorting out the necessary ...
1
vote
2answers
181 views

What is the best way to purge data from a table with minimum damage to performance?

When you purge records from a database table, deleting them, you have impact on the logical and physical structure of the target table, as well as indexes and statistics. What maintenance should be ...
5
votes
2answers
109 views

How do I merge similar records with different validity dates?

The table I am working on has three components: An ID column (primary key in another table) Some data columns Date valid from/to columns. Values: ID Data From To 1 a ...
3
votes
2answers
33 views

Trace to find “error messages”( SQL Server 2008 R2 )

I'm using this config, trying to find error when a certain host executes a task ( it runs inside a software ): The user says that the software is running, but it's not updating what it needs to ...
1
vote
0answers
16 views

Why do async_network_io wait types occur?

Last week something strange happened on our database. All of a suddon, the application blocked for our users which were not able to save new entities etc. After looking at the Activity Monitor of the ...
2
votes
1answer
55 views

How to full text search worked with special character like “of”?

How to search with fulltext search if keyword has special character like "of", "-" ...etc select * from table1 join CONTAINSTABLE (table1,(Title,Description_HTML), '"of" and "Department"') tb2 on ...
3
votes
1answer
25 views

Microsoft Help Viewer in ssms 2014 doesn't open local documentation

I have Visual Studio 2013 installed I have downloaded all documentation I need installed via visual studio. I can open it with the command "C:\Program Files (x86)\Microsoft Help ...
-2
votes
0answers
51 views

does getdate() function causes deadlocks [closed]

I have a stored procedure which returns has current date and time as output using getdate() function. Sometimes this procedure is causing deadlock. This stored procedure is used in many entry screens ...
2
votes
1answer
46 views

dump files maxing C drive with corrupt mdf

I have some databases with corrupt mdf and my C dive on the SQL server is getting maxed out with error dump files, I am not asking how to troubleshoot why these files are being created, I already ...
1
vote
0answers
30 views

limiting number of error log dump files retained

SQL server 2008 R2 if I limit the number of error logs retained by setting the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\NumErrorLogs will this limit the number of dump files ...
3
votes
1answer
39 views

Operation System error 665 with VLDB backup (The requested operation could not be completed due to a file system limitation)

Has anyone seen the following error while doing backups? We have tried different LUNS from different storage pools and are seeing the same result. Here is the error message: Operating system error ...
1
vote
1answer
67 views

Most efficient way to insert rows into a temp table in a stored procedure

I am working in SQL Server 2008. I have a stored procedure with 5 queries inside of it that select rows from very large fact tables (on the order of millions of rows) into another table (call it ...
2
votes
0answers
18 views

SQL Server 2008 Replication “between retries” or “worker thread no available”

All our existing servers are in SQL 2008 and I am in the process of upgrading to SQL 2014 and as well moving SAN to different SAN storage. As part of it I have to upgrade my distributor. We got ...
3
votes
0answers
41 views

Database Maintenance Planner greyed out (disabled)

I have to look into some SQL Server 2000 maintenance plans, but Database Maintenance Planner option is greyed out in Tools menu of Enterprise Manager. SQL Server Agent seems enabled and running, ...
2
votes
1answer
30 views

Select columns dynamically from sql server table

Lets say I have a table that actually store record which looks like Create Table dbo.Info ( SN int primary key identity(1,1), FirstName nvarchar(50) not null, LastName nvarchar(50) not null, ...
1
vote
0answers
28 views

How to resolve Error 7311 returned by a job running against a linked server?

I have a job and a linked server. The job was working fine for a while, but recently I started getting this error message and I couldn't find a soloution for this. Executed as user: ... Cannot ...
2
votes
3answers
85 views

Restore a large number of transaction logs

I'm using SQL Server 2008 R2, and I need to restore 36 .trn logs to a database. I have restored the first 4 using the restore transaction log functionality in SSMS (right-click database > tasks > ...
0
votes
0answers
22 views

Where can I find exact rules of a collation?

Is there any documentation anywhere for the exact sorting/equality rules defined by a collation in Windows (SQL Server), for instance "Finnish_Swedish_CI_AS"? I know about CI/CS, AI/AS etc, but I'm ...
2
votes
2answers
47 views

JOINS - optimize cost of LIKE/OR criteria

The Active table has the Account Name in 1 column and the Master table has the Account Name in any one of 6 separate address columns and I'm trying to match them. Also, they don't necessarily exactly ...
1
vote
0answers
13 views

restore multiple .trn logs in SQL 2008 R2 [duplicate]

I am using SQL server 2008 R2 and need to restore 36 .trn logs to a database. I have restored the first 4 using the restore transaction log functionality in SSMS (right click database > tasks > ...
3
votes
2answers
114 views

Export a table and zip with password

I would like, from TSQL, to use a view to extract data from a table, output it with BCP, then use non 3rd party tools to ZIP it with a password and AES encryption. Optionnally, I could use a 3rd party ...
2
votes
1answer
50 views

Identity column value falling behind randomly

We are having a strange intermittent issue where the identity column value falls behind the MAX(ID) for the table. Each customer gets their own table that stores statistics to the tune of ...
0
votes
0answers
13 views

Pulling Records from Linked Tables in MS Access, throwing Syntax error

I'm currently working with an MS Access database that I'm supposed to be modifying a bit. I've finished the work I was assigned to do but am now struggling with deploying it accross a multi-user ...
2
votes
2answers
66 views

Why would you put Identity Increment other than 1 in SQL? [closed]

In SQL Server, you can set the increment of an identity column other than 1. In what situation would you do that?
0
votes
1answer
21 views

Safe delete Transaction Log in SQL Mirroring scenario

We are using SQL Server Mirroring with a witness (High Safety mode) and we see the transaction log on the Principal Server has grown around 20 GB in few weeks. I looked around on SO and google for ...
13
votes
2answers
93 views

Index on a persisted computed column not seekable?

I have table, called Address, that has a persisted computed column called Hashkey. The column is deterministic but not precise. It has a unique index on it that is not seekable. If I run this query, ...
2
votes
2answers
89 views

How to get 5min date interval from stock data

i have a stock data of comapy as shown below id update time price 5 2015-07-17 09:02:00.000 65.5 5 2015-07-17 09:03:00.000 65.5 5 2015-07-17 09:05:00.000 65.5 5 ...
0
votes
2answers
71 views

How to make SQL Server 2008 compatible to SQL Server 2000

I have to run the backup of SQL Server 2000 in SQL Server 2008. While restoring the database from the .bak file, I got the error specified cast is invalid After doing google I feel there is ...
-1
votes
1answer
65 views

Group by creating problem in Ranking of player [closed]

CREATE Table dbo.[#TMP] (UId uniqueidentifier, Points int, DC datetime, CId int, Username nvarchar(50)) ...
3
votes
0answers
49 views

Could you please describe how SQL Server 2014 do cardinality estimation of Join predicate?

I found the information about CE of single filter predicate, multiple filter predicated but I have not found anything about JOIN predicate.
0
votes
1answer
38 views

SQL Server Client Tools: How can you tell what SQL edition the client tools are from?

While working on SQL Server: Unable to save import export package, but am on Standard Edition , the question came up: We know how to ask SQL Server what edition it is. (Look at properties of server ...
3
votes
2answers
62 views

For XML PATH error (SQL Server 2008 R2) [closed]

I have a big query (if necessary I will post it here) and I'm getting this error: Msg 6841, Level 16, State 1, Line 1 FOR XML could not serialize the data for node 'NoName' because it contains ...
1
vote
2answers
59 views

Restore SQL Server 2008 database onto SQL Server 2014?

I have a backup file that I need to restore daily on schedule based. But the backup file is from SQL Server 2008 and restore destination is SQL Server 2014. And also the backup file is from cross ...
4
votes
3answers
79 views

SQL Server job hanging and can't be stopped

I am using SQL Server 2008 R2 (10.5.2500.0) and we have a job that runs every weekend. It runs the ola.hallengren.com database maintenance tool to backup several databases, then FTPs the backups off ...
1
vote
0answers
42 views

Database fragmentation and heap SQL Server

We have critical performance issues with our production database (its around 300 gb size) We have run the following script for a few huge tables : DECLARE @db_id SMALLINT; DECLARE @object_id INT; ...
0
votes
0answers
30 views

What happens to the database structure when i add a nonclustered index

Our team is working for a while now with Azure SQL. After a lot of trying , we managed to add a sync group between the main DB and the backup one. Of course, this means that for every change in the ...
1
vote
2answers
59 views

How can I run a SQL job every 1 second? [duplicate]

I have an SQL Job which processes minimum amount of rows at a given time. Currently its running every 10 seconds which is the minimum available in Job Scheduler. But because of that the table used ...
1
vote
2answers
45 views

When to prefere a truncate over a batch-delete?

When I browse DBA-Reactions I understand nearly all the .gifs but with this one I have trouble: https://twitter.com/DBAReactions/status/613840893322338304 I mean truncate obviously doesn't create ...
1
vote
1answer
41 views

sql join query through Adventure works database [on hold]

I want to show a list of Product Colors. For each Color then show how many SalesDetails there are and the Total SalesAmount (UnitPrice * OrderQty). Only show Colors with a Total SalesAmount more than ...
0
votes
1answer
55 views

NC Index not being used [closed]

I have a table (9mm records) with a field called filename nvarchar(max)(I didn't decide on this datatype and can't change it). I'm wanting to count how many records meet the following criteria: ...
4
votes
1answer
41 views

SQL Server 2008 R2 : LDF file size not increasing

I am using SQL Server 2008 R2. I have a table statDB of 100 GB in primary filegroup. I have created a secondary filegroup in same database (Lab1) and created a table copyStatDB. Now I start copy ...
0
votes
1answer
33 views

Restore Database in SQL Server 2014 with different name

I am using SQL Server 2014. I have a database but as the user deleted some records, I need to create another database with a different name and then transfer the data from the restored database to ...
3
votes
2answers
70 views

Effective indexing and querying of overlapping date/time ranges

I have a table with the following schema: AccountId: int StartDateTime: datetime2(0) EndDateTime: datetime2(0) I want to be able to query this for rows with a certain AccountId, and whose date ...
4
votes
4answers
424 views

SQL Server - Alter table vs drop and create

Our database is SQL Server 2008 R2. We have some tables that have some varchar(500) columns that I want to switch to datetime2 or bigint. I can guarantee all the data in the columns to be switched are ...
0
votes
1answer
24 views

AWS RDS query running extremely slowly

I am testing out AWS RDS to replace a local DB and in general I am finding the latency etc acceptable for most of our use-cases. There is one particular query that we run manually (i.e. in SQL Server ...
-1
votes
2answers
49 views

Under what circumstance would setting MaxDop to anything other than 1 cause an issue? [closed]

we are having continued discussions with our vendor whom is insistent on setting MaxDop to 1 we have performed internal testing and see a general 20% performance improvement by setting this to 4 ...
0
votes
1answer
17 views

Slow fill database

The source sends in my program a large number of rows. When the number of rows such as two thousand per minute for one table, all is saved in the database properly. But if you send two thousand per ...