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
1answer
49 views

If a query contains two identical subqueries, will they both run?

Say I have a SELECT query that contains two identical subqueries, like the below: SELECT (SELECT SUM(Price) FROM Product p WHERE p.GroupID = g.GroupID) AS 'TotalCost', (SELECT SUM(Price) ...
0
votes
2answers
39 views

update/delete records concurrently without impact to other process for handling huge data?

I tried to googling first, but i didn't get it . . . So, What are best practices for update/delete records concurrently without impact to other process handle to huge data(>5 millions records)? ...
0
votes
1answer
72 views

Query for row combine

BEGIN declare @t1 table( date1 date, EmpID int, bnumber varchar(24), Name varchar(50), Depname varchar(50), mintime time, maxtime time, Status1 varchar(50)) insert into @t1 exec dbo.InOut2 ...
10
votes
1answer
205 views

Sch-M WAIT blocks Sch-S in SQL Server 2014 but not SQL Server 2008 R2?

We recently migrated our production instances from SQL 2008 R2 to brand new SQL 2014 servers. Here is an interesting scenario that we uncovered with our usage of Service Broker. Consider a database ...
1
vote
1answer
99 views

Check constraint references another column in same table

I have this table but check constraint is throwing me an error: Column CHECK constraint for column 'MedicamentRegulated' references another column, table 'Medicaments'. I've seen this as allowed ...
4
votes
3answers
773 views

Can I install SQL Server Management Studio locally?

Can I install SQL Server Management Studio on my desktop to access a database on a SQL Server 2012 instance? If so, where can I find the installer? Google searches only return 'express' versions ...
3
votes
2answers
105 views

Determining the Actual Server Create Date

I am interested in determining the ages of all 70+ my servers. I would like to create a growth graph showing when servers and databases were added to the environment either/both monthly or annually. I ...
1
vote
0answers
30 views

How to specify a display name in emails from SSRS subscriptions?

How can I specify a display name (e.g. "Reporting Server" <noreply@domain.com>) in the emails sent from SSRS subscriptions?
0
votes
0answers
26 views

Maintenance Plan Transaction Log Backup

I have a backup device set for my transaction log so the sets are contained in 1 file. I have this set to append, is this correct or should it be overwrite in the plan? After the full backup is taken ...
2
votes
1answer
49 views

How to get a sense of how busy is the server [duplicate]

I am not in IT infrastructure team. But I have a SQL database server. We are having this intermittent problem with Dynamics SL and everyone in the company sort of pointing the finger that the server ...
1
vote
1answer
41 views

Insert fail logs

Is there a way to view fail inserts to a SQL Server database? I am seeing that a number of my inserts are failing and I'd like to recover that data if it's possible.
0
votes
0answers
26 views

Migrate Linked Server Connections

I am getting ready to migrate a DB from one server to a new machine...but were wondering if there is an easy way to migrate those connections over as well...we have about 6-7 linked servers set up to ...
0
votes
0answers
24 views

SQL Server Configuration.ini File. SSIS Data Required?

I am planning a new SQL Server installation based of the settings from a previous installation on another server. I am using the Configuration.ini file. Since SSIS is not required can I exclude the ...
0
votes
1answer
40 views

Relationship between two tables so their value changes together

First of all I'm not sure if this website is for purely experts but sorry if it is.. the main page was a little vague I was wondering if it'd be possible to have a relationship, for example, in my ...
0
votes
1answer
48 views

Script not emailing from Maintenance Plan/SSIS

I have created the following script to send emails from my plan but it isn't sending out. It works correctly in a query window and under an agent job. This is added to the plan as a 'Execute T-SQL ...
1
vote
1answer
27 views

Backup Certificate SQL Server and return bytes with a Select Statement

I have a certificate in a database in Microsoft SQL Server 2008 R2. I want to get a copy of the certificate so I can burn it onto a USB device and put it in a safe. I don't want to have to go onto the ...
1
vote
1answer
52 views

How to get service broker database queue status?

I need to get service broker queue status (Enabled/Disabled) somehow programmatically. Either, T-SQL, PowerShell, etc. I tried $MyQueue = Get-ChildItem ...
2
votes
1answer
116 views

Alerts from Maintenance Plans

I would like to setup alerts from within the maintenance plans. When you setup a notification from the Agent Job it sends out the Job name, duration, status, message. If I add a Notify Operator Task ...
0
votes
2answers
72 views

How to remove stuck mode in SQL Server?

I was clearing tables by using query in SQL Server. A query that normally takes 2 minutes took the better part of 3 hours... and it wasn’t even close to being complete. Therefore, I killed SQL Server ...
2
votes
2answers
156 views

Is Information in sys.dm_db_index_usage_stats reliable

I'm archiving data from an old system that has no documentation. Lucky me... I'd like to find out when the tables were created, last accessed etc. Can I trust that this query will give me the correct ...
1
vote
5answers
205 views

What is the advantage of partition Date field into individual Year(int), Month(int), Day(int), Time(time) columns? [closed]

What is the advantage of partition Date field into individual Year(int), Month(int), Day(int), Time(time) columns? My manager said this is well known practice and query performance is good. Is this ...
0
votes
0answers
42 views

How does rsconfig know which config file to update?

We are in the process of migrating some work from Microsoft SQL Server 2000 to SQL Server 2012. As part of that process, we've been using rsconfig.exe to reconfigure some reporting services instances ...
2
votes
2answers
417 views

Is there any way to do a SELECT query without any optimization in SQL Server?

I am trying to test the speed of SQL server queries. However, once I do the query once, it becomes a lot faster. The database is live so I can not make any changes to it, only to the SELECT query ...
1
vote
0answers
25 views

How to cope with SQL Server 2012 vs SQL (Azure) Database sql files

I'm trying to port my system to SQL Database (Azure instance) from SQL Server 2012. I'm using Visual Studio 2013 and I have my .sqlproj with all the definition of my database inside. Given that a ...
0
votes
1answer
70 views

UOW's: Relating UOW's listed in MSDTC to SQL Server info

We have some active transactions showing up in MSDTC that have been there for a very long time and don't go away. They're not orphaned or in-doubt, just normal-looking active transactions. We're ...
3
votes
2answers
223 views

Can I update every datetime in bulk?

The current database assumes all times are local to the user. Now we're changing this so the database stores everything in UTC and our application converts the UTC time in the database to the correct ...
0
votes
1answer
129 views

Import errors importing CSV to SQL Server table

I am using SQL Server 2014 Management Studio to import a very large .CSV file into a table. So far I have been trying to accomplish this by right-clicking on the database and selecting Import Data, ...
1
vote
1answer
90 views

How can I correct SQL Server Error 8928?

I received the following error message in an application running against one of my databases: SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0xfdff74c9; ...
3
votes
4answers
613 views

Insert into select into multiple related tables using INSERT_IDENTITY

Okay setting the scene. I have three tables, (Table1, Table2 and DataTable) and I want to insert into Table1 and Table2 using DataTable as source. So for every row in DataTable I want a row in Table1 ...
0
votes
1answer
99 views

How to generate replication snapshot without locking tables

When I reinitialize subscription and generate new snapshot it locks all tables and makes the database unusable for a very long time (never waited it out). Is there anyway to do this without locking?
1
vote
0answers
49 views

Slow compilation of a SQL statement

I have SQL Server 2014 and a large table (more than 200Gb) with 100M rows and more than 300 columns. For one "unpivot" query I wanted to see its estimated execution plan and it took more than 90 ...
2
votes
2answers
99 views

Where to place tempdb and logfiles

I have fallowing configuration for my SQL 2014 server: SSD RAID 1 - for data files SSD RAID 1 - for tempdb? logfiles? HDD (SAS 15K) RAID 1 - for tempdb? logfiles? I noticed that sql uses tempdb ...
2
votes
1answer
85 views

If an INNER JOIN in a query returns no rows, do additional INNER JOINS add a significant performance overhead?

If I make a query as follows: SELECT * FROM TableA A INNER JOIN TableB B ON A.AID = B.AID INNER JOIN TableC C ON B.BID = C.BID Does the INNER JOIN with TableC add significantly to the performance ...
1
vote
2answers
77 views

What happens when Core Cluster Group is failed over to another node? Will it take the whole cluster down? Single point of failure?

"Cluster group" fail-over will cause cluster go offline. Really? Single point of failure? Am I missing something? What happens when Core Cluster resources (Cluster Group) are failed over from one node ...
0
votes
2answers
75 views

How secure is a linked server in SQL Server

I am in a situation in which I should doubt everyone (even my developer team and database admin) so I want to Log all the logons made to my server. I have two SQL Servers, say A and B. I want to log ...
0
votes
1answer
280 views

Script that alters all stored procedure on the database

I have a database with thousands of stored procedures and I need to alter hundreds of them. In order to do it faster I thought of a way to write a script that runs over all stored procedures and adds ...
0
votes
2answers
58 views

Order by for 2 row result causes 800% performance hit

The following query, run against a table of about 6 mil rows takes 25 seconds. When I remove the final order by, it runs in 3 seconds. There are no indexes on the table (it's an intermediate SSIS ETL ...
2
votes
0answers
77 views

Why does Recursive CTE estimate just 1 row?

Given two cascading, self-contained (no real tables) recursive CTE's: create view NumberSequence_0_100_View as with NumberSequence as ( select 0 as Number union all select Number + 1 ...
1
vote
2answers
81 views

“WITH REPLACE” Restore failing with same logical filenames

Does using WITH REPLACE when the logical filenames match (to avoid using WITH MOVE) fail when the backup is from a different version of SQL? I have a backup from SQL 2008 but when I attempted to ...
0
votes
1answer
135 views

How to reduce the run time of stored procedure by getting rid of cursors?

I have a task of reducing the run time of a stored procedure that runs for hours. Description of task: The cursor takes a set of values @Master and @Slave obtained from a query(5000+ rows), finds ...
0
votes
2answers
85 views

How to deal with very large transaction logs in SQL Server

Here is my situation: I have being asked to deal with a SQL Server 2008 R2 database that has a transaction log that is several times bigger than the database itself. The database is in full recovery ...
2
votes
2answers
132 views

Should I check for existence of temp tables in Stored Procedures?

Is there any edge case in which it would be recommended to explicitly check for ,drop and create temp tables at the start of a Stored Procedure instead of just creating them? Similarly, is there a ...
0
votes
0answers
62 views

Subscription fails with Incorrect syntax near '9'

In my Distributor To Subscriber History I get the following error: Command attempted: 9 (Transaction sequence number: 0x0018E94F0000207A006200000000, Command ID: 59) Error messages: ...
0
votes
1answer
68 views

SQL Server 2000 Backup fails with Status = 33

I am trying to take a Full Backup of a database size about 75GB. It is SQL Server 2000 - 8.00.2055 x86 version. I have plenty of disk space where the backup is being created. So disk space isn't an ...
5
votes
1answer
78 views

Full Text Search Term Casing Affects Results

I have been experiencing a full text problem when searching using CONTAINS. I have the full text catalog accent sensitive setting set to false. The table contains following rows: Microsoft C# ...
-3
votes
3answers
83 views

SQL cache hit ratio [closed]

I have install SQL server, but when i check report of DB there is cache hit ratio which is 98.92%. Is it harmful for sql, if yes then how to reduce it.....? please give me solution for that. thanks, ...
3
votes
1answer
76 views

Microsoft SQL Server Connection Coloring

I've been using the Redgate Query Tab Coloring feature (under SQL Prompt's Experimental Features) and I really like it. Somehow I've never known until today that this feature is built in to SSMS for ...
0
votes
1answer
42 views

How to find when change tracking was enabled?

How can I determine when change tracking was enabled on a table in a SQL database? Assume that this table has a regular cleanup routine, which means that looking at the oldest record in the change ...
3
votes
2answers
78 views

Designating databases to certain CPUs

SQL Server 2012. AlwaysOn Cluster with two nodes, each has 4 cores We are consolidating SQL server instances and moving bunch of databases from various locations to a single cluster which has two ...
0
votes
1answer
46 views

Script to Add a Job to a SQL Server DB

I want to add a job to my DB to make a back up weekly but i want to do it from an script, i've serched and with what i found i made this: CREATE SCHEMA job go CREATE PROC BACKUPS @dir varchar(max) AS ...