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

learn more… | top users | synonyms (2)

0
votes
0answers
44 views

Accidentally deleted records [duplicate]

I would like to know if it is possible to restore a deleted record directly from the transaction log without doing a DB restore to a test database to retrieve the deleted records? I could be wrong ...
1
vote
1answer
66 views

How to reinstall SQL Server Integration Services I've deinstalled from a Production server by mistake

In deinstalling a named instance of SQL Server 2012 from a Production server, inadvertantly, I selected SSIS as a product to deinstall. Now, I need to reinstall it with the least disruption possible. ...
1
vote
0answers
66 views

Bind web service/Report Manager based on IP address AND hostname

I'm trying to get Apache installed on our main database/application server, and I'd like to give it its own IP address on a secondary NIC so I don't have to use a nonstandard port. This requires that ...
4
votes
1answer
507 views

How do I delete unique rows from a table with duplicate keys?

I have the following data: road | ID | other column | other column | ------------------+------+---------------+--------------+ MAIN ST | 1 | ... | ...
3
votes
2answers
171 views

Differential databases (not backups)

When working with virtual machines often it can be very useful to have a base read-only VM then have several smaller VM's that use that larger VM as a base and write their changes to their own ...
0
votes
0answers
138 views

How can I get rid of the “No Join Predicate” warning

I have this fairly straight-forward snippet of a query: DECLARE @ClientGUID numeric(16) = 9000011916900200; SELECT ch.GUID, c.LastName, c.FirstName, mrn.ClientIDCode AS MRN FROM Client c INNER ...
1
vote
0answers
91 views

What type of fact table / loading solution for a reservation system?

I am designing a Data Warehouse with SQL Server 2012 and SSIS. The source system handles hotel reservations. The reservations are split between two tables, header and header line item. The ...
1
vote
2answers
2k views

What could cause an auto increment primary key to skip numbers?

I have a table created with the following T-SQL: CREATE TABLE [dbo].[TableName]( [id] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED ( [id] ASC )WITH (PAD_INDEX = OFF, ...
3
votes
2answers
270 views

Altering Multiple Tables

I have database with 170+ tables in mssql 2012. Some of them contain the field "UserID", varchar(9) while others do not. Due to an application redesign, I need to alter all tables in the database to ...
1
vote
1answer
49 views

Connecting to Active Active Cluster Services

I have a two node active active cluster setup as below: NODE 1 - SQLINST1 ( with DTC1 ) NODE 2 - SQLINST2 ( with DTC2 ) I wish to now have the application connect to SQLINST2 whenever ...
1
vote
2answers
1k views

Free up disk space on sql server

Assuming I have a sql database server with disk space as follows: D Drive: 10GB (For the MDF file) E Drive: 10GB (For the LDF file) And I have only one database on the server with the following ...
1
vote
1answer
1k views

How to connect client applications to SQL SERVER 2012 cluster?

Following are the environment Details : Database Server : SQL SERVER 2012 Operating System : Windows Server 2012 Single instance of SQL SERVER 2012 is installed in cluster configuration with 2 ...
2
votes
1answer
519 views

Database Backup from 2008 R2, Restore on 2012 Failover Cluster Instance

I have a production database server having sql server 2008r2. This is an old server and considering our load, we are moving to a better hardware configuration, Now the new environment is a cluster ...
1
vote
1answer
2k views

stored procedure with multiple statements does not execute all statements when run from job

** see updates below I have a stored procedure (SQL Server 2012) that deletes old records from a table, then inserts new records from a view to synchronize the table with the view. When I execute the ...
1
vote
1answer
279 views

How to aggregate pairs of id values into groups

I have a table with two id columns id1 and id2. Each row shows that 2 id values have been linked together. My actual data has both id columns as varchar(20) but I have used integers in the example ...
1
vote
1answer
105 views

Delayed availability of historical data when using CDC

I am using the SQL Change Data Capture feature to retrieve historical data from my tables. During testing, I noticed that when I insert/update a row and query the change data right afterwards (see my ...
0
votes
0answers
50 views

SQL Server consistency I/O base error

I have received this error while performing queries on a database (SQL Server 2012) msg 824, level 24, state 2, line 1 sql server detected a logical consistency-based i/o error. Incorrect page ID ...
1
vote
2answers
797 views

How to do partition on a non clustered index column?

I have table ORDERS .Where there are Million rows in it .I need to add Pationed Index on Order to store data in one of two files based on the new IsLocked field.But when i checked table there is a Non ...
1
vote
1answer
86 views

Difference between sql agent account logged in as NTLM and UPN?

Can someone please tell the difference between a sql agent account logged in as NTLM and UPN? What is the difference if the sql agent account is logged in as: domain\username and username@domain.com? ...
9
votes
1answer
669 views

Why would you use a managed service account rather than a virtual account in SQL Server 2012?

In SQL Server 2012, service accounts are created as virtual accounts (VAs), as described here, as opposed to managed service accounts (MSAs). The important differences I can see for these, based on ...
3
votes
2answers
100 views

SQL Server Master Data Services database history by snapshots

I'm involved in a project where there is SQL Server 2012 Master Data Services used. There's a requirement to save a version of the database contents in certain point of time, say, every month or a ...
0
votes
1answer
243 views

SQL Server sp_addrolemember in stored procedure for different database

I have a stored procedure to restore the latest backup of a prod database to an acceptance database. Once it's restored I need to grant a user read access to the database. Use statements are not ...
0
votes
4answers
103 views

T-SQL: Complete Database in one table

at a relational data model every logical relation is a single table with values and so on. I know someone who is this too much work and he wants to create only one table which contains all. This could ...
3
votes
1answer
217 views

SHOWPLAN does not display a warning but “Include Execution Plan” does for the same query

I was running the following query in SSMS and it showed me a warning in the "Include Execution Plan" window select CLIENT_GUID, PMT_AMOUNT, DATE_COMPLETED from ( select payment.CLIENT_GUID, ...
3
votes
1answer
595 views

AlwaysOn Availability Group Forced Failover

May I request your input. I setup SQL 2012 with always on availability group for my databases in sync and secondary readable mode. I completed failover tests with sync mode and it is functioning as ...
2
votes
1answer
1k views

SQL Server 2012: Security_error_ring_buffer_recorded: ImpersonateSecurityContext

a couple servers I manage are recording a lot of events in the system_health XE session. security_error_ring_buffer_recorded api_name ImpersonateSecurityContext calling_api_name ...
1
vote
0answers
81 views

How to take advantage of multiple spatial indices?

All, I'm building a view which uses a spatial intersect (STIntersect in MSSQL 2012) between points (student addresses with address information) and polygons (school boundary polygons with school ...
3
votes
1answer
134 views

Putting a condition related to a table in JOIN is better?

I have seen this a lot that people are putting table related condition on JOIN clause. See this example, SELECT i.Name FROM sys.TABLES AS tbl INNER JOIN sys.indexes AS i ON (i.index_id > 0 ...
23
votes
3answers
2k views

At what point does one database per client become unfeasible?

For one of our systems, we have sensitive client data and store each client's data in a separate database. We have about 10-15 clients for that system. However, we're developing a new system that ...
2
votes
0answers
223 views

Can I recover a single table from a SQL Server 2012 database backup [duplicate]

I have accidentally dropped a specific table and I don’t want to restore whole database (it is huge) but instead I want to recover only that table from a backup? What would be most simplest ...
4
votes
1answer
278 views

A clarification of MERGE best practices

I just wanted to ask a clarification about something on the MSDN from the "Optimizing MERGE Statement Performance" page. I am working with a data warehouse that takes in records from many different ...
2
votes
1answer
59 views

How can I automatically have a node become primary in an Availability Group?

In my environment, I have Db01 and Db02 setup with SQL 2012 AlwaysOn. Db01 is the preferred master as that is where all of the backup jobs reside. Typically, the only time that Db01 is unavailable is ...
2
votes
0answers
85 views

SQL Server 2012 High availability Groups for OLTP and Reporting environments

I would like to seek your advice in designing a high availability architecture at my current work place. We are moving to SQL Server 2012 platform and we currently have a set of OLTP databases ...
2
votes
0answers
31 views

TFS 2010 and SSMS2012

i was trying to use TFS 2010 in SSMS 2012 and, even if i installed Team Foundation Server MSSCCI Provider 2012 64-bit and Visual Studio 2010 Team Explorer, there's no way to see TFS under the Current ...
0
votes
1answer
364 views

Reporting Services TempDB lock blocking report generation

Two days ago one of our reports in Reporting Services started to take much longer to generate. Its generation time had increased from 4 seconds to 2 minutes. Investigation found: The Stored ...
1
vote
0answers
75 views

Efficient way to Add NON-CLUSTERED Index?

I have the following table, CREATE TABLE [dbo].[Products]( [ID] [int] IDENTITY(1,1) NOT NULL, [RetailerID] [int] NOT NULL, [Name] [nvarchar](255) NOT NULL, [Price] [float] NULL, ...
1
vote
1answer
4k views

How can I enable distributed transactions for a linked server?

I have a SQL Server 2012 instance with a linked server pointing to a db2 database on an IBM Iseries system using the System i Access ODBC Driver. I'm trying to enable distributed transactions. I ...
1
vote
1answer
1k views

Fetch large data from Sql Server and process in chunks

I am working on an API which would need to process large dataset. The query to select records is complex and takes time to complete. I cannot use the pagination using ROW_NUMBER as not all records ...
7
votes
2answers
404 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 ...
1
vote
1answer
614 views

copy/sync only data between 2 database with non identical table structure

I have the following issue and was wondering if someone knows if this is possible. We have a MS SQL Server 2012 Instance with 2 databases database A and database B. On Database A the data from 6 ...
3
votes
2answers
3k views

How to create a read-only server role on SQL Server 2012?

I am granting the "View any database" permission when creating a new server role, but realized this permission only allows the user to view the system databases. I am trying to create a server role ...
1
vote
1answer
144 views

Is indexing binary?

The scenario: When a user updates some information - the correct row must be found and updated. I'm debating between two options: Let the server search through all of the rows (-slow). But be ...
14
votes
2answers
540 views

Lock CREATE TABLE

In another application I was struck by bad design: multiple threads execute an EnsureDatabaseSchemaExists() method concurrently, which looks basically like this: IF NOT EXISTS (SELECT * FROM ...
2
votes
1answer
51 views

Update only the oldest entry in a table with foreign key criteria

I'm working on a forum website. What I am trying to do is updating the thread Title and Content (first post), which resides in different tables - "Threads" and "Posts". "Threads" "Posts" I'm ...
-4
votes
1answer
136 views

SQL Server 2012 Not matching Join Query

I have to generate a query output for not matching records. Assuming that i have two tables Table1 and Table2. Both Tables have the columns as DrugName. No Id column. Just the value column. I ...
1
vote
1answer
44 views

SQL Server generate self-signed SSL certs performance concern?

Read this msdn article and doesn't seem to say if it keeps using the same self-signed cert after one is automatically generated. If SQL Server generates a new SSL cert upon every connection (anyone ...
0
votes
2answers
105 views

SQL Server Date Conversion

On applying the where condition : WHERE DateFilled BETWEEN '02/01/2014' AND '02/28/2014' My syntax is not detecting the values which are filled on 02/28/2014. If I write the syntax as WHERE ...
2
votes
1answer
134 views

Zombie Sql Server DB on Secondary Replica is both in and out of an Availability Group

I have a database in Sql Server 2012 that is on the secondary replica of an availability group. I removed the database from the AG db list on the primary and the db is currently in the Restoring ...
3
votes
2answers
362 views

SQL Server Memory Issues

We have a SQL server that appears to be leaking memory. Memory consumption linearly increases over time until the server is completely out of memory, causing major performance issues. The SQL server ...
0
votes
1answer
124 views

How does the Distributor know you have seeded/initialized your Subscriber using a backup?

Im building my first transactional replication database for our Sharepoint team. The Publisher database is fairly large 330GB+ Because the Publisher database is in a different data center than the ...