All versions of Microsoft SQL Server (not MySQL). Please also add a version-specific tag like sql-server-2016 if that is relevant to the question.

learn more… | top users | synonyms (2)

-1
votes
1answer
54 views

Patching SQL Server 2012

If I apply Cumulative Update 3 in SQL Server 2012 SP1, do I still have to do Cumulative update 1 and 2 before I can apply CU 3? And also, how would you know what CU's or hot fixes that has already ...
2
votes
2answers
27 views

Transactional replication subscriber vs AG secondary replica for reporting

I am trying to recommend my client a SQL server upgrade (from 2005-> 2014) which will allow the users to create record snapshot (via SSRS) from a read-only data source. Data latency should be kept to ...
3
votes
1answer
23 views

Store info in a column as JSON

I'm learning SQL Server 2016, I learned how to extract JSON from tables. Now I need to store JSON in a column. My JSON was: {"endereco":"R. Nome da Rua, 000", "cep":"00000-000"} I`m using nvarchar ...
0
votes
2answers
35 views

How do i find out the most active database?

How do i find out the most active database? I mean to say I have 10 DBs and some transactions keep on happening on these DBs. I want to know which is less used or which DB has less no of ...
3
votes
2answers
138 views

Best fill factor for GUID clustering key

We have a database that uses GUIDs for most of their columns in a data (non sequential). Does anyone have any best recommendations for fill factors on a GUID database in an hgih insert/update ...
0
votes
1answer
13 views

Enabling IPAII protocol disable remote conections. Why?

I have some servers with IPAII protocol enabled with a certain port: I'm using 1433 because a long story. but its working. We can use the default port 1433 AND IPAII ( for PHP developers ) with ...
7
votes
1answer
107 views

Should I disable HyperThreading

BACKGROUND I've recently been looking into some fairly high CXPacket wait times recently which has had me using SQL Sentry to monitor processor activity pretty closely. One thing that I've noticed as ...
1
vote
2answers
41 views

SQL Server engine in one place with database files on NAS

My office uses accountant programs which run on SQL Server 2008 R2. The SQL Server engine must be installed on one of the laptops (called "server") and the other laptops (called "clients") connect to ...
3
votes
1answer
30 views

Extract Multidimensional JSON

I have some tables: teste // id, descricao teste2 // id, descricao relacao // id, idTeste, idTeste2 With this structure, I got all products owned by a client. Now I'm trying to use FOR JSON PATH to ...
1
vote
2answers
81 views

How can I improve performance on a 3 table query?

I'm attempting to analyze a resource drawdown (the percentage of time individual units are being utilized during a reporting period, e.g. 2-weeks or 1-year). I need the aggregation down to the ...
3
votes
1answer
53 views

SQL Server Clustering - Active/Active or Active/Passive?

What is the logic of the Active/Active cluster vs Active/Passive cluster? I have searched a lot and read lots of documents but have not found the answer. In active active cluster can I have 1 ...
3
votes
1answer
46 views

How does SSMS get a list of files in a backup?

When restoring a database that has multiple files, SSMS gives you the option to restore as other paths and file names. How does it retrieve the list of files from the backup? Can I do that in a SQL ...
0
votes
0answers
32 views

SQL Server Trigger: Move deleted rows from 4 different tables to an archive table

I have a garage database with 20 tables. 4 of these tables - tCar, tCustomer, tAddress and tTelephone hold data about when we service a car. After a few months I want to be able to delete the data ...
1
vote
1answer
19 views

Managing Security for a Log Shipped db across two (unconnected) domains

SQL Server 2008 (soon to be 2012). We have a vendor that is providing us with log shipped backups of our production database. We use this log shipped database for BI staging, reporting, etc. I've ...
10
votes
1answer
174 views

Where does SQL Server physically store the IDENTITY VALUE for a table?

I'm hoping someone can point me in the right direction on this one. Here's my workings out so far. SELECT * FROM sys.identity_columns is a system view which gives "last_value" but the definition for ...
3
votes
1answer
41 views

Unknown System SPID blocking user SPIDs

We are performing a migration of 3rd party data and it is hanging. When we investigate we see SPID 38 (a system/background SPID) is the blocking user SPIDs trying to do the migration. Unfortunately, ...
1
vote
2answers
46 views

Database logging optimization and maintenance in SQL Server

One of the Web applications I am working on, uses NLog to log debug and error context information in the database. Basically, it performs a moderate number of inserts (I appreciate some tens of ...
0
votes
1answer
23 views

Should a Sql Server be accessible through the service's virtual network name?

In a working SQL-Server failover cluster environment I can open a SQL-Server connection using the configured service's IP address independantly of the current node it is on. I wonder if the assigned ...
3
votes
1answer
37 views

What is the impact of temporarily setting ALLOW_PAGE_LOCKS ON

The MSDN ALTER INDEX page says "An index cannot be reorganized when ALLOW_PAGE_LOCKS is set to OFF." I'm modifying our index reorg/rebuild process to be sensitive to indexes that have ...
0
votes
0answers
23 views

Creating clustered primary key index with ONLINE option

I have primary key clustered index which is constantly modified (insert and update) and read (select). Now, in order to change one of the types of the columns from which it is composed I need to ...
2
votes
1answer
22 views

Windows Authentication fails with “Cannot generate SSPI context”

We have a Windows Server 2012 with SQL Server 2012 instance. Its services used to run under an Active Directory account from an old domain, from Windows 2000 Server. A few years ago we replaced our ...
1
vote
1answer
29 views

no free memory but low total memory

I have SQL Server 2012 SP2 that has a max memory of 25.4GB but SQL Server is only using 15GB. When I check free memory with the PerfMon SQLServer:Memory Manger Free Memory (KB) counter only 40MB is ...
0
votes
1answer
30 views

Application Using ODBC Data Source To Connect To A Database Not Working?

Ok so I have a program that needs to access a database in SQL Express 2008 using an ODBC Data Source. The program is used for the inventory of objects in the SQL database using a gui. It basically ...
2
votes
1answer
34 views

Sql Server Cluster with multiple nodes

Does it make sense to think about a failover cluster configuration where less than 50% of all included nodes are standby? For example instead of setting up 4 clusters with two nodes each where one is ...
4
votes
2answers
366 views

Help undoing an accidental restore on SQL Server 2014

Yesterday I made a serious mistake¹: Restoring the wrong database. Background (you may skip this section): I right-clicked the Test database and proceeded to the "Restore Database" section as ...
0
votes
3answers
62 views

Get all records from inner joined tables if second table does not have data

I follow below syntax by which I achieve the result. but it takes time IF NOT EXISTS(select * from #tblxyz) BEGIN INSERT INTO #tblxyz select NULL END Select a.* FROM tblabc a ...
3
votes
2answers
231 views

Identify the type of a SQL Server backup

Long story short, we had a hosting plan on www.hostforlife.eu (btw, terrible service even on more expensive packages, plus they lost ALL files on their servers and we had to restore our backups as ...
1
vote
1answer
21 views

Accessing file share from ETL package in SQL Always-On configuration

How can I access the file share from ETL? Here are my environment details: I have 2 nodes in a windows cluster. node 01 and node 02 SQL Server 2014 is installed on both the nodes. Both are Windows ...
3
votes
1answer
42 views

What is the SQLCLR wait type in Activity Monitor within SQL Server Management Studio (SSMS)?

When I check our SQL Prod server, every time I open Activity Monitor I always see SQLCLR on the first list on the resource wait section in the Activity Monitor. It always has a high number. What is ...
1
vote
1answer
64 views

SQL Server 2014 SP1 installation iso file question

I read a lot regarding the issues with the original SP1 slipstream file and if the file names to download can be clarified it will be very helpful. What files do I need to install SQL 2014 SP1 CU6? ...
2
votes
1answer
41 views

Update with CTE & OUTPUT blocks on concurrent calls

I was having deadlock issues, so I started using this CTE trick that I read somewhere. No more deadlocks. But now each client that I add slows down (blocks?) the sproc. E.g. a 1-2 second update with ...
1
vote
1answer
20 views

Is it possible to attach a description field to the records in INFORMATION_SCHEMA.TABLES?

In SQL Server, [database name].INFORMATION_SCHEMA.TABLES has the following columns: TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE This table has no additional fields, such as "DESCRIPTION" ...
2
votes
1answer
26 views

SQL Server 2012 In-Place3 Upgrade and Timing of Database Version Change

We are updating several SQL Server 2008R2 instances to SQL Server 2012 SP3 CU2. I know that the database versions will be changed from 100 to 110 during this process (e.g. once finished, the databases ...
1
vote
0answers
19 views

Meta Destination Owner Differs From Actual Owner

How can the replication meta data table differ from the properties of the publication through the interface; for instance ... SELECT destination_owner FROM distribution..MSarticles Yet, when ...
1
vote
0answers
29 views

Index on a highly updated field causing excessive locks in SQL server

I'm in a bit of a conundrum about what the best course of action on this (bad?) index is. I have a table which i use as a notification holder that i watch for database changes with. CREATE TABLE ...
3
votes
3answers
181 views

How to return rows between two datetimes stored as date and time?

How to view the result between 2 dates and times? My current Code: SELECT * FROM [DB].[dbo].[TABLE] WHERE [USER_ID] = '005' AND [DATE] BETWEEN '03-04-2016' AND '04-04-2016' AND [TIME] >= ...
0
votes
1answer
45 views

Pull the latest Employee and Manager Comments Based on Modified date

I have a table Comments which is linked to the Plan table. Each time the user adds a comment on a specific plan, the Comments table is populated. This table stores the historical data. I need to pull ...
0
votes
1answer
12 views

Server configuration SQL Server 2008

I am really fresh in the DB world so firstly,sorry about my noob question. I have a data warehouse project to perform in a group of 3 people. When installing SQL Server 2008 R2 Developer in my own ...
3
votes
2answers
150 views

Does SSMS follow the same support lifecycle as SQL Server?

I've found information about the support lifecycle for SQL Server (such as this page for SQL Server 2008/2008R2), but haven't found any information about SSMS. Does SSMS follow the same support ...
2
votes
1answer
35 views

Permissions on Trigger Problem

I am working with a database in MS-SQL 2008 R2, and I'm running into a problem. The basic setup is this: There are two tables of interest: dbo.Assesments and audit.Assesments. dbo.Assesments is the ...
0
votes
0answers
31 views

SQL Server accepting Access queries?

I am currently working on migrating a legacy codebase from VB6 and Access to VB.NET and SQL Server. I have run the Microsoft SQL Server Migration Assistant successfully and populated a SQL server ...
4
votes
1answer
91 views

Update with default values in case clause

I have a single table like CREATE TABLE Mytable (ID int identity, Name nvarchar(10)); GO INSERT INTO MyTable (Name) VALUES ('test1'); INSERT INTO MyTable (Name) VALUES ('test2'); GO ALTER TABLE ...
-2
votes
3answers
91 views

Split URL string into columns

Given the string: URL:'ID=1!&user=xxx&depart=21&companyId=43&workOrder=67' I need to get the result: Sno ID user depart companyId workOrder 1 1! XXX 21 43 67 ...
0
votes
0answers
27 views

One-Way Database Synchronization with AlwaysOn Implementation

please give me advice for my database architecture.. According to below image AlwaysOn primary replica are synchronizing with two local database server. Our company is working on virtual call centre. ...
4
votes
1answer
222 views

Partition by ascending and descending performance

I have a table, and for a given set of fields a, b and c, I need to get the first and last rows ordered by d and e, and am using ROW_NUMBER to get these rows. The relevant part of the statement is... ...
1
vote
1answer
151 views

Is select case when null better than iif(exists)?

I try to reduce huge performance issues on our application database. We use SQL Server 2014 and we have a lot of views. I wonder if there is a significant impact of rewriting left joins to use ...
0
votes
1answer
18 views

Communition Link Failure

I want to make a DNS to a sql database by SQL Driver. so I do it as it should be done. I have over hundred Clients with Windows 7 OS. All of them can connect to the database easily just a few of them ...
0
votes
0answers
28 views

Rstudio (on Linux) Connectivity to SQL Server 2012

I've been attempting to make RStudio connect to an MS-SQL database, but I've only been having issues with the Microsoft ODBC drivers. The system and installed software: Centos 7 64bit RStudio (and ...
1
vote
3answers
172 views

Finding count of null values in 500 columns of a single table

I have 500 columns in a table in SQL Server. I want to find the count of null values in each column. Is there a way to do it using a cursor and dynamic SQL?
0
votes
1answer
46 views

Upgrading SQL Server 2012 Enterprise SP1 (11.0.3000.0) to SP2 or SP3

We need to upgrade our production SQL Server 2012 Enterprise SP1 (11.0.3000.0) to SP2 or SP3. So which one would be more stable out of those 2 service packs and also how could this be achieved with a ...