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

learn more… | top users | synonyms (2)

8
votes
1answer
659 views

SSIS 2012 Create environment variable fails

I'm working a script to port an Environment from one server to another. I am running into an issue calling catalog.create_environment_variable wherein I get the error "The data type of the input value ...
8
votes
1answer
399 views

Restoring differential backup creates DEFUNCT log file?

Here is my problem. I'm trying to move a database to a new server via a full restore, then cutover with a quick differential backup/restore. I can do a full restore without a problem, but when ...
8
votes
1answer
1k views

Is SQL Server data compression categorically good for read-only databases?

Some literature on SQL Server data compression I read state that the write cost increases to about four times what would normally be required. It also seems to imply that this is the primary downside ...
8
votes
1answer
3k views

Upgrade SQL Server 2005 to SQL Server 2012

I have a test environment set up with the following: Virtual Machine (Hyper-V) Windows Server 2008 R2 SP1(x64-bit) Windows SQL Server 2005 Developer Edition SP4 (x64-bit)(default instance name) 1 ...
8
votes
1answer
960 views

SQL Server's READ COMMITTED SNAPSHOT vs SNAPSHOT

I was researching the differences between SQL Server's READ COMMITTED SNAPSHOT and SNAPSHOT isolation levels and came across the following resource: Choosing Row Versioning-based Isolation Levels ...
8
votes
2answers
577 views

Handling time zones in data mart/warehouse

We are starting to design the building blocks of a data mart/warehouse and we need to be able to support all time zones (our clients are from all over the world). From reading discussions online (and ...
8
votes
2answers
911 views

SQL Server database design for “archived but available” data

We have this large database (>1TB) that we intend to "shrink". The database revolves around one main entity, let's call it "Visit". For discussion, let's say it is a database for a medical practice. ...
7
votes
1answer
609 views

SSIS organization

I'm familiar with SSMS, but I've never used .net, c# or visual studio (been doing other things: Assembler, c, unix, vi, oracle, etc). I'm trying to figure out basic 2012 SSIS ETL (no BI or data ...
7
votes
1answer
1k views

Direct the OUTPUT of an UPDATE statement to a local variable

I would like to do this : DECLARE @Id INT; UPDATE Logins SET SomeField = 'some value' OUTPUT @Id = Id WHERE EmailAddress = @EmailAddress -- this is a parameter of the sproc Is this even ...
7
votes
3answers
1k views

SQL Server 2012 Standard Edition - multiple instances and memory utilization

If we have multiple instances of a SQL Server 2012 Standard Edition (which has a 64 GB memory limit) on one server which has 192 GBs of RAM, do both instances only have access to the first 64 GBs of ...
7
votes
2answers
545 views

Can Availability Groups replace transactional replication?

I've been looking at the new features of SQL Server 2012, and how it can help my current situation. Currently we're on SQL Server 2008 R2, and replicate two OLTP servers' databases to a single ...
7
votes
2answers
492 views

Do natural keys provide higher or lower performance in SQL Server than surrogate integer keys?

I'm a fan of surrogate keys. There is a risk my findings are confirmation biased. Many questions I've seen both here and at http://stackoverflow.com use natural keys instead of surrogate keys based ...
7
votes
2answers
1k views

How to flatten results of a table with two related “many” tables?

I've reorganized some tables in my database to be more flexible but I'm not really sure how to write the SQL to extract meaningful data from them. I have the following tables (somewhat abbreviated ...
7
votes
1answer
934 views

How does SQL Server generate a query execution plan that adds up to 6,000%? [duplicate]

Today I was on The Heap and was looking at a query plan for something I thought could be improved. However, it created something that shook my belief in the SQL Server query optimizer. Can I still ...
7
votes
2answers
2k views

How might a corrupt partition in TempDB result in DBCC CHECKDB reporting no issue?

One of our SQL Servers reported the following error recently: DATE/TIME: 2/25/2013 9:15:14 PM DESCRIPTION: No catalog entry found for partition ID 9079262474267394048 in database 2. The ...
7
votes
1answer
2k views

Can Availability Groups provide seamless failover (with no query failures)?

I have been testing the Availability Groups feature in SQL Server 2012 and am finding that there is approximately 15 seconds of down time when the primary server fails over to the secondary server. ...
7
votes
3answers
10k views

Upgrade process from SQL Server 2000 to SQL Server 2012

I have a SQL Server 2000 database that I would like to upgrade to SQL Server 2012 (running on a different server). I don't think there is a direct upgrade path, but if there is, what is it? My ...
7
votes
3answers
1k views

SQL Server 2012 Simple Recovery Model with LOG_BACKUP log_reuse_wait_desc

While I'm doing my own investigation, does anyone know why a database in SIMPLE recovery model has a LOG_BACKUP for the log_reuse_wait_desc? SQL Server 2012 SP1. No replication, no mirroring, no log ...
7
votes
1answer
211 views

Query plan cache bloated by ad-hoc queries, even with “Optimize for Ad-hoc Workloads”

I've been noticing what I thought to be unusual issues with our query plan cache, where the plans in the cache were never more than a day old. Through running the following query (courtesy of ...
7
votes
2answers
2k views

How do Availability Groups work with cheduled jobs and SSIS packages?

I have 2 SQL Servers set up with a database in an AlwaysOn Availability Group. I also have jobs set up which run against the database. During a failover how do I ensure the jobs will continue to run ...
7
votes
2answers
827 views

SQL Server 2012 Availability Group is it “AlwaysON”?

In a traditional SQL Server clustering when failover occurs, all client that are connected to SQL Server failover instance looses the connection and each client must reestablish a new connection to ...
7
votes
1answer
1k views

Do schema changes “break” SQL Server 2012 AlwaysOn or are they handled transparently?

My organization is planning to adopt SQL Server 2012 AlwaysOn and I am trying to understand what impact (if any) it will have on our application upgrade process. We release application updates on an ...
7
votes
2answers
679 views

Is a geographically distributed application with SQL Server replication a good idea?

We are currently thinking about a target architecture for a geographically distributed application. This application tracks and schedules the movements of all material units across various production ...
7
votes
1answer
172 views

Dynamic Dimension Security

I have a cube in SSAS 2012 with about 30 dimensions, one of which is Company. The Company dimension contains a list of companies, of which there are several hundred in the cube. Our security model ...
7
votes
1answer
550 views

selecting more fields causes catastrophic failure

I have a connection to a linked server from sql server 2012 to pervasive sql. When I do select field1, field2, field3 from mytable everything works! However, when I do select field1, field2, field3, ...
7
votes
2answers
8k views

Downgrading SQL Server 2012 to Lower Edition

I have a Win2008 R2 server with an enterprise edition of SQL Server 2012 installed. Because my production server is going to be standard edition, is there a way to downgrade editions from enterprise ...
7
votes
2answers
346 views

SQL Server performance: PREEMPTIVE_OS_DELETESECURITYCONTEXT dominant wait type

I received a call yesterday from a customer who was complaining about high CPU usage on their SQL Server. We're using SQL Server 2012 64 bit SE. Server is running Windows Server 2008 R2 Standard, 2.20 ...
6
votes
2answers
3k views

What is the fastest way to insert large numbers of rows?

I have a database where I load files into a staging table, from this staging table i have 1-2 joins to resolve some foreign keys and then insert this rows into the final table (which has one partition ...
6
votes
3answers
3k views

Restrict update on certain columns. Only allow stored procedure to update those columns

I have sensitive price columns that I would like to have updated only through a stored procedure. I would like all code or manual attempts to alter values in these price columns to fail if it is not ...
6
votes
2answers
1k views

Is there a better option than Union All for multiple selects from the same row?

Example Schema: CREATE TABLE [dbo].[Base]( [ID] [int] IDENTITY(1,1) NOT NULL, [Option1ID] [int] NULL, [Option2ID] [int] NULL, [Option3ID] [int] NULL, [Option1Name] [varchar] NULL, [Option2Name] ...
6
votes
1answer
1k views

How do you move a SQL Server 7 database to SQL Server 2012?

I would like to move a database from SQL Server 7.0 to SQL Server 2012. They are not compatible for a backup and restore. Is there a way to export from SQL Server 7.0 and import it to 2012? I only ...
6
votes
1answer
679 views

Guarantee SQL Server Identity Columns that two consecutive values differ by constant increments?

I posed a question about Denali sequences here and another question about emulation of identity columns in Oracle Global Tables here. I always thought that I could trust that identity values ...
6
votes
2answers
7k views

Visio 2010 and SQL 2012 - Reverse Enginnering

We have upgraded to SQL 2012 and Am trying to reverse engineer our Dbs into Visio 2010. I setup a connecting using SQL 11 driver and Visio complains that that driver is not supported. Any one run ...
6
votes
3answers
3k views

Not able to install any piece of SQL server 2012 dev edition on my windows 7

I have tried everything i can think f to install SQL 2012 but no luck I am getting these errors but after looking through the logs I can't find the actual cause to get a solution. every feature gives ...
6
votes
2answers
3k views

How best to maintain SQL log file sizes

I'm somewhat of a new DBA and I'm managing a SQL Server 2012 instance that has a fair amount of activity. I'm running in Full Recovery mode because we need point in time recovery. Right now, I'm ...
6
votes
2answers
239 views

Does the order of columns in a columnstore index matter?

I have a table with ~200 million rows and ~15 columns in it. I am planning to create a COLUMNSTORE index on my table. Will there be any change in performance based on the order of columns that I use ...
6
votes
2answers
795 views

case versus isnull versus coalesce

I am just reading through the documentation for the SQL Server 2012 exams and I saw the following point: case versus isnull versus coalesce Now, I know HOW to use each one but I don't know WHEN ...
6
votes
1answer
465 views

DBCC TRACEON (652) does not disable read ahead reads

Refering to this StackOverflow question: http://stackoverflow.com/questions/13307485/sql-server-clearing-cache-has-no-effect-on-io-stats I used the trace flag 652 which had, at the time disabled the ...
6
votes
1answer
10k views

SQL Server 2012 performance v SQL Server 2008 R2

Does anyone have any links to performance benchmarking of the database engine, or any anecdotal reports of the performance improvements in SQL Server 2012. We are only using the DB engine,not ...
6
votes
3answers
691 views

Get transactions that failed or were never committed

Is there anywhere I can look to find failed transactions in SQL server 2012?
6
votes
2answers
4k views

Create database role to allow read access to all tables; write access to some

We have a database with over 1000 tables. I need to create a role that allows read only on all tables, as well as write access to two specific tables. I was messing around with database roles, but ...
6
votes
2answers
2k views

Relating ExecutionInstanceGUID to the SSISDB

The 2012 release of SQL Server Integration Services, SSIS, has delivered an SSISDB catalog which tracks the operations of packages (among other things). The default package execution for solutions ...
6
votes
2answers
247 views

Few Questions about SSAS Cubes

I am newbie to SSAS 2012 and here are my questions: Can we have measures of complex types (table)? Is it possible to order the results by a specific measure or attribute? My cube can be modeled as ...
6
votes
2answers
2k views

Permission required to view a database diagram

I have recently set up SSDT for our developers to use. We enforce changes to our dev databases are made through SSDT by limiting the permissions that each developers has when connected to the server ...
6
votes
3answers
2k views

Change data capture - how to know who made the change?

Tracking who made the change identified by CDC. Along the lines of my datetime hack I tried the same approach by adding suser_sname as a new field with default value on the cdc change track table. ...
6
votes
1answer
2k views

Timeout expired error while using copy database wizard

Microsoft made me believe that SQL Server 2012 Copy Database Wizard is the most optimal way of copying a SQL Server 2000 database to SQL Server 2012. After struggling a few hours, I was able to get ...
6
votes
1answer
572 views

How accurate is the sys.partition.rows column?

The system view sys.partitions has a column "rows" that is the total number of rows in a given partition. For a table that is not partitioned (or only has one partition depending on how you look at ...
6
votes
1answer
135 views

Ok to drop indexes on FK's if they have no stats in the DMVS

I have used the well known query below from Kevin Kline to check for unused indexes. Several indexes created on Foreign keys returns no read stats, only writes. Are you 100% safe to drop these ...
6
votes
1answer
394 views

De-Cluster SQL Server 2012

Is there any way to 'de-cluster' an instance of SQL Server 2012 that was installed using the 'New SQL Server Cluster Installation' option? We are having issues with the failover portion of clustering ...
6
votes
2answers
2k views

sp_executesql with user defined table type not behaving correctly

Problem Is there a known issue with user defined table types as parameters to sp_executesql? Answer - no, I'm an idiot. Set up script This script creates one each of table, procedure and user ...