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)

1
vote
0answers
32 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
40 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
71 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
29 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
87 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
23 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
48 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
115 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
67 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
96 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
90 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
72 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
67 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
40 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
68 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
61 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
81 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
44 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
36 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
60 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
34 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
71 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
434 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 ...
2
votes
3answers
138 views

SQL Server Slowdown?

We're a small shop, and I'm certainly not a DBA by any stretch of the imagination, but I've recently inherited a somewhat large older database (been running since at least 04), that in the past month ...
0
votes
2answers
39 views

Display Total under name column and sum of amount under sal column [closed]

in a table empno,ename,sal,hiredate is there. but i want output is empno ename sal hiredate 122 ganga 2000 1989-02-06 123 reddy 3000 1986-06-02 Total 5000 here empno, hiredate column ...
1
vote
1answer
28 views

Reclaim unused space

I have a DB 150 GB , contains 138 tables one of the tables is 120 GB. I need to archive around 80 GB from this table. Is there a way to reclaim this space without using DB shrink? thanks
1
vote
1answer
62 views

Is it Possible that a variable name changes in a stored procedure after a restore?

I often restore my Testing database from Production db, but this time I noticed something odd: we have a stored procedure called (USP_AddTS), one of its variable names have slightly a different name ...
4
votes
0answers
43 views

SQL Server: Unable to save import export package, but am on Standard Edition

I am confused. Issue: SSIS ("SQL Server Import Export Wizard") should let me build a data import package and save it to a file, for easy re-running (converting to a task, etc.). I want to save a ...
1
vote
1answer
26 views

What is the relationship between the SSIS Package Store and Catalog?

I have a server with a working installation of the Sql Server 2012 SSIS Catalog. I need to set up an additional instance including the SSIS Package Store service as an interim step while the packages ...
1
vote
1answer
33 views

Most efficient table storage for determining recurrence

What is the most optimal table structure to store schedules / recurrence definitions so that we can efficiently query it for all events that will occur within a date range (min:1 max:32 days)? My ...
1
vote
0answers
41 views

SQL Server tool for merging rows [closed]

We have a SQL Sever 2008 database that occasionally receives bad data from customers. The issue we are trying to address here is that sometimes duplicate records are created where one row has some of ...
2
votes
1answer
55 views

Process Data cube from job on SQL server

I have an SQL Server Agent job on server(X) that has a step that is supposed to process a data cube on a remote server(Y). Whenever I run the job it fails and says that server(X) does not have ...
3
votes
1answer
39 views

Determine Gap Records, Fill and Return Result

The following working code targets SQL-Server 2012 and I have distilled the actual problem into a manageable scenario with the code example shown below also presented on SQL Fiddle. I seek feedback ...
0
votes
0answers
40 views

Refactoring 80 GB table that stores massive amount of calculated results

Trying to evaluate architectural changes to improve the performance of an app that calculates a lot of individual values and stores each of these results as a row. The storage size for one of the ...
2
votes
1answer
37 views

Best way to back up data bases on a SQL Server Availability Group DR Site node

I have an Availability Group (Primary only is readable) with 2 nodes locally and 1 node at a DR site. Both sites have a backup system. Locally, I’m using the local backup system to back up the AG ...