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

learn more… | top users | synonyms (3)

0
votes
0answers
47 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
263 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
353 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
168 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
94 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
474 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 ...
0
votes
1answer
360 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
70 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
899 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
176 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
99 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
1k 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
299 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
85 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
52 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
197 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
408 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
56 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
42 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
64 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
204 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
1k 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 ...
2
votes
0answers
56 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('+ ...
0
votes
0answers
40 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
57 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
58 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
103 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
49 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
110 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
1k 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 ...
0
votes
1answer
132 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
2k 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 ...
0
votes
1answer
38 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
138 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
61 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
221 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 ...
40
votes
5answers
2k 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, ...
0
votes
0answers
45 views

SQLAzureMW 2012 throws UnknownPropertyException

I'm running SQLAzureMW 2012 to import a SQL Azure Database into my local SQL Server 2012 instance. The process imports a few tables and then throws the following error immediately after line: BCP ...
1
vote
0answers
35 views

SSMS 2012 intellisense is not working on one of the servers?

I dont know if this question is asked - I found similar question - How to enable intellisense, but my case is little different. We have 2 SQL Servers 2012 - one is in the other room, other is in our ...
2
votes
1answer
79 views

what are the costs of enabling extended events?

I have been dealing with deadlocks, specifically getting their information, as you can see on this post here. On this same post Shanky recommended "You must now rely on extended events trace to ...
5
votes
1answer
702 views

A possible infinite recompile was detected for SQLHANDLE

I have been finding strange error messages on the sql error log: Bocss: same deadlock taking place every hour – needs investigating Also lots of recompiles are listed in the error log for other ...
6
votes
1answer
151 views

SQL Server database level audit filtering does not work

I have SQL Server 2014 Enterprise Edition installed. Due to privacy considerations, SELECT statements on private data need to be logged, except for a specific domain user, used by a service which ...
3
votes
0answers
242 views

SSMS Client Error: Internal connection fatal error

I am running SSMS 11.0.5646.0 on a Windows 7.0 Pro desktop connected by UTP directly to same network switch as my development server (Windows 2008R2 Standard, SQL 2008R2 SE with SP3). All within the ...
1
vote
0answers
37 views

Queries running slower on production (failover cluster) than on homologation env [duplicate]

I have a Windows Server 2012 cluster with two nodes running SQL Server 2012 for production and a Windows 2012 single server with SQL Server 2012 for homologation. I just restored the production ...
2
votes
0answers
71 views

PAGEIOLATCH_SH and WRITELOG waits

We have a slow overnight process which I was asked to look at with the top waits being PAGEIOLATCH_SH and WRITELOG I have been collecting information from sys.dm_io_virtual_file_stats and can see ...
5
votes
3answers
182 views

Charindex, Getting specific data from a string

Hello I am very new to charindex and have tried to create a query that would extract my needed information but am running into an error. I searched for similar problems on stackexchange as well as a ...
2
votes
2answers
83 views

Query to know who paid more than 10k

I have a table with payment informations, like this: ID COSTUMER_ID DATEPAID AMOUNT 1 1 2012-01-01 50 2 1 2012-02-01 100 3 1 2012-03-01 70 4 2 ...