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)

0
votes
0answers
8 views

Why am I seeing OPTION (MAXDOP 1) in my Actual query plan even though I've not set it in the stored proc?

SQL Server is set with MAXDOP 0 by default. In the stored procedure I'm testing I keep seeing WITH (MAXDOP 1) in the Actual Execution Plans even though I've not specified any hints other than ...
0
votes
1answer
20 views

Failed to create, join or add replica to availability group in SQL 2014

I have a 2 node FCI and a standalone SQL Server installation on a non FCI node. I have been automating the configuration/installation of FCIs, AGs, and DB Replicas which has worked fine up to now in ...
0
votes
0answers
10 views

sql the job was stopped prior to completion by shutdown sequence 0

I've transaction replication set up and running fine but today my Log Reader agent started having this warning : sql the job was stopped prior to completion by shutdown sequence 0 . The job was ...
0
votes
0answers
8 views

INSERT INTO MSSQL Linked Server without specifying database in semi-fully qualified name

I have a Server called DEV, a database called Nus12345, a linked server called SnapshotDev, a schema called Snapshot, and a table called SnapshotPersonEmployee. On the DEV server, there are many ...
0
votes
0answers
8 views

SQL Server Harware - Question on Filling up memory slots

We are upgrading our SQL Server hardware. ours is a muti-TB data warehouse. For example HP DL380 G9 server config with 2CPU(8cores per CPU) has 24 DIMM slots. I'm trying to convince my TI partners ...
0
votes
0answers
9 views

Table frequency metric Count (minimum 2 hits every 5 seconds using a datestamp within 24 hours)

I need to find out how many times a table is hit within a 24 hour period, where the table is hit at least twice (2x) or more within a 5 second period. So for every 5 seconds (using a datestamp), how ...
0
votes
0answers
9 views

Necessity of backing up tail log when restoring transaction log?

I have a question about whether or not it is necessary to back the tail log up when performing a restore of a database in Full Recovery mode. I've sprawled for a good while now, and have gotten ...
0
votes
0answers
15 views

Why we can not individually get SQL-server web edition licence?

The SQL server web edition is only provided by server providers Why we can not individually get this licence subscription? I would prefer to subscribe directly from Microsoft's website by monthly ...
-2
votes
1answer
45 views

Get all the queries executed in the last week in SQL Server [on hold]

How can I get all the queries executed on a SQL Server in last week.
-2
votes
0answers
27 views

SQL features and analytical tools backwards compatibility [on hold]

Is it possible to use the extra installed features and analytical tools that come installed with a more recent version of SQL Server 2012/14 such as SSRS and SSAS on data which is held on an old 2005 ...
2
votes
2answers
185 views

Recommended memory configuration for many SQL Server instances per server

I am currently managing a server cluster for a SaaS system. We currently have 6 SQL servers running MSSQL 2008 R2. Each server is a quad core virtual machine with 16GB of RAM provisioned on a server ...
3
votes
3answers
14k views

Cannot access any database in SQL Server 2008 R2 Express after moving workstation from domain to workgroup

My workstation that has SQL Server 2008 R2 Express for development purposes installed has been moved out of a domain into a Windows workgroup. While being part of the domain I used the account "...
2
votes
4answers
199 views
+50

Database design for an exam

I am designing database for an exam, and I am stuck. I do not know how to do it. Here is the relevant information: Student answers 10 questions. Each question has 3 options (answers) and student ...
1
vote
0answers
9 views

SQL Server Table Design for Report - Is OLAP Schema Suitable

A work colleague is developing SQL Server database tables for a reporting project. Basically, the only activity on the table will be populating it from a ETL process (SSIS). He insists on creating a ...
0
votes
0answers
22 views

Calculate the current storage of a row

Is there any way to calculate the current storage of a row automatically ? I have calculated the average storage of a row doing: table size / number of rows. But this is the average. I need ...
1
vote
0answers
10 views

Mysql to MS SQL Migration and synchronization

Database migration from MySQL to MS SQL using SSMA tool is very nifty, however, I have one question around this. I have 2 MySQL Db's want to migrate to MS SQL, one sizes around 850 GB and another one ...
10
votes
2answers
872 views

If positive, sum all items. If negative, return each one

I am needing to find a way to SUM() all of the positive values for num and return the SUM() of all positive numbers and an individual row for each negative number. Below is a sample DDL: Create ...
3
votes
3answers
26k views

How to uninstall SQL server 2012 not showing in control panel's “Programs and features”

I am frustrated to the core. While fixing my Sql Server I've made the situation worse. Here is the problem: initially my master database was corrupted, so the MSSql service was not starting. I tried ...
1
vote
0answers
26 views

SQL Server 2012 database stuck restoring

I'm trying to restore my development database DEV with a backup of my production database PROD. Every time I go through this process, the DEV database gets stuck in a Restoring state. Using the SQL "...
1
vote
1answer
18 views

Configuration.ini file feature codes

I have searched but not been able to find a list of the codes and descriptions available when using the configuration.ini file. Is anyone able to link me some information?
2
votes
2answers
50 views

Applying Transaction Logs to an existing Database

I am wondering if this possible, I can not seem to apply another transaction log. I have restored the Full database backup, the differential backup and my last Transaction Log WITH RECOVERY. If later ...
1
vote
1answer
24 views

SQL Backup with Mirror option in maintenance plan

I need to do backup ALL databases on an instance and put them in 3 different locations on our network, so i found that you can use backup with mirror, so I set that up. I have a maintenance plan ...
1
vote
2answers
30 views

Access to folder is denied (log shipping)

i am trying to log ship from server A to B.I have done everything to configure log shipping but i try to run the job then at Server B while coping backup from server A gives me an error (can not ...
1
vote
0answers
35 views

Installing SQL Server version 10.50.4000 is failing

I am attempting to install SQL Server 2008 R2 version 10.50.4000 on a virtual machine running Microsoft Windows Server 2008 R2. When I try to install SQL Server, I get an error that, when I look it ...
-1
votes
1answer
46 views

RESTORE DATABASE execution continues restore completed

Today, I faced a strange problem which didn't cause any error or downtime. I executed a query to restore a database. RESTORE DATABASE Database_Name FROM DISK='PATH\FILE1.BAK', ...
1
vote
0answers
13 views

Retrieve data from OLTP MySQL to SQL Server DWH using SSIS

I'm running a BI solution currently reading data from an OLTP SQL Server 2008 to a SQL Server 2012 data warehouse. The ETL phase is implemented with SSIS and runs twice a day. This phase relies on a ...
0
votes
0answers
16 views

How to ensure NULLed encryption key columns are permanently erased

We are storing BLOB data (call recordings) in commodity cloud storage. These are encrypted and the keys stored in an SQL Server database. I am working on a project to implement "Retention", i.e. ...
0
votes
1answer
351 views

Prevent gaps while using Identity/sequence object in sql server

I have a table and I am trying to insert values in it. I want to prevent gaps in the primary key column. For primary column I have tried using Identity / sequence objects. I know that this is ...
6
votes
8answers
8k views

How to find the nth highest salary in SQL?

I have found a query to find the nth highest salary from Employee table , but i don't understand the logic of (N-1)? EmpID Salary 1 90000 2 80000 3 54000 4 ...
-1
votes
1answer
29 views

SQL Server mirroring / failover alternative [on hold]

I am looking at building at reliable database with Microsoft SQL Server, with mirroring and automatic failover. The SQL Server here is standard version, not enterprise one so High Availability ...
2
votes
1answer
48 views

Sql Server: Two identical queries, one times out, one is quickly done

I see a very strange behavior on Sql Server I need assistance for from people who know a bit more about it than I do. For the first time I used the Sql Server Profiler which confirmed that it is ...
0
votes
1answer
457 views

SQL80001 - incorrect syntax near ')'

In the below code (that I've inherited), I'm getting the message "SQL80001 - incorrect syntax near ')'", the error being on the third line from the bottom with the + sign. I've looked at THIS SO ...
0
votes
0answers
15 views

How to get the procedure names which has its underlying view missing in a database?

I need to identify procedures with broken dependency along with the list of view/ views or tables underlying under that procedure
16
votes
1answer
619 views

Restore Database using GUI - Wrong file to restore

I'm just messing around with the SSMS graphic interface and studying the options of the "restore" task. One thing that I noticed is when I click on "generate script", the first line of the query is: ...
1
vote
0answers
27 views

How can I have SQL Server send Job Notification alerts to an API

I am trying to get the notifications for a job out of my email and into a chat client(HipChat). So far my googling has been less than successful so I will put the question to the community: Is there ...
3
votes
0answers
81 views

.Net CLR Assembly not working in SQL Server 2016

I am migrating a database application from Windows 2008 R2/SQL Server 2008 R2 to Windows 2012 R2/SQL Server 2016 that uses a third party .Net CLR assembly to parse strings. The error I get is: An ...
3
votes
0answers
80 views

Heavy I/O for Microsoft Transaction Log

We have a Microsoft SQL Server (SQL Server 2012 SP3), we've noticed that transaction log I/O is very high. We do have a busy server; we're hosted at Rackspace with SSD block storage. The Logs are are ...
2
votes
1answer
48 views

Concurrent reads and updates

Let's say I have a table with 50,000 transactions that need to be processed in the background in the same order they were received. I have a Windows service that polls for transactions, picks them up, ...
6
votes
4answers
3k views

How can I remove a bad execution plan from Azure SQL Database?

DBCC FREEPROCCACHE doesn't work in Azure SQL DB. How else can I force a plan to kick itself out of the cache in a way that won't hurt a production system (i.e. I can't just go alter tables willy nilly)...
13
votes
7answers
2k views

Capitalize only the first letter of each word of each sentence in SQL Server

I want to capitalize only the first letter of each word of each sentence in a SQL column. For example, if the sentence is: 'I like movies' then I need the output: 'I Like Movies' Query: ...
1
vote
2answers
1k views

Can't restore Azure bacpac into localdb with SqlPackage

I have made a backup of my SQL Azure in a bacpac file and when I try to import the bacpac in localdb it always fail. Here is the command I use: PS C:\Program Files (x86)\Microsoft SQL Server\110\DAC\...
0
votes
0answers
43 views

Why can't a user in a group with the sysadmin role see any stored procs in SSMS?

A developer who is in a "Developers" group granted the server fixed role "sysadmin" on the development SQL Server installation is unable to see any stored procedures in a database - only the "System ...
4
votes
1answer
169 views

TDE - Encryption on a large database

I'm in the process of researching TDE implementation on a VLDB and would like to know if anyone has real world experience with enabling encryption on a production server. What kind of problems (if ...
1
vote
1answer
44 views

Can't “Script Database As -> CREATE TO” with SSMS 2008R2 and 2016

I created a SQL Login (Login01), mapped to DB user (User01), member of db_owner database role. When connected locally with this user in SSMS, i try to script out the database (Script Database As -> ...
41
votes
2answers
33k views

MERGE a subset of the target table

I am trying to use a MERGE statement to insert or delete rows from a table, but I only want to act on a subset of those rows. The documentation for MERGE has a pretty strongly worded warning: It ...
1
vote
2answers
121 views

Choosing the right storage block size for sql server

There are many articles on what storage blocks size should be used for sql server e.g. Disk Partition Alignment Best Practices for SQL Server. The right blocks size should improve the performance of a ...
3
votes
1answer
69 views

Why are Column Defaults on my User-Defined Table Type (UDTT) not being honored?

I create a table type in SQL: CREATE TYPE [dbo].[MyObject_TableType] AS TABLE ( [Name] VARCHAR(MAX) DEFAULT '', [Index] VARCHAR(MAX) DEFAULT '' ) I build a DataTable and populate it with ...
1
vote
1answer
42 views

SQL Server - Timestamp datatype

I need some information on SQL Server timestamp. I found all the required information here. The article says The timestamp syntax is deprecated. This feature will be removed in a future ...
0
votes
1answer
23 views

Hash Match in Query has high cost and high number of excecutions

I have the following query: declare @jobID NVARCHAR(20) declare @dataGroup BIGINT declare @lastSyncVer BIGINT set @jobid='P-0001' set @dataGroup= 5637144576 set @...