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)

0
votes
0answers
6 views

SQL database disaster recovery in a second datacenter using storage

I have the following: Data Center (1) has a set of two Microsoft SQL database servers. They are clustered using MSCS and shared NetApp storage FAS3250 system. This provides me with local ...
1
vote
1answer
35 views

How to solve SIDs mistmatching in SQL or orphaned users?

I moved and restored a database from a backup into another SQL Server 2008R2 about a year ago. I wasn't aware of the concept of orphaned users. From what I understood, is that we can end up having ...
0
votes
1answer
30 views

Invalid object when selecting from temporary table

I'm creating a temporary table called #PrevStatus. I've confirmed that the create statement is correct. When I run, exec (@TableQuery) which contains the table create statement and then right ...
1
vote
1answer
39 views

What should I monitor on the SQL Server machine? [on hold]

I need to create some alerts, logging jobs and monitors on a machine that is going to run SQL Server 2012 Standard for an ERP system. The OS will be Windows Server 2008 R2 Standard/Datacenter (if it ...
0
votes
1answer
29 views

Index file - size changed

I realised today that my index file(which is about 250GB) is smaller than yesterday for about 7GB. Everything, I done in the meantime, was index rebuild. Is it possible that index rebuild is the ...
0
votes
0answers
6 views

Disk space Report for CMS

I want to take the disk space report from centralized server with the help of CMS i have to run that query & i want the query for last errorlog report for all the servers in CMS, can i have the ...
4
votes
1answer
115 views

What is a non-clustered index scan

I know what table scan, clustered index scan and index seek is but my google skills let me down to find a precise explanation into non clustered index scans. Why and when a query uses a non clustered ...
1
vote
1answer
29 views

How to get statement which causes error 3609?

How to find out which statement causes error Msg 3609, Level 16, State 1, Line 4 The transaction ended in the trigger. The batch has been aborted.? The code seems very straight-forward: -- 1. Check ...
1
vote
1answer
21 views

Oracle OLEDB Connections hang in SQL Server: Can I restart Instance?

There is a killed/rolled back query on this instance that was originally attempting to execute a SELECT on a remote Oracle Server via OLEDB. This query was running for over two days before it finally ...
2
votes
0answers
35 views

SQL Server migration from 2005/2008 to 2012

We need to upgrade two SQL Servers for our projects to SQL Server 2012. Since we’re not db-admins or familiar with such migrations, I wanted to ask you if you could tell me what we have to be aware of ...
1
vote
2answers
111 views

SQL Server Performance

This is rather a generic question. I've always understood that SQL Server likes RAM, the more the better. If for example I had a SQL Server with just a single 2GB database and 8GB RAM, would there ...
1
vote
1answer
21 views

What happens on the primary when log cannot be restored on the secondary on Log Shipping

I would like to setup a log shipping but I have a concern as to what would happen if the restore operation on the secondary would fail for some reason. I want the primary database keep working no ...
0
votes
1answer
25 views

How to export an image column to files in SQL Server?

I will migrate from a database. There is one column of type image that I would like to export to binary files on the file system. One file for each record. How can I do this with SQL Server?
2
votes
1answer
29 views

How do you calculate the CPU Affinity Bitmap?

I am trying to calculate the bitmap for my 32-core server. I want my instance to use cores 30 and 31. I know that CPU 0 gets assigned a value of 1, CPU 1 gets assigned a value of 2, CPU 3 gets ...
0
votes
1answer
38 views

Why the operation is not rolled back?

I have the following code in a trigger (AFTER INSERT, UPDATE): BEGIN IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION; RAISERROR('Does not allow modifications in the past', 16, 1); RETURN; END; ...
0
votes
1answer
22 views

ODBC SQL Server driver on Linux/nginx

Writing here because really can't figure out what to do. I have a site located at ftp server. And now it moves to a new server based on Linux/nginx. And everything is fine except SQL Server ODBC ...
2
votes
0answers
21 views

Find the current task of a long time running indexes reorganize operation

In a scheduled maintenance window, I've manually rebuilt/reorganized some indexes of a SQL Server 2012 database. It was an offline task, since my SQL Server license does not allow online ...
0
votes
0answers
40 views

Delete and merge duplicate records from joined tables?

I am trying to delete duplicate records from the output of the query below. If they also meet certain conditions i.e., 'different address type', then I would merge the records. From the following ...
2
votes
1answer
66 views

Database is happily available even during log growth?

I’ve been creating a process to go through all our databases and analyze the log structure, backup, shrink, and resize appropriately taking operational requirements and VLF sizing/amount into account. ...
3
votes
2answers
48 views

Disabled SSL on SQL Server, now connection fails

I have a customer that is worried about the latest SSL vulnerability POODLE. They have a utility (IIS Crypto 1.4) that disables SSL 2.0-3.0 on the servers they run it on. They have disabled SSL on ...
2
votes
2answers
126 views

How to detect DBCC ShrinkDatabase completion percentage?

Recently we have archived some of data from one of very large production database and need to shrink all data files to reacquire disk space. Problem is that its taking too much time and we are ...
0
votes
1answer
16 views

Can't map invalid columns based on column names in a .dtsx-Package

I have the following problem. I currently have to modify a .dtsx-Package which was originally created by a coworker who is not arounf anymore. This package contains some logic but above all it does ...
0
votes
2answers
59 views

Can I stop a SQL database backup after it has already started?

I am looking to do a full database backup of a SQL database in SQL Server 2008. My questions are: *Can I stop, pause, or cancel the backup after it has started if it is taking too long or slowing ...
1
vote
2answers
56 views

Does a database backup reduce size/increase free space of the log file?

Novice question, sorry! Got a SQL Server database and the log file is massive and keeps growing every day. I've archived data from the database and then done a full backup. I was expecting the log ...
0
votes
1answer
24 views

How do I select all child table records based on condition [on hold]

I have two tables - demographics and PatSubs. Both tables are linked by CaseNumber filed. PatSubs may have one or many substance entry for the CaseNumber. If I do the following: USE [njpies2013] GO ...
0
votes
1answer
44 views

what is running VSS on my server

Client's SQL Server farm DBs are backed up by third-party tool that does not use VSS. About half of the instances show backups being made by some tool that is using VSS. I can disable SQL Server VSS ...
0
votes
0answers
26 views

db connection uses an anonymous logon instead of the domain user

I have this PHP code running under IIS: $serverName = "someServer\someServer"; $connectionInfo = array( "Database"=>"SOME_DB"); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn ) ...
0
votes
1answer
45 views

Doing a insert across two databases with same collations and getting an error

SQL query : insert DB1.dbo.tbl1 select distinct Number, Name, 'Unknown', 'Unknown', 'Unknown', NULL, 'No', 'GL', 'N/A' from DB2.dbo.tbl1 T2 where T1.Number not in (select distinct AccountNumber ...
0
votes
1answer
54 views

What happens in this strange SQL Server Mirroring situation?

Let's assume that two SQL Server instances (S1 and S2) are in synchronous mirroring or in a synchronous Availability Group. Now the following happens: A write happens on S1 and transaction commit is ...
1
vote
1answer
22 views

Can I build relationships in existing system without breaking it?

This is my first question here, so I would love help to make it work for SO:DBA. I inherited an older relational system that is sitting on a SQL Server 2005 box and the database is at SQL2000 ...
2
votes
1answer
28 views

Error during SQL Server 2008 R2 SP3 upgrade: MODIFY FILE failed. File 'MSDBLog' does not exist

I have just installed SQL Server 2008 R2 SP3 and after installing it and trying to start the SQL Server instance again, it won't come online. In the SQL Server error log I can see that the following ...
2
votes
2answers
94 views

How can I use expressions as arguments to EXEC?

I am building some scripts and found an annoyance to be that I can't provide expressions as arguments to EXEC. Here is an example I have run into. I want to setup various items using a consistent ...
0
votes
1answer
74 views

Stored procedure takes 18 seconds on first load, 0 seconds on subsequent loads, waiting several minutes makes it slow again

I have a stored procedure that returns a lot of data for a business dashboard. On first load it takes 18 seconds, after that it takes 0 seconds, even if I change the input parameters at random it ...
0
votes
2answers
37 views

SQL Server database performance is very poor after a month of use

I am quite new to SQL server and have a question regarding database speed. The database (about 50 MB big) was very fast in the beginning. Now, a month later, the speed is a lot worse. I run a script ...
2
votes
2answers
128 views

How to get OUTPUT $action, Inserted.*,Deleted.* records in In SSIS

I was just wondering, in MERGE in T-SQL, you can output the OUTPUT $action, Inserted.* and Deleted.* records. I want to ask how can I get OUTPUT $action, Inserted.*, Deleted.* records in SSIS?
0
votes
1answer
50 views

SQL SERVER – Find Most Expensive Queries

I am running the following script to find most expensive queries. However I want to narrow it down to only queries ran on Saturday 18th October 2014 Is there any way to do this? SELECT TOP 50 ...
0
votes
5answers
72 views

Database with only text fields

I started working on an existing SQL Server Database System in which most of the fields are stored as text. Except some IDs all fields are varchar (phone numbers, zip codes, Dates, addresses, monetary ...
0
votes
0answers
60 views

SQL-Server 2012: Same query takes different Query Plans - but why?

Recently we had an issue with a query, which reached a timeout when executed the call through our web application. Using a monitoring tool I found the "bad query" and took it. I run it directly on the ...
0
votes
1answer
72 views

How many LEFT JOINS make a VIEW unusable?

I have a view which involves LEFT JOINS on 20+ tables to a base table but when querying this view and looking at the execution plans I am getting something totally unexpected. For example, with the ...
0
votes
0answers
26 views

SQL database rejoined to new SQL Server 2008 R2. Users are still unable to connect

The below error appears when our users attempt to connect to our database following a complete rebuild of our SQL server and restore of the MDL file: We have created user accounts on the new SQL ...
0
votes
0answers
21 views

SQL Server Replication (Login failed for user 'NT Service\SQLAgent$SQL2014')

I'm trying to setup a replication on my local computer. I setup the distributor, the publisher and the subscriber. When I launch replication monitor on the publisher instance it returns the ...
0
votes
2answers
39 views

Is it possible to convert existing users from SQL Server authentication to Windows (AD) authentication? (SQL Server 2008 R2)

We have just undergone a bare-metal restore of an SBS 2003 server running our SQL database and are in the final stages of configuration before going live again. Previously, we had 20 users accessing ...
-5
votes
0answers
42 views

Roomwise track of beds sql server table design [on hold]

Well I am bit confused. I am a new student of SQL database. Today, I conceived of a system to track accommodation status in my hostel. I do not know how to plan the database field and constraints - ...
5
votes
2answers
187 views

Strange query results for DELETE with ROW_NUMBER

In the following DELETE statement I try to delete all rows except the first one ordered by some criteria. (The actual query makes more sense, this is just a repro. All the sys.objects stuff is just ...
2
votes
3answers
49 views

Additional space required for INDEX REORGANIZE

MSDN states: ALTER INDEX REORGANIZE; however, log space is required. The database recovery mode is Simple, does that implies the log space is actually NOT required ?.
0
votes
1answer
42 views

How to set a restart on a TSQL Job?

I currently have an important TSQL job that hangs probably once a week. It moves data from one database to another. It is on a schedule running every 5 minutes indefinitely throughout the day. ...
11
votes
5answers
1k views

Why does a UNIQUE constraint allow only one NULL?

Technically, NULL = NULL is False, by that logic no NULL is equal to any NULL and all NULLs are distinct. Shouldnt this imply that all NULLs are unique and a unique index should allow any number of ...
1
vote
1answer
115 views
+50

Issues with module signing and SSIS catalog internal procedures

I'm trying to set up a stored procedure to execute an SSIS package. I want to allow a user to execute only this stored procedure, so I need it to run as a different user. I found this article which ...
1
vote
1answer
64 views

How does SQL Server handle logins when the user is a part of multiple groups with various privileges?

I'm trying to wrap my head around how SQL Server decides to grant certain rights based on a users login privileges. If a user is part of a group "READ ONLY" which has access to DB1, but they are also ...
0
votes
1answer
86 views

Applying normalization to a relational Database (Access & SQL Server)

This question is pretty specific but I hope it can get answered on here. There is a wide range of information about normalization but I feel what I have read so far isn't as effective as just stating ...