1
vote
1answer
39 views

Optimistic Paging and separate query for COUNT?

I am using SQL SERVER 2012 FETCH/OFFSET after searching a lot that this will give me the best performance. But for paging to work, I need a Total count. There are 2 ways to achieve this. 1) Paging ...
1
vote
1answer
49 views

SQL Server 2012 Compatibility

I'm converting some stuff over to be compatible with SQL Server 2012 and had a couple of questions. I'm taking out all of the sp_dboption commands and making them ALTER commands instead, but there ...
0
votes
0answers
57 views

How control 27 locations and 27 databases? [closed]

We have 27 locations and 27 databases (all are SQL Server 2012 R2) All of them are the same (same tables,views,...), with different data for each location and separated from each other (in each town) ...
1
vote
1answer
196 views

How can I create a Foreign Key to a Compound Primary Key with a single column?

I am working with a 'lookup' style table that is already in place, which has a compound primary key (not my design) in Microsoft SQL Server 2012. I want to add a foreign key to it in another table, ...
5
votes
3answers
198 views

SQL Performance issue after migration from SQL Server 2005 to SQL Server 2012

Yesterday we migrated a SQL Server 2005 database to SQL Server 2012. We made a full backup and restored it on the new server. Problem now is that the database on SQL Server 2012 is much slower than ...
0
votes
0answers
41 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
40 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 ...
1
vote
1answer
72 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 ...
3
votes
1answer
68 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 ...
2
votes
0answers
39 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 ...
1
vote
0answers
60 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, ...
0
votes
2answers
117 views

Recommendations for a SQL Server 2014 Database Administrators Course [closed]

I am after some personal recommendations for a SQL Server 2012 Database Administrators Course with exams. Exam 70-461: Querying Microsoft SQL Server 2014 Exam 70-462: Administering Microsoft SQL ...
2
votes
0answers
20 views

Setting up triggers based on exposed columns in a view's source table

I have a table where I want to do a AFTER UPDATE trigger if one of the columns modified was in a specific view CREATE VIEW [dbo].[iv_EmployeesView] AS SELECT EMPLOYEE_GUID AS EmployeeGuid, ...
2
votes
1answer
52 views

SQL Profiler - Insert values?

I setup an SQL profiler to run, but I am not seeing any values for updates/inserts. Is there a way to see them? All I see is stuff like this: insert into some_tbl(id, col1, col2, col3) values ( @P0 ...
0
votes
1answer
31 views

Full Transaction Log on closed source system

I have a closed source application which has the transaction log filling up on a daily basis to 60+gigs. I have ran a trace on the database and no inserts and updates are occurring. The following ...
20
votes
2answers
856 views

Why does query error with empty result set in SQL Server 2012?

When running the following queries in MS SQL Server 2012 the second query fails but not the first. Also, when run without the where clauses both queries will fail. I am at a loss why either would fail ...
2
votes
1answer
74 views

How to allow connections to SQL Server with 2 differents ip

I have a small issue here: I have a SQL Server instance 2012 (let's call it INSTANCE) on a cluster. I also have 2 network interfaces for this instance: SQLINSTANCE.my.metwork ...
1
vote
1answer
45 views

CDC not picking up changes [closed]

CDC has been set up for one of our databases in our test environment but it's not capturing any of the changes. I've made sure the capture job is running. I've disabled CDCs for the database, enabled ...
2
votes
1answer
89 views

How can I use running total aggregates in a query to output financial accumulations?

I am attempting to write a query that will be consumed by a SSRS 2012 report. Given a paid invoice, with a certain set of account allocations towards which the money paid towards it must be saved, I ...
0
votes
0answers
44 views

Linked Server for MultiSubnet AG Listener

How do I create a linked server for an AG Listener that is in a multi-subnet configuration? I have a couple clusters that need to be able to query the listener at hand but the node that is on the ...
5
votes
1answer
26 views

Why are zero length spaces being returned from a Union All against an empty table in SQL Server 2005 but not SQL Server 2012

Supporting an existing VB6 app with a SQL Server 2005 back end and we're migrating our database server to SQL Server 2012. Created a backup of the production database and restored it into a dev ...
0
votes
0answers
50 views

SQL Server Mirroring send/receive ack time not normal

I have a problem that arises during the performance test by microsoft team in my client. The report that is given to us provide information about whether or not a parameter is good based on the Object ...
2
votes
1answer
94 views

“No row was updated error” in SQL 2012 - worked fine in SQL 2005 and 2008

I have a database that currently lives in SQL Server 2005. We are currently looking at upgrading to SQL 2012. I installed 2012 in a test environment (Windows Server 2012 virtual machine). Backed ...
1
vote
0answers
41 views

Can not ping Always On listener from outside primary node

I just setup SQL Server 2012 (on Windows Server 2012) Always On feature and have a problem with connecting to SQL Server Listener from non-primary node (it works from primary node though). Here is ...
1
vote
1answer
75 views

System table missing in SQL Server 2012

I restored a SQL Server 2000 database to 2005 then to 2012. I am not able to see system tables that existed in SQL Server 2000 now. Can somebody please let me know what is the reason. Thank you
0
votes
2answers
110 views

Implications of changing compatibility mode in SQL Server from 100 to 110

I have a database Mydatabase created in SQL Server 2008 R2. I have upgraded to SQL Server 2012. I was trying to execute below query to calculate percentile select Distinct ...
3
votes
1answer
104 views

Downgrade database from SQL Server 2012 to 2008 [duplicate]

Hi guys got a problem with a database. I've been asked to perform some indexing and delete queries on a live database, so first of I wanted to get the database to our dev server so I can test out ...
5
votes
1answer
114 views

Disabling SET Statements / Forcing SET Options in SQL Server 2008R2/2012

I am currently working with a MSSQL 2008R2 Database which uses the following SET-Commands frequently: SET ANSI_NULLS { ON | OFF } SET QUOTED_IDENTIFIER { ON | OFF } SET ANSI_PADDING { ON | OFF } ...
2
votes
0answers
16 views

Disabling SET Statements / Forcing SET Options in SQL Server 2008R2/2012 [duplicate]

I am currently working with a SQL Server 2008 R2 database which uses the following SET commands frequently: SET ANSI_NULLS { ON | OFF } SET QUOTED_IDENTIFIER { ON | OFF } SET ANSI_PADDING { ON | OFF ...
1
vote
3answers
100 views

Creating a copy of primary database and attaching the copy database in the same sql instance

I just got into a project in which we have only one SQL Server 2012 copy. We have 12 databases attached to the primary instance of SQL Server 2012. As I don't have SQL Server 2012 or supporting OS, I ...
1
vote
2answers
80 views

Select all data group by 1 column and functioned by another

I have the following table in SQL Server 2012 : ID int priority int type int other data columns I want to query the table for the following result : grouped by 'type' get the id of top 1 max ...
0
votes
0answers
130 views

SQL Server 2012: Login failed for user. Reason: Failed to open the database configured in the login object

Every so often, my SQL Server 2012 throws the following errors: Error (likely related to the one below): Source: spid99 The client was unable to reuse a session with SPID 99, which had been ...
1
vote
1answer
57 views

Adding index in table suggestion?

I have a table called Products with ID(PK, Clustered), Name, Price, Brand, ...., RetailerID, SKU, ModelNumber. My query have SELECT .... FROM Products WHERE RetailerID = @RetailerID AND ( ...
1
vote
0answers
93 views

KPI Metrics Table Design [closed]

We are currently working on project to get KPI metrics from out account partners,We want to design a table and It will have 3 Major Business units 4 Business Verticals (Service Desk, Knowledge ...
3
votes
1answer
51 views

reset sql server to default?

Sorry in advance for the noob question. I am trying to learn to mirror a test database and in the course of doing this, was typing in some commands into a query box. While trying to create a ...
3
votes
1answer
84 views

Does MERGE updates when not needed?

In SQL Server 2012, Does a merge statement like this : WHEN MATCHED THEN update SET A.len = B.len updates a row even if A.len equals to B.len ? Or does the SQL SERVER knows to ignore this ...
2
votes
0answers
55 views

SQL Server 2012 Replication

Please help me out with a problem I am facing. I have a table T. I altered the table to alter the column C from varchar (10) to varchar (100). Now, there is a view V that is schema bound and selects ...
4
votes
1answer
265 views

Mirroring in SQL Server 2012

I have been trying to learn to do this. I've got newly installed Win 2008 R2 machines, in a workgroup, in the same subnet, and of course SQL Server 2012. I allowed login with SQL Server ...
1
vote
2answers
58 views

Recommended best practice for server naming [closed]

We're currently in the process of upgrading to SQL Server 2012, in the past all servers have been installed with a naming convention which contains a "-" in the middle i.e. TS-DBL01 I'm trying to ...
2
votes
0answers
241 views

Microsoft Sql Server 2012. 100 000 000 rows table select/insert performance [closed]

This is first time i am working with huge database ( 100 million rows in table Events). Use case here is to quickly select and insert x and y for selected Organisation and datetime. My database ...
8
votes
1answer
213 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 ...
0
votes
1answer
93 views

Issues installing SQL Server 2012 [closed]

I am trying to install SQL Server 2012. During the install I get an error saying Error installing SQL Server Database Engine Services Instance Features A network-related or instance-specific ...
1
vote
0answers
87 views

Removing Secondary Replica from SQL Availability Group Causs Large Log File

Due to an unforeseen hardware error, I had to take our secondary replicas down for maintenance. This was really due to a storage issue and, it was decided at a higher level, to purchase a new storage ...
-1
votes
0answers
597 views

Errors trying to install SQL Server 2012 on Windows 7 [closed]

I am getting the above error message when i try to run the setup file. Microsoft SQL Server 2012 Service Pack 1 Setup The operating system on this computer does not meet the minimum ...
0
votes
1answer
163 views

SQL Server 2012 - The application has failed to start because its side-biy-side configuration is incorrect

When opening Sql Server Management Studio I'm getting the following error message: Then when I have a look at the Event Viewer the following message is displayed related to this: Activation ...
2
votes
0answers
24 views

optimizing a CTE Hierarchy [duplicate]

I have a table of accounts with a typical acct/parent account architecture to represent a hierarchy of accounts (SQL Server 2012). I created a VIEW using a CTE to hash out the hierarchy, and on the ...
1
vote
2answers
203 views

Cannot add an account [non domain account ] to SQL Server 2012

Background: I have a application pool [ABCDEMO] in IIS. The identity of the appool is "NetworkService". I am trying to add IIS APPPOOL\ABCDEMO to my SQL SERVER 2012 on a Windows SERVER 2012. When I ...
0
votes
0answers
44 views

All databases restoring in Suspect Mode in SQL Server 2012

I've just re-installed SQL Server 2012 (removed the evaluation copy and installed a licenced version) and now every database I try to restore, it fails to completely restore and the database sits in ...
0
votes
1answer
133 views

Setting Audit Events in SQL Server 2012

We have to do information assurance remediation on our SQL Server 2012 and came across the following finding: Check to see that all required events are being audited. So I ran these queries: select ...
0
votes
1answer
147 views

Not exists/Where NOT in

Doing a pie chart in crystal. Items are Inquiries Referrals Followups A referral has to have an inquiry, A followup has to have a referral. I want to show pie chart of referrals to ...