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)

1
vote
4answers
57 views

Incorrect total using SUM of DATEDIFF results [closed]

When i run a few DateDiff(SECOND, value1, value2) it returns a lists of values 93, 185, 1879 which totals 2157 sum with the calc and with SUM() However, when i use DateDiff(SECOND, firstValue1, ...
2
votes
1answer
125 views

Order by values with most incidence

I have a table as this example: CREATE TABLE customerEvent( customerID int NOT NULL, eventID int NOT NULL ) customerID may appear in many records. I use the following query to identify ...
3
votes
1answer
121 views

Enabling Constraint Silently Fails

Why would SQL Server silently fail to re-enable a foreign key constraint? I recently attempted to re-enable a number of constraints using ALTER TABLE. Most enabled successfully; however, minority of ...
1
vote
1answer
49 views

How can i enforce data integrity in this setup? [duplicate]

I have these tables: |-------------tblSchool -------------| | + ID | | + Name | | | | ...
0
votes
1answer
15 views

SQL Availability Group Network

On a SQL Availability Group what IP/network carries the workload of moving changes to the secondary replica and how do you find this network?
9
votes
4answers
146 views

Is it poor practice to aggregate data from different tables into one?

Background I write a lot of large reports for and generally maintain a large health records DB (write SPs, functions, jobs, etc.). The original schema, and software that uses it, is from a different ...
3
votes
2answers
41 views

Combine the effects of separate delete and insert rows

How to I combine the two rows below: Date Id For_Id Type New_Value Old_Value ------------------------------------------------------------------ 2015-08-13 6 327 ...
0
votes
1answer
55 views

TOTAL column or VIEW that computes?

I've got a couple of tables to track volunteer workers at our non-profit. One stores Volunteers and tracks information about a volunteer such as the person's name, a contact number, primary location ...
7
votes
1answer
93 views

Clustered Index Help, where did i go wrong?

I was asked to review a very busy table and identify any areas of improvement. I have very limited power to change the table just the indexes. Table information 240 columns ~5 million rows Read ...
3
votes
0answers
51 views

How to set ALL the replication to DEADLOCK_PRIORITY LOW?

I have just got this email here: Then looking at the sql server log I find this deadlock was caused by one of our procedures (that was the victim) against the replication. O.K. in this case in ...
2
votes
1answer
37 views

Index usage and update statistics do not correspond?

In order to discover unused and wrong indexes in sql server I went through the following article: https://www.mssqltips.com/sqlservertutorial/256/discovering-unused-indexes/ It gives two queries ...
0
votes
1answer
31 views

Automate Backup of SQL Server Database Structure

I have a data warehouse which isn't huge only about 16Gb in a Microsoft SQL Server Standard Edition 2014 database. However, now that it forms part of our production system I don't like developing on ...
3
votes
2answers
158 views

Latin1_General_BIN performance impact when changing the database default collation

I have set the database collation to Latin1_General_BIN, to make string comparisons case-sensitive. Will this have an impact on performance? Will it have any impact on DML or DDL operations in the ...
1
vote
1answer
31 views

How to find out the account(s) under which the sql server is running?

I have just created a proxy and I need to grant access to the proxy to the account that runs the sql server agent. It will probably be a domain account. How can I find it using T-SQL?
-4
votes
1answer
41 views

Is it allowed to have " in sql server name? [closed]

Double quotes can be given in sql server name. Looking for answers
1
vote
2answers
52 views

Spotlight for SQL Server LockType explanation required

I have just started using Spotlight as I'm a software developer, but I am forced to identify database issues causing blocking (Spotlight shows me AWAITING_COMMAND at the points and all other processes ...
2
votes
2answers
32 views

Database - Resource usage statistics

I would like to find (using SQL DMVs) whether a database is actually in use and if so then how much of that servers resources it is taking. I need some ideas on how we can properly collect usage ...
3
votes
2answers
95 views

Queries on database migration

I have a SQL Server 2008 database of size around 1 TB. I want to migrate it to SQL Server 2012. I have few queries: To migrate, I will take full backup of 2008 and restore it on 2012. I want to know ...
2
votes
1answer
25 views

Microsoft TDE Permissions For Changing Keys

I am setting up roles as a layer of protection inside of MSSQL. One of the roles will only have the ability to change database encryption keys for TDE on the database server. The server will be using ...
1
vote
0answers
82 views

SQL Server 2012 memory issue [closed]

I am having performance issues on a Windows 2012 Server running SQL 2012. When I run the DBCC MEMORYSTATUS command I receive the following. Process/System Counts Value Available Physical Memory ...
0
votes
0answers
31 views

SQL Server 2012 memory issue [duplicate]

I am having performance issues on a Windows 2012 Server running SQL 2012. When I run the DBCC MEMORYSTATUS command I receive the following. ...
3
votes
1answer
38 views

Scripting Microsoft Data Warehouse Wizard

I am trying to automate the MDW setup process in my environment. Currently I have everything complete except for enabling the data collectors (usually uses a wizard as seen ). Has anyone seen or ...
1
vote
1answer
30 views

Sum currencies excluding duplicatied records

I have a CRMOffer table containing customerID and other CRMOffer data. And a Sell table containing customerID and sellValue and sellPK. Sell table has a explicit PK, CRMOffer sadly doesn't have one ...
6
votes
1answer
79 views

Ola Hallengren Index Script not Reindexing

First, I realize a similar question was asked and the poster had page count set to 1000 for a 679 page index; not what's going on. I have Ola's script set as @Databases nvarchar(max) ...
4
votes
1answer
21 views

Configure SSMS intellisense / web browser settings to accept UNC directory path inputs

I would like to navigate to open a directory path from an in-line commented UNC path. SSMS integrates with Windows Explorer and Explorer allows UNC navigation from the address bar. Indeed, when in ...
4
votes
1answer
85 views

Performance problems with TOP and user defined functions in views

I have problem with performance of queries on simple query on view. To keep things simple, assume my view is defined as follows: CREATE VIEW [mon].[ViewDevicesWithGroups] AS SELECT Id, Name, ...
7
votes
4answers
328 views

Is it possible to develop a SSIS with a SQL Server Evaluation Version

We are thinking about buying an SQL Standard Server for implementing an ETL via SSIS. Since it is very expensive for us I would like to test developing SSIS Packages on a free version. Since the ...
0
votes
1answer
42 views

SQL Server Management Studio backup not shown when restoring

I am trying to restore a database from a backup taken on another server. I am doing this by using SQL Server 2012 Management Studio. After I have taken the backup on server 1, I go on to select the ...
0
votes
2answers
45 views

Identical SQL Server databases hosted in the same physical DB server

We have hosted similar SQL Server 2014 databases TestDB and TESTDB_Copy on the same physical server. The two databases are almost the same and there may be minor differences in the number of records ...
1
vote
2answers
26 views

Dynamically changing an order number to end in _ERR

I'm trying to update multiple orders at once instead of doing them one at a time. Is there a way to dynamically update them all at once? For example: I have 5 orders ABC, BCD, CDE, DEF, EFG. I need ...
2
votes
0answers
12 views

TDE prep: key/certificate backup for restores

I am working in a dev environment to better understand TDE encryption. I have it working along with backups and restores on another server. Had a few questions, I know I need to backup the certificate ...
1
vote
1answer
28 views

Query to get yesterdays data only for a specific time interval

Here is my where condition which I use for daily data but I've got to change the date everyday. WHERE X.stage = 'Approval' AND X.T_ExitTime between '2015-08-06 06:00:00:000' and '2015-08-06 ...
1
vote
1answer
24 views

Temporary permissions for DDL

I was hoping to use user impersonation to setup a user that has permissions to modify DDL, and only when I need to deploy DDL changes would I impersonate that user. This way I can use my windows ...
2
votes
1answer
60 views

Can't upgrade a SQL Express to SQL Standard

I have a 64 bit SQL Server 2008 Express R2 installed and I cannot upgrade it to a fully licensed 2014 Standard. When I try to update to SP 4, I get this issue: If I try to run the upgrade edition, ...
1
vote
1answer
17 views

use fulltext formsof inflectional to generate terms

Is there a way to use the FullText query components to generate the list of words in the FullText dictionary that are the inflectional formsof a word? This query would give me matches based on the ...
3
votes
2answers
303 views

Database Schema for Blank Database is large. 20MB

Is it normal for blank databases with just schema to be large? Or is there a way that I can reduce the size of the initial database?
0
votes
0answers
31 views

Tools to insert data faster in MySql database

I am trying to insert data from a flat file which is around 9 GB with about 15 million rows, I used SQl-server 2012 for that. I noticed data insert is much faster with sql server and it took around 30 ...
1
vote
0answers
11 views

Indexing AppFabric Monitoring Database

AppFabric is killing the page life expectancy and disk read metrics on my SQL Server. Does anyone know if I can add indexes to the AsStaging table or will that break things? There are some very ...
0
votes
1answer
25 views

Database structure for object with dynamic attributes

I am developing a proof of concept for a personalized email sending web application (like MailChimp, but with premade dynamic templates). The general structure is that I have my templates (different ...
-1
votes
2answers
34 views

error18470 when i try to connect to Database Engine

I am new in SQL Server. Wrongly I disabled my instance when I'd worked with Logins. Now I can not connect to Database Engine. Could you please help me?
0
votes
3answers
62 views

Sql Script takes much longer than estimated

In order to clean up a very large table holding binary Files in IMAGE Cols, I created the following sequence (based on this: Article) to get rid of a part of those image Bloby quickly: Select * into ...
0
votes
1answer
53 views

SQL Jobs Running - How to Kill

I ran the below query and it shows list of currently running jobs. However, in Activity Monitor none of these are running. How do I verify that these are/are not running? And how do I kill them? ...
1
vote
1answer
80 views

SQL get row based on condition [closed]

Hi all please see attached data below. I'm trying to get a row based on various conditions. scenario 1 - get highest row if no hours exist against it that has (setup + processtime > 0). scenario 2 ...
5
votes
2answers
61 views

Catch event of auto_shrink in SQL Server Log? [duplicate]

I am aware of the disadvantages of AUTO_SHRINK being configured on SQL Server databases. Recently, in a new environment, I discovered several production servers with the Auto Shrink option turned on. ...
1
vote
0answers
19 views

CDC and datamodel updates, best methodology?

We're about to start using CDC to track changes to a large number of tables in our db's. But since our datamodel is rather frequently updated, I'm wondering what is the best method for easily keeping ...
0
votes
1answer
33 views

SQL Server 2014 - Replica Server not available

I'm new to Sql Server and want to install SQL server alwayson clustering on my test environment. I followed the steps by this site: On each node I can connect to SQL Server but why my 2nd node is not ...
0
votes
1answer
30 views

sync many databases instance to one central database

I have four different SQL database instances which are installed on different servers. I want to sync all the databases into one central SQL instance i.e on (backup) instance which is on DR site and ...
3
votes
1answer
82 views

Is it possible to validate more than one parameter simultaneously into a Stored Procedure in sql?

On Microsoft SQL Server 2008 I realized a stored procedure which contains more than 20 parameters, in this SP I update or insert data into table which does not accept null values. I need to evaluate ...
13
votes
2answers
230 views

How are these two SQL Server rollbacks different?

In SQL Server 2008 R2, how are these two rollbacks different: Run an ALTER statement, for a few minutes, and then hit 'Cancel Executing'. It takes a few minutes to rollback completely. Run the same ...
3
votes
0answers
70 views

Very High wait time?

We currently have one production SQL Server 2012 Standard Edition , running on Windows server 2008R2 standard ( 32 GB RAM , 16 cpu). there are around 22,000 connection. the Max worker thread is ...