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)

5
votes
0answers
37 views

Sql Server Services Empty in sql server configuration

As I upgraded from Windows 8.1 to Windows 10, I noticed that the SQL Server Services in SQL Server Configuration Manager is empty. SQL Server still works perfectly well at the moment. SQL Server 2014 ...
0
votes
0answers
10 views

Why does PK constraint require a separate index when I already have a suitable unique clustered index?

This is part of table definition from here: CREATE TABLE [dbo].[JobItems] ( [ItemId] UNIQUEIDENTIFIER NOT NULL, -- lots of other columns CONSTRAINT [PrimaryKey_GUID_HERE] PRIMARY KEY ...
2
votes
2answers
30 views

Compound Primary Key - Index both fields?

I have a many-to-many join table between users and roles. CREATE TABLE AppUserRole ( UserId INT NOT NULL, RoleId INT NOT NULL, CONSTRAINT PK_AppUserRole PRIMARY KEY (UserId, RoleId), ...
2
votes
4answers
1k views

How to find out what caused a schema change?

I am investigating some performance issues on my SQL Server 2008 R2 server. Some queries are being recompiled due to a "schema change". I am pretty sure no one is changing the schema. All databases on ...
0
votes
0answers
20 views

The target principal name is incorrect. Cannot generate SSPI context - SQL Server 2012 error

I don't understand why this error is popped up suddenly. It was working till yesterday. It is a stand alone env. Problem is when me or any user wants to connect from their machine locally it is ...
0
votes
1answer
17 views

How can I call a remote User Defined Function?

I have SQL server which contains a link to another server(For e.g: test) I have a function in linked server(name:getvalue(@parameter)).so this function output i want to retrieve in SQL server 2012.I ...
3
votes
3answers
3k views

How to import a varbinary(max) column with bulk import?

I have a varbinary(max) column that I need to bulk import. The data I'm putting into this column is a byte[] in C#. How do I format the data in the comma-delimited file used for bulk import? In ...
1
vote
1answer
17 views

Access to Server and Real Data for Performance Tuning [on hold]

I'm newbie in performance tuning (PT) in SQL server and I have read some documents about how to do it. It is based on theory from the articles or books. The next step to is to learn about it by ...
4
votes
2answers
169 views

Conceptual ERD Multi-table many to many, or possibly recursive?

I'm creating a conceptual diagram [yes, I know I've included attributes and keys - but this is just for me to consolidate what I'm doing whilst learning] -- so please treat it as Conceptual with the ...
0
votes
1answer
40 views

Dynamic Filters in SQL server

I have problems with my dinamic filter in 'sql server'. My problem is that the filters aren't working. When I try to execute the store procedure I just get all the data without filtering. I'm new ...
3
votes
2answers
183 views

Adding around 200 rows in a table grows size of the table by 400kb where avg row size is 0.2KB

We are running into an issue where if we look at the avg row size (0.2kb) x number of rows (200) inserted in one of our table, the size should grow by around 40 KB. However the total used space has ...
2
votes
1answer
43 views

Using Join to get data from multiple tables in SQL Server [on hold]

A(a_id, a1, a2) B(b_id, b1, b2) C(c-id, a_id, b_id) Now, I want to fetch all the data of table A, and from table B, I only need a record of b1. How can I use join query in SQL Server to fetch the ...
7
votes
4answers
1k views

How can I convert a key in a SQL Server deadlock report to the value?

I have a deadlock report that tells me that there was a conflict involving waitresource="KEY: 9:72057632651542528 (543066506c7c)" and I can see this: <keylock hobtid="72057632651542528" dbid="9" ...
1
vote
0answers
50 views

Should the PK on an identity column be non-clustered? [on hold]

For a table with PK on an identity column, it will be clustered by default. Could it better be non-clustered? The reason is other indexes will be created for queries. A query which uses a ...
1
vote
1answer
50 views

Why is DistinctSort followed by TopNSort in my query plan?

I have the following definition: CREATE TABLE [dbo].[JobItems] ( [ItemId] UNIQUEIDENTIFIER NOT NULL, [ItemState] INT NOT NULL, [ItemCreationTime] DATETIME ...
2
votes
1answer
42 views

Stats Maintenance after Restoring to Newer SQL Server

What's the ideal (or necessary) sequence of call when restoring a SQL Server 2012 backup onto a SQL Server 2014 instance and updating the compatibility level? -- Update Statistics for all tables EXEC ...
2
votes
1answer
113 views

Password generator function

What's the best way of creating a password generator user defined function function in SQL Server if it is not possible to use non deterministic funtions within functions? I would like to create a ...
0
votes
2answers
51 views

Select statements during long update

I've a table MESSAGES id (long) | attach_data (image) | ins_date | flag this table contains all messages of my application. During night, my job cleans old attach_data with query update messages ...
1
vote
1answer
11 views

Replication with fail over cluster in SQL Server 2014

Presently I am Using Replication Feature in SQL Server 2012 .I want to migrate to SQL server 2014 .I want to use fail over cluster feature .Does it effect the replication feature which we are using ...
5
votes
2answers
191 views

Insert only deadlocks

We have an application inserting data into a table. Unfortunately, we are getting deadlocks and the deadlocks are coming from inserts only. We are seeing the inserts take key locks in a different ...
-2
votes
1answer
30 views

Performance Testing for Database [on hold]

Is it possible to make a automatical performance testing in SQL server in the production phase? When data in the database increase you need to gain feedback in proactive approach. I would like it do ...
3
votes
1answer
349 views

System.Data.Entity.Infrastructure.CommitFailedException: C# Multithreading & SQL Server 2012

We have a C# multi threaded (100 threads) program which reads the records from the DB and each thread picks up one record (one Entity Framework connection per thread) and update the a single DB table. ...
0
votes
0answers
19 views

Why does my SQL Server HAG fail from PRIMARY to RESOLVING and back again?

I recently noticed our SQL Server High Availability Groups failed from the PRIMARY to the RESOLVING state, and then from RESOLVING to the PRIMARY state, without failing to the SECONDARY state. Does ...
1
vote
2answers
162 views

Is it possible to set stand-by database to active, do changes and then continue restore chain?

Basically, I'm using a custom log shipping method on a sql 2012, where the transaction files are manually copied to an offsite location. The files are then restored using something similar: RESTORE ...
2
votes
1answer
207 views

Implementation of SSL ON SQL SERVER DEFAULT INSTANCE

We've purchased an SSL certificate for our Server with a specific CN and implemented the certificate on IIS. We imported the same certificate on the SQL Server machine. However, when trying to ...
2
votes
1answer
107 views

Updating large table worked before, now taking hours

BACKGROUND: I am using a non-production SQL Server to manipulate a large data set and run a few basic calculations. The original data file I have, which is about 30M rows, is missing records (not ...
2
votes
1answer
89 views

Database Backup - In Process - Power Outage

I am using SQL Server 2008 R2. What happens if a database backup (Full/Differential/Transaction Log) is in process and there is a sudden power outage or the system crashes? Does that corrupt the ...
2
votes
1answer
25k views

SQL Server is configured to allow remote connections

I use SQL Server 2012 and SSAS Tabular Mode (My Instance Name Is MSSQLSERVER2012T) Then I download AdventureWorks Tabular Model SQL Server 2012 From This link I open it with Visual Studio 2010 and ...
7
votes
5answers
8k views

How do you find SQL Server version/edition without SSMS installed?

How do find out which edition is installed without having the management studio installed? I have a server that functions as a license manager for another software. Upon investigation of a high RAM ...
2
votes
1answer
1k views

Connection to local SQL Server 2012 can be established from SSMS 2008 but not from SSMS 2012

I have two local SQL Server instances running on my local machine. The first is SQL Server 2008 R2 Enterprise Edition (named MSSQLSERVER) and the 2nd is SQL Server 2012 Business Intelligence Edition. ...
0
votes
0answers
22 views

Query Designer - Cannot connect to Server

I am following a tutorial to be able to use SQL Server Data Tools (SSDT) for reporting. However, I am having issues connecting to a particular database when I try to add a new DataSet and try to ...
3
votes
4answers
3k views

How to make SSMS upper case keywords

I recently started using Management Studio 2012. When using MySQL Workbench, a handy feature was that I could stay all in lower case and any reserved word (like SELECT, INSERT) would convert to upper ...
0
votes
1answer
183 views

Need Advice on Normalizing Database

I have a group of database tables that lack normalization. They all have a similar primary key called 'doc_index', which is either a PK by itself or part a composite PK. As you can see below, there ...
1
vote
3answers
101 views

Snapshot replication - How to detect when a snapshot has arrived on the Subscriber from the Subscriber DB

I have snapshot replication set up to on a server which publishes to a second server as part of a scheduled SQL Server Agent job. When the snapshot finishes, I would like to detect when each table has ...
-1
votes
0answers
10 views

Error encountered during replication [on hold]

During replication i deleted the physical files of database which was in recovery state now it is in recoverypending state so how i can delete it
2
votes
1answer
47 views

Migrate existing SQL Server database file to smaller files

I have a database that is about 1TB in size. It's currently on a 2TB hard drive and I would like to replace it with a few 512GB SSD. I need to split the existing database file (.mdf) into multiple ...
3
votes
0answers
664 views

General access denied error while using import data in SSMS [on hold]

I am using SQL Server Management Studio with the following version information below: Microsoft SQL Server Management Studio 10.50.4000.0 Microsoft Data Access Components (MDAC) ...
4
votes
2answers
121 views

Fire and Forget SQL Triggers?

I have a 3rd party app that uses SQL Server as a back end. Specifically we have it on SQL Server 2000, SQL Server 2008 and SQL Server 2008R2. Any solution must be available to all, but solutions for ...
2
votes
0answers
32 views

Moving from MS Access to SQL Server 2012, need help with column history

I'm moving an access database from all the data being in MS Access to MS Access being just a frontend, but I'm having trouble figuring out how to do a sort of column history. I have a ...
2
votes
0answers
27 views

SQL Server replication - error when creating a subscription - The article '(null)' does not exist

When trying to add a subscription to an existing publication use [Product] exec sp_addsubscription @publication = N'Product', @subscriber = N'REPLON1', @destination_db = ...
-1
votes
1answer
30 views

Using datediff() in SQL Server 2008 to get the difference [on hold]

I'm having some trouble in updating my table. I would like to update the records that is passed in the current date. I am trying to update the records of the reservations(check-out) that is finished. ...
1
vote
0answers
22 views

SQL Server Performance in VMWare when creating different drives from a single Datastore [on hold]

On VMWare if you are going to create a new SQL Server instance with 4 processors / 32GB ram as an example GuestOS and I have access to storage that is just one a big giant 800GB "Datastore" (made up ...
3
votes
1answer
313 views

sp_startpublication_snapshot Parameter(s)

I am creating a stored procedure that: Restores a DB from a .bak giving the .mdf and .ldf a new name (so we have have several copies of the same DB up (If specified in the SP's parameter) Creates ...
140
votes
14answers
44k views

How do you document your databases?

I find that most of my clients are not documenting their databases at all and I find that pretty scary. To introduce some better practice I would like to know what tools/process you are using. How ...
3
votes
2answers
60 views

Use a view to join tables or a stored procedure for a better execution plan?

First let me state I am a C# developer, not a SQL Server DBA, so please excuse my ignorance on SQL Server database query execution plans. What I want to know is for a stored procedure which the ...
0
votes
0answers
18 views
1
vote
3answers
28 views

Selecting the average of the top percent of duration, grouped by minute

I am attempting to find the average of (the top 5% of duration/ per minute). I wrote this query: select AVG(Q.duration) Avg5Perc, Q.time FROM ( select top 5 PERCENT duration, time from ...
2
votes
4answers
116 views

Effiiency of multiple OR predicates versus a single range

Say I have a SQL statement: SELECT * FROM MyTable WHERE KeyColumn1 = 1 OR KeyColumn1 = 2 OR KeyColumn1 =3 OR ... KeyColumn1 = 10 And another: SELECT * FROM MyTable ...
2
votes
1answer
430 views

Named Pipe Provider Error code 40 [on hold]

I have literally tried everything, from enabling named pipe to adding exception to ports in the firewall, to everything possible in surface configuration. I can connect to the SQL instance(using TCP ...
0
votes
2answers
146 views

Sql server 2008 - server name changed

I have changed the computer name of the server where sql server 2008 r2 is installed. Old name was WIN-OUJEKRMGXXX and new server name is KASURDYYY When i configure replication following error ...