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

learn more… | top users | synonyms (3)

1
vote
0answers
50 views

Long Transaction On File Upload Locks Strategies

I need to upload files to some SFTP or FTP servers (using libcurl) and register them in database. For this I have several tables -- locations to store files - some SFTP and FTP servers CREATE TABLE ...
4
votes
1answer
131 views

transaction across multiple databases - what is the overhead?

I run the following update, which is one single transaction across 2 databases. Please note I have not committed the transaction. --================================================================ --...
0
votes
1answer
61 views

Sql Server 2012 Failover Replica in Synchronous Mode between Primary-Secondary on VPN is very slow

I have installed SQL Server 2012 Clustered HA with Replica in Sync mode between two nodes connected by an high-speed VPN. The DB is encrypted. Everything works fine, but to do the replication, the HA ...
2
votes
1answer
142 views

Should you encrypt the system databases?

A finding from a STIG evaluation, CCE-19832-5 reports that the [master] database should be encrypted with a Database Master Key using an encrypted password that meets DoD standards. This a result of ...
5
votes
1answer
476 views

CDC system tables missing from backup

I am migrating a database that uses CDC from SQL Server 2008 R2 to SQL Server 2012. There are CDC-related tables under the "System Tables" branch in Object Explorer: cdc.ddl_history cdc....
0
votes
1answer
162 views

how to calculate the next time a job will run - by each schedule

I have a script that shows me when it is the next time a job(s) will run, and other things, the dates are formatted, etc. the script is here, and it works fine: USE msdb Go set transaction ...
1
vote
1answer
44 views

putting together contents of XML column - from all rows of a table - how to get it done without a “while”?

I have a table called sizeguide with the definition you can see below. I am interested in the SizeGuideXML column, which is type XML. I had a mission the objective was, for each SizeGuideDesc, get ...
9
votes
1answer
1k views

“truncate log on checkpoint” option in SQL Server

Long story but our long term consultants (former employees) wrote a custom script years back (2006 or so) to interface with Tivoli Storage Manager and it appears to be checking for a SQL Server DB ...
3
votes
1answer
162 views

Always fetch 3 records in a particular order

I have a query which gets 3 books (ABC1,ABC2,ABC3) and their details. I need them in a particular order for pivoting so I have a Row number column for the same. People read none/some/all books. Table:...
1
vote
0answers
94 views

how to minimize the effect of updating statistics on the plan cache?

The issue I am trying to address: After updating statistics there are slow downs in running many of our processes here. then following the scary dba on this link below: http://www.sqlservercentral....
0
votes
0answers
49 views

Recovered database files can't be attached

I have recovered my hard drive with my databases mdf and ldf files. When I want to attach them I get a 9004 error: Error: 9004, Severity: 21, State: 1. An error occurred while processing the log ...
9
votes
1answer
270 views

Recursive sql query performance issue [closed]

This is the sixth time I'm trying to ask this question and it's the shortest one too. All the previous attempts were resulting with something more similar to a blog post rather than the question ...
0
votes
0answers
496 views

Reporting Services Dataset - Login failed for user - SQL User

I have two SQL Server 2012 Development Edition machines setup for testing purposes. One is a reportserver and one is a database server. I've configured the report server such that it's database is on ...
7
votes
0answers
171 views

SQL Server 2012 Compatibility with New TLS 1.2 Standards [duplicate]

I'm trying to switch off TLS 1.0 on my SQL Server 2012 server in order to comply with PCI standards. Initially I had some trouble with the SQL Server service not starting. I found help for this ...
1
vote
1answer
105 views

dynamically creating query in a loop [closed]

I"m looping through a table trying to create a dynamic sql query. It appears to work fine except when I'm concatenating results to make the actual statement. Psudo code follows WHILE (Data is in the ...
6
votes
4answers
481 views

How can I Debug a Buffer Issue?

I have a production "Microsoft SQL Server 2012 (SP1) - 11.0.3128.0 (X64)" that is showing weird buffer and page life expectancy (PLE) symptoms. I am running this every minute on my server (to track ...
1
vote
1answer
506 views

The ALTER TABLE statement conflicted with the CHECK constraint

I need to check datecom is less than datelivr create table Commande ( Numcom int identity primary key, Datecom date, Datelivr date, Codecli int foreign key references clients (Codecli) ) alter ...
2
votes
2answers
72 views

Moving database from one server to another

I have a virtual machine running SQL Server 2012 in Azure and have also generated a script of my database to be run on the SQLSERVER2012 VM on Azure, however I am getting an error "C:\Program ...
0
votes
1answer
1k views

Cannot remotely connect to SQL Server 2012 on azure

I have a SQL Server instance running on a virtual machine in azure, I have tried to connect to it using the public virtual IP address however I get an error saying The server was not found or not ...
2
votes
1answer
224 views

SQL Server AG databases went into 'Synchronizing/In recovery' after upgrading to 2014

We have 3 replica AG setup: 2 replicas are in sync/automatic failover the other(DR Server, different subnet) in asynchronous/manual mode All these replicas were on SQL Server 2012. Recently we ...
1
vote
1answer
112 views

Permissions for sys.database_mirroring in SQL Server

I need to assign permission to use sys.database_mirroring and of course I want to give the minimum amount of privilege. When I looked at microsofts homepage it says: To see the row for a database ...
9
votes
1answer
2k views

Could a null column be part of a primary key?

I'm developing a SQL Server 2012 database and I have a question about a One-to-Zero-Or-One relationship. I have two tables, Codes and HelperCodes. A code could have zero or one helper code. This is ...
1
vote
1answer
436 views

Geo-clustering using SQL Server 2012 Enterprise with AlwaysOn

We are trying to take our current SQL 2012 Enterprise edition 3 node cluster (OS 2012) and add a 4th node to the cluster that will be at another location. And everything I find is telling me to use ...
0
votes
0answers
2k views

Oracle:Test connection failed because of an error in initializing provider. ORA-12170: TNS:Connect timeout occurred

We have Migrated SQL server 2008R2 to SQL server 2012 from Windows 2008R2 onto Windows 2012R2. Everything went well , except for the Oracle database connection: We have a SSIS package created on SQL ...
3
votes
1answer
94 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
54 views

Two Sequences on one column

You can use 1 or 2 sequence. Let's say I have a table tblOrder and 2 columns in it, OrderID and Company. I only use two companies in my table, IBM and Airtel. What I want is when Company = IBM then ...
5
votes
2answers
209 views

Buffer Size Changing?

I have a production database that is experiencing wildly fluctuating Page Life Expectancy (PLE) issues. (It crashes to zero at random times.) I have been researching the PLE issue and have found ...
2
votes
1answer
1k views

Why has my database connection failed?

Recently I have developed software using SQL Server 2012. Now when I try to connect, I get this error message: Cannot connect to AAFI\SQLEXPRESSA network-related or instance-specific error ...
1
vote
3answers
57 views

Need help with SQL Server configuration

I was planning to buy the SQL Server 2012 standard edition for developing reports and SSIS packages. My company does not have a client-server architecture and the developers are working on their ...
0
votes
0answers
51 views

SQL Server 2012 , TDE key rotation for a database in Availabilty groups

I need to do TDE Key Rotation for a database in availability groups in SQL Server 2012 for PCI Compliance. Need help please on procedure to follow .
0
votes
1answer
76 views

Need to maintain transational consistency of the data across both servers, need to achieve these goals without manual intervention

I got this question about MS SQL Server 2012 administration, two production servers in the same data center. You need to ensure that database remains available if a catastrophic server failure or a ...
1
vote
1answer
303 views

Issue with FMTONLY in SQL Server 2012

I support an application that uses CodeSmith and NetTiers templates to generate C# code. CodeSmith inspects the database and uses the SET FMTONLY ON setting to determine the columns for which code ...
1
vote
3answers
2k views

List all tables from all user databases

sys.tables lists all user tables from a single database, But it doesn't have their schema name. If I know existing databases when creating the code, I can use USE to browse all databases, query sys....
2
votes
0answers
73 views

SQL Server 2012 duplicate key error with Spatial index that shouldn't be unique

We have a table that has a geometry column that is filled by a stored procedure from two x and y values whenever they're changed ( SW_GEOMETRY = GEOMETRY::STGeomFromText('POINT('+ CONVERT(VARCHAR(50)...
0
votes
0answers
46 views

Manually overwrite data in replicated server

I'm not very familiar with SQL Server. I am using SQL Server 2012 Management Studio. I have two databases (one internal and one external). Our external DB has been hacked and I need to overwrite all ...
0
votes
0answers
61 views

SQL Server File Latency

I've a Database which is in SQL Server 2012. For the last couple of weeks it's very slow and some times not responding to the queries. So I checked the read/write latency and the result is - Read ...
0
votes
0answers
63 views

Access to path denied when applying logs with SQL Server log shipping

When applying logs on destination database, I consistently get a: 'Access to the path \ip-address\folder is denied' on standby machine. (cannot read logs on UNC sharing) It seems ...
0
votes
0answers
121 views

SQL Server randomly slow to respond to complete query

We have a SQL Server 2012 server. Randomly a query which normally takes 0 seconds will take 30-50 to return results. SELECT TransactionId, ItemNumber FROM Transactions WHERE CompanyId = '...
-2
votes
1answer
52 views

Allowing non-sysadmin users to see SQL Server execution plans

Is this possible ? On SQL Server 2012+, grant access to a non sysadmin user to see the execution plans ? And can this be done for selected databases only ?
0
votes
0answers
137 views

Unexpected server behavior with SQL Server

Production server inexplicably responds. Server runs on Windows Server 2012 Hyper-V. There is also identical to the DR server. On Server stores the production base, and is configured and Mirror ...
0
votes
1answer
2k views

“current security context is not trusted” for job running as a SQL login accessing linked server

I'm running into the error "Access to the remote server is denied because the current security context is not trusted. [SQLSTATE 42000] (Error 15274)" while trying to run a stored procedure from a job,...
0
votes
1answer
150 views

Maintenance plan fails on non-existent database

We have a maintenance plan on our production server which does all the usual stuff... checking integrity, rebuilding indexes, backups, etc. Lately, it has been failing every night, complaining about ...
2
votes
1answer
3k views

How to disable case sensitivity in SQL Server 2012?

I tried to update collation_name in sys.databases. I am trying to change 'SQL_Latin1_General_CP1_CS_AS' to 'SQL_Latin1_General_CP1_CI_AS' in order to disable case sensitivity in table. update d set d....
0
votes
1answer
40 views

How to restore a database from SQL Server 2000 to SQL Server 2012

I've got a databe in SQL Server 2000 and older than it! And it's very old version. I can't restore to SQL Server 2012. Is that because of old version? How can I restore it? Is there any script or ...
8
votes
1answer
159 views

How can I get the hierarchical values from the below query?

I have a table named Category which has a column named CategoryID. There is a referencing column in the same table called fParentCategoryID. I need to get all the category IDs and their subcategory ...
1
vote
1answer
298 views

Is there a way I can shorten the below query into a single query?

I have the below query. IS there a way I can put this into one single query? If not, can I shrink it further anyway? Please advice. DECLARE @highRegion TABLE(regionId INT, countR INT) DECLARE ...
3
votes
2answers
73 views

Need to convert 21:45 to 21.75

I have a datetime column with a time portion of 21:45; I need to convert it to 21.75. I tried: CONVERT(VARCHAR(5), DATE,108) This converts it to 21:45, now the client wants this be 21.75.
1
vote
1answer
83 views

'cmd' Field Definitions sysprocesses MS SQL Server

I am looking at doing some profiling of connections types and volumes across the day. I am using the sys.sysprocesses to gather the information I require, looking specifically at the 'cmd' field to ...
4
votes
2answers
288 views

Find out what columns are in a trace file

while tackling and unexpected CPU spike that was happening every 10 min one of my colleagues prepared a server side trace as follows: -- Create a Queue declare @rc int declare @TraceID int declare @...
41
votes
5answers
3k views

Date range rolling sum using window functions

I need to calculate a rolling sum over a date range. To illustrate, using the AdventureWorks sample database, the following hypothetical syntax would do exactly what I need: SELECT TH.ProductID, ...