SQL Server 2012 (major build version 11.00.xxxx). Please also tag sql-server.

learn more… | top users | synonyms (3)

0
votes
0answers
3 views

Database migration from SQL2005 to SQL 2012. SQL groups Creation with Securables

I moved 7 databases to MS SQL server 2005 to MS SQLserver 2012. Both SQl are on different servers. I copied window level user group and created SQL server level groups in SQL server 2012. Now my ...
0
votes
1answer
14 views

Error When Trying to Run Subquery

I am having issues getting my subquery to run properly. Everything runs quickly and correctly until I add the subquery. I get the error: "Msg 4145, Level 15, State 1, Line 66 An expression of ...
3
votes
1answer
93 views

Help with SQL SERVER 2012 Licence

I am planning to buy SQL Server 2012 for development and I have gone crazy with Microsofts complicated licencing policies.I had been searching the internet for valid answers from last few days and ...
3
votes
1answer
2k views

Removing secondary replica from SQL Availability Group causes 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
2answers
20 views

Capitalize only the first letter of a name

I have a table Vendors that contains a column VendorContactFname, which is written in lowercase. I want to capitalize only its first letter. I am thinking of concatenating an Upper on the first ...
2
votes
1answer
22 views

Relating 2 tables with possible wildcards?

I am having trouble getting the desired results when trying to relate the following tables. NULL in the following table essentially means that if it is not an exact match with another row then choose ...
4
votes
1answer
221 views

Partition by ascending and descending performance

I have a table, and for a given set of fields a, b and c, I need to get the first and last rows ordered by d and e, and am using ROW_NUMBER to get these rows. The relevant part of the statement is... ...
2
votes
1answer
177 views

SQL Server 2012 - Dropping Snapshots takes hours

We recently did a SQL Server upgrade from 2005 to 2012. We have a nightly job that drops a snapshot of an active database. The snapshots gets created again later in the day. Before upgrading, in SQL ...
1
vote
0answers
47 views

To find SQL Server is actually used or not?

I have an SQL Server 2012 and a 2008R2 running in my environment. I need to decommission the server if the server is not actually being used. I did go through this and this where connection count is ...
1
vote
1answer
42 views

Unable to set user/group as principal on a proxy

I'm organizing permissions on our SQL Server instance. I want to stop using a SQL Server account, and instead grant permissions to Active Directory groups, and then add user and service accounts to ...
0
votes
1answer
27 views

Restore a database with compression on a non-enterprise edition SQL Server

Is it possible to restore a compressed an object from backup without the Enterprise Edition? I'm getting the following error after a RESTORE DATABASE operation. Msg 3013, Level 16, State 1, Line 2 ...
0
votes
1answer
41 views

Same query same data different server different query plan

I have a query that hits a view, which references other views etc...several levels down. The query plan is a bit complex. I run the query on 2 different servers. On both servers, the number of rows ...
0
votes
0answers
15 views

Errror in Ag VALIDATE SHARED LOCATION

i Have this error when i create new AG Database Do any one have experience with this issue note: share network location not share in WSFC it's on another server all node and sql Services users ...
0
votes
1answer
28 views

Returning only the row with maximum value from related rows

In the example below how do I get the rows where the swap id is the maximum value in relation to the reservationId? I am currently joining multiple tables to get customer, reservation, room etc ...
5
votes
2answers
79 views

What sort of exec requests don't have a sql handle? (sys.dm_exec_requests)

I have crafted a query against SQL Server 2012 that looks like the following: SELECT r.session_id, r.sql_handle, t.text -- more details excluded for brevity FROM sys.dm_exec_requests r CROSS APPLY ...
0
votes
0answers
6 views

How can I import data from a NetCDF file into SQL Server?

I'm being asked to investigate the feasibility of importing data from a NetCDF file into SQL server. The file could be upwards of 300-400Mb and provided 4 times a day. However I'm only interested in ...
12
votes
11answers
14k views

Sql Server Management Studio slow opening new windows

After upgrading both sql server and management studio from 2008 to 2012, the management studio 2012 is very slow when new query windows and dialog boxes are opened. Even right click on tables is slow. ...
6
votes
2answers
150 views

Does table size matter?

I have a table like this (with more columns though): CREATE TABLE [dbo].[MyTable]( [SnapKey] [int] NOT NULL, [SnapDt] [smalldatetime] NOT NULL, [Company] [varchar](4) NOT NULL, ...
0
votes
1answer
27 views

sql server 2012 Express bulk-insert fialed due to message Operating system error code 5(Access is denied.)

I used my personal laptop computer (Samsung RV520) OS: Windows 7 home premium (x64 bit) SQL Server 2012 Express version 11 I encountered an error when execut the code below. error message: Msg ...
2
votes
1answer
61 views

Why is Include Actual Execution Plan not included in @@Rowcount when it produces a row count?

While updating a column in a table the last day I was shown a new technique by our Senior DBA to reduce reads and contention. The pseudo-code is WHILE [always true condition] BEGIN UPDATE ...
4
votes
2answers
363 views

Outer self join filters vs subqueries

I have a table storing information about tickets. There is one record when ticket is sold and another when ticket is used. There is a column called TransType which is set to either 'sold' or 'used' ...
6
votes
3answers
214 views

Execution Plan is NOT using INDEX and uses Table Scan

I know when it comes to using an index or a table scan, SQL Server uses statistics to see which one is better. I have a table with 20 million rows. I have an index on (SnapshotKey, Measure) and this ...
10
votes
3answers
317 views

Is total_elapsed_time in DMV sys.dm_exec_requests completely inaccurate?

I am running SQL Server 2012 and am trying to put some queries together for monitoring using the DMVs. However, when looking at the total_elapsed_time field in the sys.dm_exec_requests DMV, the ...
0
votes
0answers
13 views

Log shipping restore: Only members of the sysadmin fixed server role can perform this operation

On my secondary, I am seeing many messages like these in sysjobhistory from the LSCopy and LSRestore jobs for each database: Could not log history/error ...
0
votes
0answers
1k views

tsql to find out sql server alias

Using TSQL, is there any way to find out SQL server alias configured at configuration manager? Such as follows? Thanks!
0
votes
0answers
29 views

Move/ Migrate SQL Server 2012 Virtual machine (Win 2012) to new Physical host [closed]

There are virtual sql servers on d/f physical hosts and I want to know what is the recommended way to move them to One physical host (Hyper-V) running multiple VM's in one data center and have same ...
7
votes
1answer
202 views

Low PLE on NUMA node 000, high on 001

I'm looking at PLE (Page Life Expectancy) across NUMA nodes on our SQL Servers, and came across a rather weird distribution. NUMA node 000 has a very low PLE compared to 001. I'm unsure why this is. ...
0
votes
0answers
54 views

SQL Server data file growing

We have an odd situation happening with one of our tables in our database and I am hoping someone can shed some light on it. This table has 3 columns id(bigint), ...
2
votes
1answer
2k views

SQL Server Audit Specification - filter DML by all but one user

I'm setting up a database audit. I'd like to capture any DML change that is issued by database user other than the service account related to the application. In short, this is to prove to our ...
0
votes
0answers
28 views

I do not see much performance between implicit & explicit transactions

DBCC SQLPERF('sys.dm_os_wait_stats', CLEAR); IF OBJECT_ID('tempdb..#wait') IS NOT NULL DROP TABLE #wait GO /************************************* ** Create a test database ...
0
votes
0answers
9 views

Workload Capture

Hopefully this is a straight forward question. But if I want to capture a workload then all I need to capture are: RPC:Completed SQL:BatchCompleted I don't need to capture SP:StmtCompleted do I, ...
1
vote
1answer
20 views

Accessing file share from ETL package in SQL Always-On configuration

How can I access the file share from ETL? Here are my environment details: I have 2 nodes in a windows cluster. node 01 and node 02 SQL Server 2014 is installed on both the nodes. Both are Windows ...
2
votes
1answer
117 views

What is the best way to import this non-standard text file into SQL Server?

I have a text file that is generated daily. It is a fixed width format with one frustrating exception. The third column (NAME) has a variable width. The column is always exactly as long as the longest ...
1
vote
1answer
609 views

Report Builder cannot publish to report server

This is currently in a cloud lab environment. We're not allowed to join any AD domains. We have a linux server (RHEL 6) running MySQL 5.3 and a Windows SQL Server 2012 on Win 2k8 R2. Our laptop is ...
6
votes
1answer
82 views

SQL Server Edition for MS 70-463

I just started the MS 70-463 Implementation of warehouse, on the video course the tutor is directing towards SQL Server 2012 Evaluation Edition, but I have already have a SQL Server 2012 Express. Can ...
3
votes
1answer
23 views

After processing complete, SSAS DB slowly consumes all available space on disk, w. high memory use also

This problem is with an SSAS 2012 SP3 (11.0.6020.0) multi-dimensional server, hosting a single cube database, containing 1 cube and 16 dimensions. Aggregations have been designed using SQL Management ...
1
vote
2answers
57 views

Can I access the file stream shared folder using Listeners in case of AlwaysOn cluster environment?

One of the most effective ways to extend your SQL Server Integration Services (SSIS) control flow is to use a Script task to write custom code that perform tasks you cannot perform with the built-in ...
1
vote
2answers
177 views

Error when restoring SQL Server 2008 R2 backup on 2012

I am trying to restore a .bak file (backup taken on SQL Server 2008 R2, compatibility level 100). I am restoring the backup on SQL Server 2012 edition. I get the below error. Unfortunately the ...
0
votes
1answer
30 views

Sql service account password change for environment on Availability groups 2012

My current environment is on Availability groups sql 2012 with 1 Synchronous and 1 Asynchronous replica. Soon we need to change the sql service account passwords. Can any one suggest to me do I need ...
0
votes
1answer
49 views

Duplicates when checking for two different column values based on a key that is not unique in table

I want to check to see if two orders were placed for one person within an hour of one another. Example data PERSONID | proc_code | TIME 123 | 1 | 4/25/2016 00:01:00 123 | 2 | 4/25/2016 00:01:00 123 ...
0
votes
0answers
23 views

Unable to Remove Filestream Filegroup and Associated Database File

I had 5 FileTables which I have since converted to regular tables with varbinary(max) columns instead, migrated all the data from the filetables to the new tables and dropped the filetables ...
2
votes
1answer
825 views

SQLNCLI10.x vs 11.x when connecting SSIS 2008R2 to a SQL Server 2012 database

Starting from the question and working backwards. My question: is it OK to use SQLNCLI10.1 as a provider for SSIS 2008 R2 to connect to SQL Server 2012 database(s)? I have a SSIS box running SQL ...
0
votes
2answers
53 views

How can I return top 10 rows from each state [duplicate]

How can I return the top 10 rows for each category? Say I have a table named xyz. It has a column called state, in the political unit sense of the word. I want the top 10 rows from each state. Do I ...
0
votes
1answer
195 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 ...
1
vote
2answers
46 views

Database logging optimization and maintenance in SQL Server

One of the Web applications I am working on, uses NLog to log debug and error context information in the database. Basically, it performs a moderate number of inserts (I appreciate some tens of ...
1
vote
0answers
41 views

Having 2 identities in a table

I need to have some how 2 identity columns in one table. One that is normal identity and another one that will reset yearly. I have done the reset part with the help of DBCC CHECKIDENT ('TestTable', ...
0
votes
3answers
47 views

Backup Error with Msg 3201, Level 16, State 1, Line 1 & Operating system error 3

When i am taking the backup in network share drive with mention below TSQL. Use DatabaseName Go Backup Database DatabaseName To Disk=N'H:\DatabaseBackup\DatabaseName.bak'; Go I am getting the ...
0
votes
0answers
33 views

Log Shipping Backup Job Stuck at In Progress for several days

I have a SQL 2012 server with Log Shipping for 6 databases to a secondary server on the same network, however when checking SQL Agent for the backup job this is still at In Progress for all 6 ...
5
votes
3answers
4k 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 ...
2
votes
1answer
235 views

Adding a distributor for availability groups

According to this MSDN article, I need to add a distributor: Configure Replication for AlwaysOn Availability Groups (SQL Server) I'm confused by this particular statement: The distributor should ...