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

Does Resource Governor help protect page life expectancy?

I have several large tables that I need to copy into partitioned copies on a transactional database. I am worried about the hit that this will cause to performance of my production applications. In ...
1
vote
4answers
5 views

How to find SQL Server database is in use or not? [duplicate]

What query do I need to write to know if the database is in use or not? I tried following query SELECT name FROM sys.databases WHERE state != 0; but it is not working. I want to ...
2
votes
3answers
733 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
22 views

Deploying Shared MS Access DB — Summer Intern first time with Access

So to give a brief background I've got a summer internship and was asked to modify and add features to an already existing MS Access DB. I don't actually take databases until next semester, so I was ...
1
vote
0answers
23 views

Understanding `dbcc showcontig` Record Size

I am comparing two tables. They are: CREATE TABLE Table1( Column1 [bigint] NOT NULL, Column2 [VARBINARY](max) NULL, Column3 [int] NULL, Column4 [DATETIME] NULL, Column5 [INT] ...
2
votes
1answer
16 views

Finding when a currently running Extended Events session started?

For old-school traces, I can look in sys.traces or the SQL Server log to find when a trace was started. Is there something similar for Extended Events? I came across this blog entry about using a DDL ...
1
vote
0answers
57 views

How to install Sql Server 2000 on Windows 10(x64)? [on hold]

After upgrading Win8.1 to Win10, Sql Server 2000 does not work. I tried to re-install Win10, and installed Sql Server 2000, but the installation stopped at installing MDAC, it could not continue. Did ...
3
votes
1answer
52 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
1answer
119 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 ...
2
votes
1answer
28 views

SQL Server 2012 - Disable Job On Linked Server

I have a job on server B, which is linked to server A. Is it possible to disable a job that exists on server B in the context of server A? I have tried the following command from server A and receive ...
2
votes
2answers
372 views

space usage on sys.allocation_units and sp_spaceused

It is a known fact that the DMVs dont hold accurate information regarding number of pages and count of rows. However, when you have the stats updated, I can't see why they wouldn't. I am working on a ...
0
votes
0answers
21 views

3 failed SQL Server Updates (KB3045313,KB3045305) plus SQL Server 2008 Service Pack 3

I'm trying to upgrade to Windows X and I believe that 2 failed SQL Server 2008 patches are preventing this from happening. I see this in Windows Update along with this failed History: ...which ...
9
votes
4answers
47k views

What's the easiest way to create a temp table in SQL Server that can hold the result of a stored procedure?

Many times I need to write something like the following when dealing with SQL Server. create table #table_name ( column1 int, column2 varchar(200) ... ) insert into #table_name execute ...
2
votes
2answers
185 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 ...
0
votes
2answers
49 views

Dynamic Filters in SQL server [on hold]

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 ...
2
votes
1answer
24 views
+50

Connection Reset by Peer Socket Write Error - How to solve in SQL Server?

We have a vendor working on Java (JDBC) application saying they are getting the error "Connection Reset by Peer: Socket Write Error". They are insisting that the SQL Server (SQL Server 2012) is ...
5
votes
0answers
47 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
35 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 ...
4
votes
1answer
70 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
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
1answer
24 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
19 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
171 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 ...
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
46 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
52 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 ...
2
votes
1answer
45 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 ...
0
votes
2answers
57 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
31 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
351 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
91 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
102 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
48 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
665 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
123 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 ...