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

learn more… | top users | synonyms (2)

1
vote
1answer
24 views

List with all visible meta data in AFTER UPDATE trigger

I have the following issue - something is updating particular table columns when such update is not allowed. I was not able to find the object (searching in T-SQL and ASP code, server jobs), so I ...
0
votes
1answer
232 views

AlwaysOn - Availability Group Listener in a multi-subnet cluster

I'm running into some difficulty getting the AG Listener created for a 3 node cluster where node 3 is on a separate subnet. I'm encountering an error that states Create failed for Availability Group ...
2
votes
0answers
46 views

SQL Server migration from 2005/2008 to 2012 [duplicate]

We need to upgrade two SQL Servers for our projects to SQL Server 2012. Since we’re not db-admins or familiar with such migrations, I wanted to ask you if you could tell me what we have to be aware of ...
1
vote
1answer
46 views

Measuring DB time of application using SQL Server Profiler

I have an application residing on the same host as a SQL Server database. There is a scenario in which this application is slow and due to co-existence of IIS and SQL Server, I cannot get which one ...
0
votes
1answer
58 views

Using CREATE TYPE within Stored Procedure Call

I have a SQL Server 2012 database, and I generally use stored procedures that belong to a role with grant execute permission. I just created a stored procedure (sp1) that calls another stored ...
2
votes
2answers
45 views

SQL Insert Statement Persists Two Records When I Need Just One

I have altered it to include hardcoded variables when I pulled this chunk of code from the stored procedure. I ran it independent of the application with the same result. I need one insert statement ...
0
votes
1answer
34 views

SQL Insert Statement Persists Two Records When I Need Just One [duplicate]

I have altered it to include hardcoded variables when I pulled this chunk of code from the stored procedure. I ran it independent of the application with the same result. I need one insert statement ...
3
votes
1answer
1k views

Set simple recovery mode and shrink log files for all user created databases

I hope you can point me in the right direction. I'm not a frequent user of T-SQL, but I did some googleing, and found the script below. I corrected the script a bit. I want the script to: To select ...
1
vote
1answer
86 views

sql server service broker

For the last few days the service broker command which run from master database is consuming much more RESOURCES than before. The Impact on the Database is high (from the bad side), It causes for ...
-1
votes
1answer
42 views

SQL Server Agent 2012 Job Schedule Report [closed]

I am looking for a report that will display graphically what jobs are scheduled on the server and when. My goal is to very quickly be able to glance at it and find a time where a new job will not ...
5
votes
1answer
1k views

Error running Powershell Script in SQL Server Agent

I have a SQL job that runs via SQL Server Agent (Running SQL Server 2012 Enterprise). The last step of the job is to run an application located on a network share. Unfortunately I don't know the name ...
3
votes
2answers
525 views

Which of the following pieces of SQL is most efficient

I need to add the date part of GetDate() to the time part of a stored DateTime. Naively I thought I could do the following: declare @testTime DateTime = '2013-04-23 13:55:06' select cast(getdate() ...
1
vote
1answer
88 views

SQL Server 2012 Install error “The instance selected for installation is already installed and clustered on computer…”

I am trying to setup a new environment for SQL Server 2012 AlwaysOn. I inadvertently used some SQL Server 2008 config files initially to do the installs but ran into too many problems. I un-installed ...
0
votes
1answer
62 views

Search NVARCHAR(MAX) string in other string

I want to find the index of a string in other string. I try to use CHARINDEX and PATINDEX but nothing worked because the search string is NVARCHAR(MAX) and these functions are limited to 8000 chars ...
2
votes
3answers
3k views

Simple model database transaction log full 'CHECKPOINT'

I have a SQL Server 2012 SP1 database which has a problem that the transaction log is full. It consists of a single data file and a single log file, both about 800MB. I had 5GB free disk space, and ...
3
votes
1answer
105 views

How do I login to SQL Server via group membership in another domain

When attempting to connect to SQL Server (2012), I get a login failed error message. The error log on the server reports: Logon Error: 18456, Severity: 14, State: 5. Logon Login failed ...
3
votes
2answers
114 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 ...
1
vote
1answer
38 views

Dividing data from one table to multiple storage

I have the following tables: [Table_A] [Table_A_Changes] The two tables are pretty large (more then 50GBs). The first one contains some data, and the second one records' changes.The database is in ...
5
votes
1answer
104 views

.WRITE clause performance optimization

I have found that you can do high performance updates on varchar(max),nvarchar(max),varbinary(max) columns using the .WRITE clause(example here and here). Unfortunately, there is nothing mentioned ...
0
votes
2answers
61 views

Live Partial Table / column replication

I want to know if there is a way to achieve the following with SQL Server 2012 Enterprise Edition? I have Table A: on Server 1 with say 10 columns. Table A: | col1 | col2 | col3 | coln | col10 | ...
6
votes
1answer
161 views

Does tempDB disk perf matter if you have plenty of unused memory?

We have a SQL Server 2012 Enterprise setup with a large amount of RAM (256 GB), and at this time fairly small databases (about 17GB). Right now we are experiencing performance issues due to various ...
2
votes
0answers
61 views

SQL Server, Mount Points and File Groups design [closed]

I am looking for some advice on a data warehouse we are building. Specifically around SQL Server, mount points and file groups. We have two design options for how mount points and files groups should ...
4
votes
2answers
3k views

Directory lookup failed when adding sample database to SQL Server 2012

I am trying to add the AdventureWorks sample database to SQL Server 2012, but I get an error message: Msg 5133, Level 16, State 1, Line 1 Directory lookup for the file "C:\Users\A\Documents\SQL ...
0
votes
1answer
53 views

[sys].[dm_db_index_usage_stats] returns more entries in some databases

I am using the following query to get some indexes usage statistics: SELECT DB.[name] ,OBJECT_NAME(IDX.[object_id]) AS [Table] ,IDX.[name] AS [Index] ,US.[user_seeks] ...
16
votes
1answer
6k views

Connection pools being reset with Error: 18056, Severity: 20, State: 46. & Perfmon Counters not showing

We are using SQL authentication & .net 4.0 Connection strings to connect to an Enterprise Edition 2012 SP1 SQL Server on a windows 2008r2 Enterprise Server. We use about 50 Servers split into 8 ...
7
votes
1answer
583 views

Detecting the locked table or row in SQL Server

I'm trying to understand/learn how to track down the details of a blocked session. So I created the following setup: create table foo (id integer not null primary key, some_data varchar(20)); ...
16
votes
6answers
8k views

What is a good, repeatable way to calculate MAXDOP on SQL Server?

When setting up a new SQL Server 2012, I use the following code to determine a good starting point for the MAXDOP setting: /* This will recommend a MAXDOP setting appropriate for your machine's ...
1
vote
1answer
61 views

The query processor could not produce a query plan

I'm getting this message: Msg 8624, Level 16, State 17, Line 1 Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support ...
1
vote
1answer
33 views

Viewing how much transaction log is used in Simple Recovery Model

We have a DW database in Simple Recovery Model. Every night, we load in data from different sources and run a few procs. I'd like to see how much the transaction log is actually used during this ...
0
votes
1answer
63 views

Unable to copy a DB from SQL Server 2000 to SQL Server 2012 using copy wizard

I am trying to copy a database from SQL Server 2000 to SQL Server 2012 using copy wizard in my local machine where SQL Server 2012 is installed. But, the wizard is not detecting destination server. ...
1
vote
1answer
43 views

Difference in architecture between SQL Server 2005 and SQL Server 2012 [closed]

I've been asked to identify the architecture differences between Microsoft SQL Server 2005 and 2012. I've been pointed out to http://technet.microsoft.com/en-us/library/bb545450.aspx but I haven't ...
1
vote
2answers
177 views

Should these two indexes suggested by the SSMS missing index feature be combined?

I'm trying to improve the performance of a specific query that is automatically generated by Entity Framework. I have run the query through SSMS, and it has suggested creating two missing indexes. ...
2
votes
1answer
41 views

Defining a column as nullable in a view (but not in the referenced table)

My company is working on implementing a new HR application that will unify our existing HR processes. We've run into a bit of a sticking point, though; according to business rules, the EmployeeID and ...
4
votes
2answers
111 views

Quickly restore test/QA SQL Server database

My company is releasing new mission critical software. For thorough QA, we are doing database comparisons. Our process is: Restore full backup. Test code. Compare. Repeat. This database is ...
1
vote
3answers
121 views

Restoring SQL Server database with CDC

I want to perform a database restore on SQL Server 2012 and copy the database to a different server. CDC is enabled on the original database. I have managed to copy the database along with the CDC ...
0
votes
1answer
184 views

Procedure with Insert Data From One Table to Another Table

I have two tables Person with PersonId, Name,Address,Mobile and PersonLog with Id,Name,Address,Mobile,FK_PersonId. I am trying store the old data in PersonLog and Person to be updated. This is my ...
0
votes
2answers
638 views

SQL Server 2012 linked server to SQL Server 2000

I am trying to select through an linked server from SQL Server 2012 to SQL Server 2000. The linked server has been setup and I can browser the target database through the linked server which ...
0
votes
0answers
28 views

sql server linked server does not consider indexes [closed]

We have a query with a join between two tables. The first is in the database and the second is in another listener, connected by a linked server. I am executing this query in SQL Management Studio ...
3
votes
2answers
238 views

Keep getting message: Failed allocate pages: FAIL_PAGE_ALLOCATION 540

I'd appreciate some help with the following: I've done some Googling, but haven't managed to resolve this one. I keep receiving a message in the SQL Log 'Failed allocate pages: FAIL_PAGE_ALLOCATION ...
7
votes
1answer
143 views

T-SQL - OPTION (FAST x) and trace flag 8722

I have searched a long time and still haven't found the answer to my problem. Our Dynamics AX is generating queries with the query hint OPTION (FAST x), which sometimes forces a bad execution plan to ...
0
votes
0answers
105 views

Column encryption/decryption using encryptbykey

Working on a project where I need to encrypt a few sensitive columns in a table but make the data available through a procedure that a user can execute through either a report or excel. In looking ...
1
vote
1answer
57 views

Pre-production database replication solution

I would like to start by specifying I am no DBA and have basic understanding of advanced DB concepts. I am trying to find the optimal solution to replicate our production database to our ...
0
votes
0answers
42 views

SQL Server 2012 Replication Subsystem Increase Number of Working Threads

I am trying to create Transaction Replication (Push) between two servers, using a distribution database on a3rd server. Server 1 is SQL Server 2008, Server 2 is SQL Server 2012. The Distribution ...
4
votes
2answers
9k views

Can I install SQL Server 2012 on a machine with 2008 R2 already?

I have been using SQL Server 2008 R2 for quite a while, and it is working great. Now I need to use SQL Server 2012. Will this effect my existing databases? How much risk is involved in installing SQL ...
0
votes
0answers
23 views

What are the best practises for locking down an SQL Server Instance Data/Log directories?

We have our own on SQL Server instance on a client's system. Other vendors also have instances on there. In order to prevent access to our data we are limiting the user access to our data using ...
0
votes
1answer
23 views

Altering table on SQL Server 2012 AON High Availability Databases [duplicate]

In a production site, the current configuration I am using is three SQL Server 2012 servers, with some databases configured with AON High Availability. I understand that between the AON High ...
0
votes
1answer
53 views

Why do my backup policies fail when a database's guest user is disabled?

I'm attempting to implement Policy Based Management on a SQL Server 2012 instance also acting as a Central Management Server using the Enterprise Policy Management Framework. The job running the ...
2
votes
1answer
43 views

Create failed for Availability Group 'AGN'

I tried creating availability group (AOH) many times but no luck , It got failed every time. Please help me on this case. I configured Windows cluster (Name as 'WINCLUSTER') with two nodes. They are ...
0
votes
0answers
76 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 ...
2
votes
2answers
1k views

db_owner unable to drop database - Error 615, SQL Server

I have a SQL Server 2012 database running on amazon EC2. I've created a user to be able to create, edit and drop databases. I gave the new user with dbcreator server role. My user can connect ...