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

learn more… | top users | synonyms (3)

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 ...
2
votes
0answers
57 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
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 .
1
vote
1answer
232 views

How to write a query which recursively returns all foreign key references to a column?

I need to obtain a list of foreign keys which refer to a given column, as well as all foreign keys which refer to those keys, and so on. Order does not matter. I have SELECT s.name, t.name, ...
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 ...
0
votes
0answers
59 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
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
111 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 ...
1
vote
1answer
142 views

SQL Licensing on Azure, Standard D4 Windows 2012 Server 8 core, is it 1 phsysical core?

I am trying to calculate my costs for Microsoft Azure. Imagine I take a Standart D4 Type machine running Windows 2012 and would like to install my own SQL Server 2012. Are these 8 cores 1 quad core ...
0
votes
1answer
133 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 ...
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
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 ...
3
votes
4answers
2k views

~2 Hours after a large insert SQL Server gets “I/O requests taking longer than 15 seconds to complete”

This problem has been haunting me for a while but I actually fixed the queries that caused the problems (after I finally found them) but i'm curious if it's an SQL Process that's the underlying ...
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 = ...
8
votes
1answer
140 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 ...
6
votes
1answer
153 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 ...
7
votes
2answers
2k views

How can I reliably determine if a given SQL Server instance has the “Lock Pages in Memory” right?

The "Lock Pages in Memory" right can be granted to the service account used by SQL Server. This allows SQL Server to prevent memory being paged to disk. I've noticed several of our SQL Server ...
2
votes
2answers
2k views

Unattended SQL install on a remote machine

My product installation does an unattended install of SQL Server (SQL Server Express by default). I use command line arguments rather than a configuration file, so I'm quite familiar with this ...
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 ...
0
votes
1answer
132 views

Aggregation by positive and negative values

I have a table called "PROD_COST" with 5 columns: +----+----------+------+-----------+-------------+ | ID | Duration | Cost | COST_NEXT | COST_CHANGE | ...
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
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 ...
5
votes
3answers
184 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 ...
1
vote
0answers
2k views

SQL Agent After installation not able to start

SQL Server 2012 SQL Agent will not start after installation. Checked permissions, on surface configurations, all OK, have tried to run it as another account no Joy. The error i am receiving is the ...
6
votes
2answers
111 views

Combining data from multiple rows

I am relatively new when working with queries so let me apologize in advance. This is SQL Server 2012 that I will be working with. This data has been brought into a staging table through a nightly ...
1
vote
0answers
38 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 ...
1
vote
1answer
3k views

Backup/restore of a database that has a filestream

I have a SQL DB to which I have recently added Filestream data. Now we have a daily backup/restore to a QA server, and since I added the Filestream data, this has started failing. So I modified the ...
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 ...
5
votes
1answer
711 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 ...
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 ...
0
votes
0answers
70 views

Error while opening Registered Servers in SQL Server

I just installed SQL Server Management Studio 2012 and I'm trying to open the Registered Server tab to import my xml file with all saved servers, but I'm getting the error described below: "SQL ...
2
votes
1answer
1k views

Connection to local SQL Server 2012 can be established from SSMS 2008 but not from SSMS 2012

I have two local SQL Server instances running on my local machine. The first is SQL Server 2008 R2 Enterprise Edition (named MSSQLSERVER) and the 2nd is SQL Server 2012 Business Intelligence Edition. ...
3
votes
0answers
243 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 ...
2
votes
2answers
85 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 ...
-1
votes
1answer
819 views

The SQL Server Network Interface library could not deregister the Service Principal Name

After windows patching (windows 2008 R2 , SQL Server 2012 Sp2). I could not start SQL Server Service . I get error 1067 and this from the error log* The SQL Server Network Interface library could not ...
3
votes
2answers
111 views

How can I switch to sa account from guest session in SQL server 2012?

I have a situation where I can log into my server as guest, and see that there is no password on the sa account. However when I try to login as sa with null password over the network it is rejected. ...
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 ...
4
votes
2answers
174 views

Why would SQL Server remain unresponsive after a slow query completes?

I've just finished debugging a problematic SQL Server 2012 table-valued function. It was declared to use a unique column in the table: CREATE FUNCTION [dbo].[myApp_getUserIdsFromXml] ( ...
8
votes
2answers
226 views

Identity column in columnstore index

I have an extremely large table IMO (~137 million rows) with lots of repeated data, lots of NULL columns, and such. I am considering exploring this using a table with a COLUMNSTORE INDEX and I have ...
3
votes
1answer
248 views

SQL Server: dm_exec_requests.wait_time vs. dm_exec_sessions.last_request_end_time

We have a third-party Microsoft Access application that uses SQL Server 2012 as its data store. It is a well known issue that Access often does not tell SQL Server that it has received the results of ...
15
votes
3answers
10k views

SQL Server Agent Jobs and Availability Groups

I'm looking for best practice in dealing with scheduled SQL Server Agent jobs in SQL Server 2012 availability groups. Maybe I missed something, however at the current state I feel that SQL Server ...
1
vote
0answers
106 views

Log shipping restore delay of a minute between iterations

On a test database running Log Shipping jobs the initial Restores to catch up performed the first time I run the Restore job seem to have a 1 minute or so Wait time built in. I would have expected ...
4
votes
4answers
293 views

Routing data from one SQL Server to another

Is there a way in SQL Server 2012 to have data being written to one table routed to another SQL Server on another host? To clarify, we are using Hibernate Envars to write audit logs. Hibernate Envars ...
8
votes
3answers
869 views

NOLOCK hint changes order of records returned

There is a clustered index on a table Client field LastName. When I simply dump all records from the table, they appear in the alphabetical order unless (nolock) hint is used as in the query in ...
3
votes
4answers
2k views

Replication fails because of a non-existent foreign key

I have been trying to get a previously working replication to start working. I have tried many settings, but I can't seem to make it work. Here is the scenario. I dropped all the FK constraints ...
1
vote
3answers
48 views

SQL Server 2012 window function

I've the following table which holds status of jobs in a history table. JobHistory jobOrderId | dateAdded | Status -----------|-------------------------|------- 4909 | 2015-08-26 ...
1
vote
2answers
66 views

Index planning for many columns with different usage

I've a table with 80 columns and that is a base table for most of the application. Daily load inserts almost 8,000 records and update upto 2,000 records. This table is now having more than 5 million ...
1
vote
0answers
49 views

Uninstalling MS sql server 2012 issues

I'm trying to uninstall ms sql server 2012. But when I click Microsoft SQL Server 2012(64 bit) and choose remove option it shows like this. Then how can I remove the MS SQL Server 2012? Please help. ...
2
votes
1answer
195 views

Management Studio licensing issues

We have a licensed SQL Server 2012 Standard Edition instance, that for some reason keeps getting license expiration messages in Management Studio. Sometimes it gets this message: Your Microsoft ...