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

Finding duplicate data

I have noticed dup’s generated in my mail system. some service was causing duplicate calls to my insert proc and generated multiple duplicate messages with about a 4 mili-second difference in a date ...
4
votes
0answers
638 views

SQL Server Deadlock - Two SELECT Exclusive Locks on Exact Same Index and Key [closed]

How is the deadlock graph below possible? How did two SELECT statements simultaneously acquire an exclusive lock on the exact same resource? The exclusive locks were on the primary key index for ...
1
vote
1answer
118 views

Does reporting webservice url contain the function that helps to export the report to the client version?

The reporting webservice url contains the webservice url that contains all the information of the Reports which are created in SSRS. As the report has been created on reporting service, i want to ...
1
vote
3answers
433 views

Selecting from a view shows the wrong set of columns

I'm selecting from a view in SQL Server. If I right-click on it and choose "Select Top n Rows", it runs and shows me 30 columns. If I open the view in ALTER mode (right-click, Script View As, ...
3
votes
1answer
94 views

Version lie shim for SQL Server 2014 [closed]

SQL Server 2014 is sufficiently new that not a lot of the 3rd party tooling has caught up with it yet. I'm looking at Red Gate and TOAD in particular... Is there any way of putting a version lie ...
2
votes
2answers
247 views

Canceling SQL Server Support [closed]

I need your advice. Our company is about to cancel the SQL Server support. I have this instinct feeling this is a very bad idea. No more SQL Server updates, I know, but even when that is reason ...
2
votes
2answers
638 views

How do I map a SQL Server login to a user that already exists in a read-only database?

One of our database users complains that they can't select from one of the databases in this particualr instance while they have no problems in accessing others in this very same instance. The one ...
-2
votes
1answer
189 views

Non- Logged operation [closed]

I want to run a non-logged operation with changing the recovery model of a SQL Server database. Is their any way to do this?
0
votes
1answer
58 views

Sequence and table with the same name?

Can we have a sequence and table with the same name? I am trying to create a sequence with the same name as an existing table, but I get this error: There is already an object named 'XYZ' in the ...
0
votes
0answers
94 views

Is there better way to design SQL tables

I need to design a quick application for small warehouse. I just want to check if there is a better design approach. I am using polymorphic associations for comments tables. Business Rules If ...
9
votes
2answers
30k views

Connect to SQL Server with Windows Authentication in a different domain

I am trying to connect to a remote SQL Server on a VPN in a different domain. When I enter the Server name on the SQL Server and choose Additional Connection Parameters to add some extra stuff needed ...
1
vote
0answers
375 views

How to get usage based optimization working on SSAS?

I have set up the configuration for SSAS to log the usage into the database, since the table did not exist I let it do that. However SSAS created the table OlapQueryLog under the schema of the SSAS ...
1
vote
1answer
166 views

Include fields from a table function in a select

I'm running this query on SQL Server 2008 R2: SELECT orr.Rate, orr.ID, orr.UserKey, fn.NetRate FROM OngoingRate orr CROSS APPLY dbo.GetRateNetView(orr.UserKey) as fn WHERE ...
-4
votes
2answers
994 views

How can insert Data one Linked Server to Other Linked Server.

declare @sql nvarchar(max) set @sql='DECLARE @SourcePKTable TABLE (rowno int identity(1,1),myOldPK INT) IF EXISTS(SELECT Company_ID FROM [LServer2].[CMS].[dbo].[tbl_MasterCompany] WHERE Is_Sync IS ...
1
vote
3answers
848 views

Building A SQL table horizontally VS vertically

What is a better design principle when designing SQL Server tables. One can either add columns (ie grow horizontally) or grow it vertically (ie rather adding rows) I have a situation when there are ...
3
votes
2answers
821 views

Datetime column vs Date + Time columns

I am designing a table for a system that saves a number of logs. We are looking at ~200 entries per second. We are using SQL-Server 2012 Enterprise Edition. I have a question regarding breaking up a ...
1
vote
0answers
2k views

Possible schema corruption. Run DBCC CHECKCATALOG

Good Evening to all. I was working with sql server 2008. Thing i did: Actually i was noticed that the free space available in C drive reaches below 1 GB .So i thought to Club the D drive with C ...
3
votes
1answer
571 views

SQL Server “TOP 101” much slower than “TOP 100”

SQL Server shows huge decrease in performance when query is written like: select top 101 name from Dogs order by name compared to select top 100. As far as I know, this happens for the reason that ...
2
votes
0answers
155 views

SQL Server Database Mail Log is flooded with errors (20-30 per second) when mail server goes down

We're using SQL Server 2005. Every so often our mail server goes down, and when this happens, as soon as our SQL code tries to send dbmail, the Database Mail Log has an item which looks like this: ...
0
votes
1answer
497 views

tsql to find out memory, cpu and IP utilization by a databases over a week - MS SQL Server 2005 and above [closed]

I want to identify resource (CPU, memory and IO) usage by a database on a SQL 2005 and above server, over a week or a month. Can anyone please help in this? Thanks in advance
3
votes
2answers
12k views

deleting large volumes of rows from table efficiently in SQL Server [duplicate]

I have a table that has gotten a little out of control. I am not a DBA per se but seem to recall that deleting a huge volume of rows in one shot can cause transaction log issues, hamper overall system ...
1
vote
1answer
89 views

SSMS Intellisense - Data Dictionary Incorporation - Show Object Descriptions in Popup? [closed]

Can anyone point me in the right direction for an SSMS intellisense replacement that will show the object descriptions in the popup? This will help speed up onboarding as well as making myself ...
1
vote
1answer
1k views

SQL Server 2012 performance degradation

We are running SQL Server 2012 SP1 on Windows Server 2012. The issue we have is that after some time the server automatically reboots. Checking the logs did not show any errors. When looking into ...
2
votes
1answer
11k views

QUERY - pivot multiple columns, variable number of rows

I have a table that looks like this: RECIPE VERSION_ID INGREDIENT PERCENTAGE 4000 100 Ing_1 23,0 4000 100 Ing_100 0,1 4000 200 ...
0
votes
3answers
73 views

Lost my SQL Server 2005 host, SQL Server 2005 database import into SQL Server 2012?

My SQL Server 2005 host died, but the database related LUNS were on a SAN and still exist. Is there a way to use my SQL Server 2012 host to recover that database or import it in some way?
1
vote
1answer
558 views

Sort Warnings, finding out the query behind them

I'm troubleshooting a SQL Server 2012 that has started timing out as of a few weeks ago. The server is filled with thousands of sort warnings, at a rate of about 15 warnings per minute. To get the ...
1
vote
3answers
5k views

How to create new table with same constraints and indexes?

I am Creating a new table with Primary Key Constraints and a Non Clustered Index in that table. I know, I would like to create another table with same structure and values as well keys and indexes ...
1
vote
2answers
117 views

Imported database file size different with original database file

I am using SQL Server 2000 Data Transfer Service (DTS) wizard for import database from another existing SQL Server 2000 database. I also choose "Copy objects and data between SQL Server databases" ...
0
votes
2answers
632 views

Remove a period if it is the first character in a varchar column

I am migrating data from an old system into a new system I am building and have found someone is doing a bad practice of adding a period to the start of some people's names to make them appear first ...
1
vote
0answers
772 views

Backup Restore Procedure error SQL Server 2008 R2

We use a stored procedure to do a backup and restore of databases as a copy function. This allows our front end users to spin up sites from pre created template databases. Lately we've been getting ...
3
votes
1answer
984 views

Availability mode - manual failover mode, best practice for availability mode?

We don't want automatic failover for our availability group, but I have set availability mode to Synchronous, was that a mistake? The availability group runs on vmware with windows 2012R2, and I got ...
4
votes
1answer
196 views

Is there a performance consideration if stored procedures are in a separate database than the source data?

This applies to a SQL Server 2012 instance. We are considering structuring things to where we have a database that contains our source data, and then separate database (on the same instance) that ...
1
vote
1answer
137 views

How to remove Parameters and Filters in a T-SQL?

I created a sql trace and my task is build a report listing the 10's most used commmands. My problem is: I have the same procedure 100 times but my problem is it is using different filter and ...
2
votes
1answer
357 views

High Number of Connections

The below query tells me there is a total of 520 connections to our SQL Server database. Status of all is 'sleeping' except for 4 connections. The login_time goes back to 2 days ago on some ...
8
votes
7answers
2k views

How can I minimize the risk of accidentally modifying the wrong database?

I just learned the hard way that disconnecting from a server in the Object Explorer doesn't stop you afterwards from executing query windows that were already open on that server. My situation is ...
2
votes
2answers
6k views

Trigger to audit table changes

I have created a trigger to audit changes to a table: CREATE TRIGGER [dbo].[iudt_AutoAuditChanges] ON dbo.CPTCategoryMaster AFTER INSERT,DELETE,UPDATE AS BEGIN SET NOCOUNT ON; ...
2
votes
2answers
2k views

Upgraded from SQL Server 2008 R2 Express to SQL Server 2014

I've upgraded my SQL Server from the 2008 R2 Express edition to a full standard version of SQL Server 2014. Now I'm running them both side by side. But my problem is how can I abandon the 2008 version ...
1
vote
0answers
86 views

Why is this query stuck if there are no waits?

I am working with a vendor's activity logging system. One of the tables has 70+ million records and is constantly increasing at several hundred records per minute. They have a utility to delete old ...
3
votes
1answer
337 views

What happens when you create the primary key of a table on a different filegroup?

Creating a table on a different filegroup is absolutely no problem when using Sql Server. create table common.test ( id int, CONSTRAINT [pk_test] PRIMARY KEY CLUSTERED (id ASC) ON ...
0
votes
0answers
24 views

Trying to find unused stored procedures, but dm_exec_procedure_stats seems to be resetting [duplicate]

I need to identify stored procedures that are no longer used by our application (~2,000 sprocs, duplicated in ~1,000 databases). To do this, I'm querying dm_exec_procedure_stats, which initially ...
1
vote
2answers
661 views

Replication Blocks Code Deployment

We have a database (SQL Server 2008r2) that is being transactionally replicated, namely tables, sprocs, views, indexed views and UDFs only, to another server (SQL Server 2014) as part of a cautious ...
2
votes
1answer
224 views

AlwaysOn AG and Cross-Database/Server Transactions

We're about to move from SQL Server 2008 R2 Standard to SQL Server 2012 Enterprise and are reviewing or HA as part of process. Right now we use DPM and log shipping every 15 mins. Our MS partner is ...
2
votes
1answer
449 views

Scaling out SQL Server and syncing data across multiple machines

I don't have expertise in architecting databases, and I've been teaching myself new stuff every day. I'd like to make an Internet-scale application using SQL Server as the data store. I haven't found ...
5
votes
0answers
223 views

SQL Server 2014 In-Memory tables [closed]

For the past couple of weeks I sort of tested the new In-Memory thing in SQL Server 2014 (never worked with SQL Server 2012, jumped from 2008R2 straight to 2014, so if this new feature is present in ...
1
vote
0answers
106 views

Transactions using Isolation Level on databases with FileStream

We have a highly transactional application. We have a requirment to upload huge data into our database that can happen for a duration of 5-10 minutes. During our upload time, the tables are getting ...
26
votes
1answer
900 views

Why is the speed of executing statements dependent on the network connection?

It looks like the speed of executing T-SQL is dependent on the latency of the network connection against the server. I assumed that if SQL Server has nothing to report back to the client about, it ...
4
votes
1answer
1k views

How to restore symmetric key on the new database?

I have an issue with symmetric key restoring on the another database. I have table in the first(old) database with encrypted column.(The table contains encrypted data) The key in the old database has ...
1
vote
2answers
4k views

Best way to Design Key,value pairs in relational database?

I have a table which has a list of all attributes that any object can have: attr_id attr_name attr_data_type ------ ----- -------------- I have a table [object_key] in which each ...
3
votes
1answer
429 views

Updating a compatibility mode 80 database for SQL Server 2014

We have a SQL 2008 R2 server with a database on it that is running in compatibility mode 80. We are interested in upgrading 2008 R2 to 2014, but the upgrade adviser doesn't work because we can't force ...
4
votes
1answer
246 views

Why isn't my new index/table being created on the filegroup I specify?

Results from @@Version Microsoft SQL Server 2008 (SP3) - 10.0.5500.0 (X64) Sep 21 2011 22:45:45 Copyright (c) 1988-2008 Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.1 ...