0
votes
0answers
41 views

SQL-Server 2012: Same query takes different Query Plans - but why?

Recently we had an issue with a query, which reached a timeout when executed the call through our web application. Using a monitoring tool I found the "bad query" and took it. I run it directly on the ...
1
vote
1answer
21 views

SQL Server 2012 Install error “The instance selected for installation is already installed and clustered on computer…”

I am trying to setup a new environment for SQL Server 2012 AlwaysOn. I inadvertently used some SQL Server 2008 config files initially to do the installs but ran into too many problems. I un-installed ...
3
votes
1answer
73 views

How do I login to SQL Server via group membership in another domain

When attempting to connect to SQL Server (2012), I get a login failed error message. The error log on the server reports: Logon Error: 18456, Severity: 14, State: 5. Logon Login failed ...
2
votes
1answer
30 views

SQL Insert Statement Persists Two Records When I Need Just One

I have altered it to include hardcoded variables when I pulled this chunk of code from the stored procedure. I ran it independent of the application with the same result. I need one insert statement ...
0
votes
0answers
31 views

How can I speed up MySQL Workbench in a SQL Server to MySQL conversion? [closed]

I am using MySQL Workbench to convert a 9GB SQL Server database (2012) to MySQL 5.6 on the same AWS Windows machine. (It's an r3.2x large, 8 vCPUn, 26 ECU, 61 GB RAM). It has been running for about ...
1
vote
3answers
62 views

Deploying SQL Server database changes from test to production server

I have a high availability production server that runs SQL Server. It is constantly being read/write to by hundreds of users. I have an exact copy of the database on a testing server and do all the ...
3
votes
2answers
97 views

Insert only deadlocks

We have an application inserting data into a table. Unfortunately, we are getting deadlocks and the deadlocks are coming from inserts only. We are seeing the inserts take key locks in a different ...
3
votes
2answers
491 views

Which of the following pieces of SQL is most efficient

I need to add the date part of GetDate() to the time part of a stored DateTime. Naively I thought I could do the following: declare @testTime DateTime = '2013-04-23 13:55:06' select cast(getdate() ...
0
votes
2answers
48 views

Live Partial Table / column replication

I want to know if there is a way to achieve the following with SQL Server 2012 Enterprise Edition? I have Table A: on Server 1 with say 10 columns. Table A: | col1 | col2 | col3 | coln | col10 | ...
5
votes
0answers
66 views

SQL Server stuck in single_user with auto_update_statistics_async on

Books online states Before you set the database to SINGLE_USER, verify the AUTO_UPDATE_STATISTICS_ASYNC option is set to OFF. When set to ON, the background thread used to update statistics ...
1
vote
1answer
52 views

The query processor could not produce a query plan

I'm getting this message: Msg 8624, Level 16, State 17, Line 1 Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support ...
0
votes
1answer
40 views

Unable to copy a DB from SQL Server 2000 to SQL Server 2012 using copy wizard

I am trying to copy a database from SQL Server 2000 to SQL Server 2012 using copy wizard in my local machine where SQL Server 2012 is installed. But, the wizard is not detecting destination server. ...
2
votes
1answer
39 views

Defining a column as nullable in a view (but not in the referenced table)

My company is working on implementing a new HR application that will unify our existing HR processes. We've run into a bit of a sticking point, though; according to business rules, the EmployeeID and ...
1
vote
2answers
167 views

Should these two indexes suggested by the SSMS missing index feature be combined?

I'm trying to improve the performance of a specific query that is automatically generated by Entity Framework. I have run the query through SSMS, and it has suggested creating two missing indexes. ...
0
votes
1answer
44 views

Procedure with Insert Data From One Table to Another Table

I have two tables Person with PersonId, Name,Address,Mobile and PersonLog with Id,Name,Address,Mobile,FK_PersonId. I am trying store the old data in PersonLog and Person to be updated. This is my ...
0
votes
0answers
22 views

How to retrive output depending on last alphabet from entry in table [migrated]

I have table User with Id, Name. So depending on last alphabet from column Name, i need to output some text. If last char is 'o' should return YES, if is 'i' return NO, else null Ex. Monika ...
7
votes
1answer
114 views

T-SQL - OPTION (FAST x) and trace flag 8722

I have searched a long time and still haven't found the answer to my problem. Our Dynamics AX is generating queries with the query hint OPTION (FAST x), which sometimes forces a bad execution plan to ...
0
votes
0answers
27 views

SQL Server 2012 Replication Subsystem Increase Number of Working Threads

I am trying to create Transaction Replication (Push) between two servers, using a distribution database on a3rd server. Server 1 is SQL Server 2008, Server 2 is SQL Server 2012. The Distribution ...
2
votes
1answer
37 views

Create failed for Availability Group 'AGN'

I tried creating availability group (AOH) many times but no luck , It got failed every time. Please help me on this case. I configured Windows cluster (Name as 'WINCLUSTER') with two nodes. They are ...
0
votes
0answers
54 views

Prevent gaps while using Identity/sequence object in sql server

I have a table and I am trying to insert values in it. I want to prevent gaps in the primary key column. For primary column I have tried using Identity / sequence objects. I know that this is ...
0
votes
1answer
74 views

How to get more information from dm_exec_query_stats

I am running SQL server 2012 on windows azure VM (windows server 2012) I suspected that some of my web appliactions are attacked via SQL injection, So far i could not trace the relevant text with my ...
3
votes
0answers
51 views

PowerShell Move-Item command made SQL and Windows entirely unresponsive

A LUN expansion completed overnight on our 15k FibreChannel VMAX SAN from 4 to 13 terabytes. This morning I attempted to move a 4.5 terabyte file from a temporary SATA LUN to the newly expanded LUN ...
2
votes
1answer
51 views

Detached database file permissions

I have a script that detaches databases for archival when they meet certain criteria. The script is executed by SSIS under the local Administrator account by the Ghost of DBA Past. Per design it (by ...
4
votes
4answers
316 views

How does SQL Server determine precision / scale?

I'm running SQL Server 2012 SELECT 0.15 * 30 / 360, 0.15 / 360 * 30 Results: 0.012500, 0.012480 This one is even mor confusing to me: DECLARE @N INT = 360 DECLARE @I ...
0
votes
1answer
46 views

Select complete next row based on the current row

Hi i have a complicated condition. I have a table lets say 'Test' ID Partner Type Amount 143854 CSTC Purchase -0.81 144029 CSTC Purchase -0.69 144030 CSTC Purchase ...
8
votes
3answers
1k views

Truncated 200GB table but disk space not released

I have only 2GB left, so I need to remove this history table. This table now is empty but the database disk space not released. And the database file is 320GB.
0
votes
2answers
33 views

SQL Server 2005 to 2012 Replication, cannot access replicated data

I have created publication (snapshot, small table with 10 rows) on MS SQL Server 2005. Then, I created push subscription on MS SQL Server 2012. When I try to select data form table, process takes ...
3
votes
1answer
81 views

Possible reasons for really long database recovery

This is cross-posted at SSC, but restore is now going on 6 hours. Hello, Overnight I ran restores with NORECOVERY for a 5tb database, along with several other 250GB - 1.3tb databases. I did that ...
1
vote
0answers
29 views

Is there any way to set stored procedure options like ANSI NULLs to true or false outside of creation?

I'd like to set ANSI NULLs and quoted identifier properties on a stored procedure after it has been created. Is this possible? For some context, I'm using Visual Studio Database Projects / SSDT, and ...
0
votes
1answer
36 views

Cannot connect with OLE DB

OLE DB connection... Can anyone suggest me on this. Authentication with windows security works in 2012-2005 "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False; ...
0
votes
0answers
20 views

sql server linked server does not consider indexes [closed]

We have a query with a join between two tables. The first is in the database and the second is in another listener, connected by a linked server. I am executing this query in SQL Management Studio ...
1
vote
3answers
74 views

How to force SQL Serve *not* to maintain a log file

I have a situation that I need some advice to overcome. I have a SQL Server 2012 database that has been set to Simple recovery model. At times, my SQL Server transaction log file grows out of ...
1
vote
0answers
24 views

“Failure occured while attempting to connect to the Principle server” from CLR procedure

I have a Windows Service running under a domain account which calls a stored procedure which then calls a CLR stored procedure. Initially I had a problem where database ownership chaining wasn't ...
0
votes
2answers
83 views

Can't see some stored procedures in sys.procedures

Documenting a database and find that I cannot see stored procedures in sys.procedures, even though I can see them in Object Explorer. select p.name, x.value, p.modify_date from sys.procedures p left ...
0
votes
1answer
27 views

Trouble backing up remote database from local server

I have 2 servers LOCAL and REMOTE. REMOTE has a database 'remotedb'. From REMOTE the following statement backs up the database just fine. BACKUP DATABASE [remotedb] TO DISK = ...
1
vote
1answer
165 views

What is the possibility that mirroring a database will damage, corrupt, or erase either the primary or target database? [closed]

The last time my company had tried to mirror some databases, everything worked great until one morning they came in and the primary database in one of the mirroring schemes was just blank. They had ...
10
votes
2answers
505 views

What is the logic behind ISNUMERIC for certain special characters?

The ISNUMERIC function has some unexpected behavior. The MSDN documentation says: ISNUMERIC returns 1 when the input expression evaluates to a valid numeric data type; otherwise it returns 0. ...
2
votes
2answers
120 views

Performance/Health checking queries for a user with Read permissions

I am a software developer that only had read access to our prod database (of course). Occasionally we have what looks like performance issues on our server when my DBAs are not available. Is there ...
1
vote
1answer
105 views

RESTORE failing with OS error 32, file being used by another process

I am writing a set of procedures for (partially) automating DB deployment for a customer, which mostly works fine, but sometimes a RESTORE command is failing with the OS error 32, about a file being ...
6
votes
0answers
78 views

Troubleshooting THREADPOOL Waits

From everything I have read, THREADPOOL waits occur when a task is waiting for a worker thread. A high amount of THREADPOOL waits typically means you are running out of available worker threads. ...
0
votes
1answer
23 views

Reporting Services DBs not appearing in Management Studio, but can be queried?

I've set up a server with native reporting services, connected to a database server which hosts its two databases. I'm trying to run a backup of the two databases so I can add them to my availability ...
0
votes
0answers
22 views

SQL Server 2012 FTS and weird behavior with numbers

I stumbled on this weird behavior in SQL Server's Full text search. First run the following SQL-code in a database: CREATE TABLE test( id int IDENTITY NOT NULL, value VARCHAR(255), CONSTRAINT ...
0
votes
1answer
68 views

SQL Server sometimes uses a lot more cpu for query

I have a stored procedure with a quite heavy SELECT statement that includes five joins and uses FieldName LIKE '%searchterm%' on multiple columns. This query usually finishes in about 2-5 seconds. But ...
0
votes
1answer
77 views

Best practice for testing database disaster recovery [closed]

This is regarding database disaster recovery testing. The production server has 20+ databases. I'm developing procedures for regular testing of disaster recovery and am wondering what is the best ...
2
votes
1answer
66 views

Check progress of alter index reorganize / rebuild

How can I check the progress / status when I submit an alter index reorganize / rebuild ?
0
votes
1answer
30 views

sys.dm_db_index_physical_stats is extremly slow

I have a database that is around 4.5TB, since we have parallel inserts (to reduce daily load time) on one table (partitioned by month) the clustered index on this table tends to be heavily fragmented. ...
2
votes
2answers
113 views

Possible to optimize SELECT query involving XQuery functions selecting from elements with arbitrary number of child elements

Suppose I have the following XML data, where <root> can have an arbitrary number of <child> children <child> can have an arbitrary number of <grandchild> children ...
0
votes
0answers
87 views

Database Properties Error - sys.spt_values missing but dbo.spt_values works?

We have SQL2012 SP1 installed on several servers and have run into an issue on one instance trying to view the database properties in SSMS. (This happens with both SSMS 11.0.5058.0 and 11.0.3128.0.) I ...
1
vote
2answers
196 views

Why can't we access SQL Server when a long query is running in Management Studio?

We have a SQL Server Database (2012 Standard edition). The database is accessed through an ASP.Net web page which displays the count of databases in different tables on page load. This work fine ...
1
vote
1answer
59 views

Finding the Table and Column Based on a Known Value

I've inherited a rather large SQL Server 2012 database -- about 2TB, tens of millions of rows in some tables, and about 350 different tables. I have basically no references nor documentation. There's ...