This tag is for SQL Server 2012, major build version 11.00.xxxx.

learn more… | top users | synonyms (3)

4
votes
1answer
32 views

When to use sort_in_tempdb when rebuilding indexes?

We are debating whether to use the SORT_IN_TEMPDB option for our DW tables. My understanding is that there are more writes when using this option, although they are more sequential. We have a SAN ...
1
vote
2answers
43 views

Create rows when selected rows exist

I haven't spent much time with SQL Server, and I can't seem to figure something out. I have 3 tables; user, usergroup, group. usergroup is a table that contains both a group id and a user id, where ...
2
votes
3answers
53 views

Show all stored procedure definitions (content) for editing

Apologies if this has been asked before, the suggested 'related' questions weren't relevant and my own search turned up very little. I need to list the definitions (code) of all my stored procedures, ...
-4
votes
2answers
24 views

Uses of Database Mail [on hold]

What can I use Database Mail for in SQL Server 2012? I have configured Database Mail but would also like to know where I can use it.
2
votes
1answer
101 views

I/O is frozen on Database & also I/O was resumed on Database on daily basis in log with complete Backup

I would like to say that as on daily basis i got the message in my log file. First The I/O is frozen on Database (DatabaseName) message appears in log. The message is like I/O is frozen on ...
0
votes
0answers
22 views

SQLServer DeleteFolder Job ran successfully but it doesn't deleted the folder

I have a job to delete past 15 days folder in SQL Server. The job run successfully and delete the folder in local SQL Server. But It run successfully and does not delete the folder in another SQL ...
0
votes
0answers
49 views

SQL server only using 4 GB ram [on hold]

I have a Windows Server 2008 R2 server running SQL Server 2012 Standard Edition. It won't use more than 4 GB of RAM. I checked max server memory variable and it's a 7 digits long standard number ...
2
votes
2answers
26 views

Disk size and log file growth during upgrades

I have four SQL Server databases. Per the maximum load requirements, each database file can be between 1 and 2 TB in size. The HDD is a multi-disk DAS with about 9TB of space. During a database ...
1
vote
0answers
34 views

Oracle migration to SQL Server

I am working in a Oracle 11g database migration to SQL Server 2012, I did the migration using SSMA v5.3 and all works fine. However, I did re-write code in some objects like triggers and stored ...
7
votes
1answer
81 views

SET STATISTICS IO- worktable/workfile

I am executiong query, that produces plan: Statistics IO: Table 'Worktable'. Scan count 0, logical reads 0, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob ...
1
vote
1answer
36 views

Which technology to synchronise SQL Server and MySQL data?

Which technology should be used if I want to move my data from SQL Server to MySQL server when data is entered to SQL Server row by row and getting feedback from MySQL server? Should it be 1. ...
0
votes
0answers
21 views

Getting issue while creating SQL Server Agent job [on hold]

Getting error while copying SQL Server Agent job from SQL Server 2012 to SQL Server 2014. I restored databases in SQL Server 2014. But still facing below error. Msg 14234, Level 16, State 1, ...
1
vote
0answers
16 views

SSIS Custom Task with a default Task UI

I followed the tutorial here to build a very simple task and was able to get that task to work. Here are my current tools: Sql Server 2012 Visual Studio 2013 (project is compiled in .net 4.0) Sql ...
3
votes
1answer
26 views

SQL Server 2012 Explicit transactions taking time with Always on Setup

We have a weird issue while we setup the AlwaysOn on Azure VM. We have explicit transactions in our stored procedures, and which are causing some delays and blocking when till the time we get the ...
1
vote
0answers
33 views

Will longer DB transactions make calls to other DB wait?

I have a fundamental question but unable to find precise information online. I opened up a DB transaction (SQL Server) and making multiple inserts, updates, delete etc; the entire process takes about ...
0
votes
1answer
29 views

Issue in installing SSIS MS-SQL2012

While installing the MS SQL Server 2012 Enterprise Edition, everything goes through fine but I'm not able to install Integration Services alone. I get the error as following: The following error ...
1
vote
0answers
20 views

SQL Server 2012 restrict CmdExec to sysadmin server role

I'm trying to restricting CmdExec rights to sysadmin server role in SQL Server 2012. I've googled but just found some solution which they were for older version of SQL Server. Can you please help?
1
vote
1answer
26 views

Adding Secondary Data file in SQL Always on

How to add the Secondary Data file to the Database which is a part of Always on availability Group in SQL Server 2012.
2
votes
2answers
38 views

Drop and Create Script not working

I'm fairly new to databases, but I'm beating my against the wall trying to do something that (I believe) should be fairly trivial. I'm using SQL Server Management Studio 2012 and am trying to delete ...
1
vote
1answer
36 views

Strange behaviour in TSQL function (parameter with int variable or NULL behaves differently)?

I experienced very strange problem today with TSQL function. The function has several parameters (int and bit). One of the (int) is set with value NULL. When calling a function with NULL inside the ...
0
votes
1answer
59 views

Multi-threaded inserts vs serial

I have a large database application on SQL Server 2012 Standard Edition which receives data from hardware in chunks of 500-1000 (100 byte) rows every few seconds through a stored procedure. Would a ...
0
votes
1answer
28 views

Why does adding a transactional replication publication change all the tables and columns to “not for replication”?

I'm trying to get replication set up - this is my first time ever doing it, so I'm probably making some rookie mistake here. Right now I'm just working in the dev environment. I've been following the ...
0
votes
2answers
45 views

Finding the longest entries for a given column (nvarchar(100))

I am trying to find the biggest / longest entries of a column which is of type nvarchar(100). I need to understand if I can maybe restrict that column to be only nvarchar(20) or something. Is there a ...
1
vote
0answers
36 views

SQL server database performance issue [closed]

There are two database on same sql server 2012, with same tables, indexs and data as well, but for some reason one database response is 6 times slower then the other in most of the quries. Please help ...
1
vote
0answers
15 views

AlwaysOn AG Live Migration

A couple of thoughts on AlwaysOn AG migrations: Is there a reason why Microsoft didn't implement similar technology to Hyper-V Live Migration to AlwaysOn AGs so that the buffer pool and cache are ...
1
vote
2answers
58 views

SQL Server : Tracking a slow running query on completion

Am trying to work on script for slow-running queries. I understand that we can get the list of slow running queries using sys.dm_exec_requests. Say, I have a query Q1 which is running very slow, say, ...
0
votes
1answer
49 views

Breaking up long running query into batches runs fine for a while and then produces fatal error

I'm using a variation of this post which details using "careful batching" to delete records in batches from a table that contains 38MM records. The script below runs for a while and shows results ...
5
votes
2answers
131 views

SQL Server compatibility with New TLS Standards

The major browsers are moving beyond SSL3.0 and TLS1.0 . The PCI Security Council has declared an end-of-life date for these protocols to be considered sufficiently strong encryption. We need to ...
1
vote
1answer
39 views

Performance improvement on SQL query joining table on itself

I'm running this query on a table with approximately 20MM records in it. It's a very slow query, and I'm wondering if there's a better way to accomplish this that might run faster ? delete previous ...
0
votes
1answer
21 views

SQL Server 2012 - sp_executesql multiple parameter error

I am receiving an error when attempting to execute the following code that builds a dynamic string to be executed by sp_executesql. DECLARE @paramDefinition NVARCHAR(500); DECLARE @ID1 NVARCHAR(20); ...
0
votes
0answers
14 views

Auto Increment Sequence Broken After Applying a Key [duplicate]

After SQL Server 2012 Enterprise edition's evaluation period expired, I applied another key using the edition upgrade wizard. After it was successfully done, all Auto-Increment columns started ...
1
vote
1answer
26 views

I need to figure out the last time that a function was used by SQL Server. How can I do this?

I work with databases that contain thousands of stored procedures and hundreds of functions. I have found on-line methods to track the usage of stored procedures; however, I haven't seen the same for ...
4
votes
1answer
266 views

Why does SSMS highlight SUBSTRING in purple but RIGHT in grey?

I apologise for the trivial question, but I was trying to work out how to do a RIGHT in SQL so I experimentally typed RIGHT and it didn't highlight in purple, so I spent some time scratching my head ...
1
vote
1answer
38 views

Cannot connect to SQL Server database regardless of connection string

I'm having a tough time to connect to a local SQL Server instance within a C# app. I can connect to external databases on other servers, but I need to be able to use my own local database. The ...
4
votes
1answer
62 views

Why are these two HADR DMVs reporting different states?

SQL Server 2012 (11.0.5058.0) Enterprise Edition We have 8 Availability Groups in a 2(HA)+1(DR) cluster and our monitoring DMVs are reporting results that confuse me. 6 Availability Groups are ...
1
vote
1answer
41 views

No rows in sys.dm_exec_procedure_stats for a particluar stored procedure

I am running DMV queries to get stats for my stored procedure, but I am not finding any rows against this SP under sys.dm_exec_procedure_stats. Please suggest what could be various reason for this ...
0
votes
1answer
28 views

Need to make sense of FileTable permissions

I'm setting up a FileTable to allow users to quickly stuff some PDF report files into a database for later searching via an intranet application (to be built later). Sorting out the necessary ...
2
votes
2answers
101 views

Why can't user with SQLAgentOperatorRole delete his own SQL jobs

I created a login and a user. I assigned the user as the db owner of the database "test". Then I granted him the role SQLAgentOperatorRole so that he can delete/create/modify the jobs belonging to the ...
2
votes
1answer
33 views

What should be the command for following role creation requirement?

I need to create a role where the assigned user can access only the 'AdventureWorksDB" where he will have execute permission to all tables,views and stored procedures in the database. I wrote the ...
-2
votes
1answer
36 views

when adding a table to my dbo.view I don't get the entire view

here is the code for my view that calls all rows from the tables: SELECT dbo.Purchase_Order.Purchase_Order_ID, dbo.Purchase_Order.Purchase_Order_Number, dbo.Purchase_Order.Purchase_Order_Date, ...
2
votes
1answer
50 views

Identity column value falling behind randomly

We are having a strange intermittent issue where the identity column value falls behind the MAX(ID) for the table. Each customer gets their own table that stores statistics to the tune of ...
13
votes
2answers
96 views

Index on a persisted computed column not seekable?

I have table, called Address, that has a persisted computed column called Hashkey. The column is deterministic but not precise. It has a unique index on it that is not seekable. If I run this query, ...
2
votes
1answer
27 views

How to add new named instance in SQL Server 2012 [closed]

We have already installed SQL Server 2012 with required instance and collation name. But now as per the project needs we have need to add one more instance name. Can anyone knows how to add new ...
1
vote
1answer
30 views

How to group data and write it's group id for each row?

I have sample data: CREATE TABLE #T (Name varchar(5), GroupId int NULL) INSERT INTO #T (Name) VALUES ('A'), ('A'), ('A'), ('B'), ('B'), ('C'), ('D'), ('D') Name GroupId ----- ----------- A ...
1
vote
2answers
60 views

How can I run a SQL job every 1 second? [duplicate]

I have an SQL Job which processes minimum amount of rows at a given time. Currently its running every 10 seconds which is the minimum available in Job Scheduler. But because of that the table used ...
1
vote
2answers
45 views

When to prefere a truncate over a batch-delete?

When I browse DBA-Reactions I understand nearly all the .gifs but with this one I have trouble: https://twitter.com/DBAReactions/status/613840893322338304 I mean truncate obviously doesn't create ...
0
votes
0answers
20 views

SQL Server 2012 Compress Backups on Azure VM takes time to restore than backup from Normal SQL Server compress backup [on hold]

I have two backup files one from Normal SQL Server and one from SQL Server from Azure VM. The restore of these backup files is totally different from each other. Though the database backups are ...
1
vote
0answers
35 views

SSRS puts excessive load on SQL server

I have this bit of code: With ab as (Select distinct d.Code from d join a on d.code = a.Code where a.text like '%AutoPost%' ), sd as (Select distinct m.ref, m.Number, m.Completed, s.ID, ...
1
vote
2answers
35 views

Automating an SQL task on a monthly basis

At the start of each month I have to give a team a copy of the live database which is held in a backup from 1am each morning (D:\Backup) - We then copy this database elsewhere onto a dev server and ...
0
votes
1answer
15 views

Correct way of configuring remote users to connect to Microsoft SQL Server 2012

I have 2 Servers, a web server and a database server. Web server runs a number of .net sites that need to connect to the database server. Currently, I have a configuration string for each ...