Tagged Questions

Microsoft's SQL Server is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. It originated from the Sybase SQL Server codebase, which is why both products use the extension of SQL called Transact-SQL (T-SQL).

learn more… | top users | synonyms (2)

3
votes
1answer
35 views

Overlapping indexes

I have two non-clustered indexes on one of my dbs and their definition are: CREATE NONCLUSTERED INDEX [NC_Index1] ON [dbo].[anyTable] ( [X] ASC, [Y] ASC, [Z] ASC ) INCLUDE (A , ...
0
votes
2answers
37 views

Create/Alter stored procedure without compiling

Is it possible to create or alter a stored procedure in SQL 2005* that doesn't compile the procedure? (* - yes, unfortunately, we still need to support 2005 as our minimum standard) I have a ...
0
votes
0answers
22 views

How much minimum RAM and number of physical hard disks needed for SQL Server to handle a million records per day

I am building a Real-time BI solution which will basically consist of an ETL and BI Engine - mainly based star schema/measures-dimensions. I also have to build Reporting/Charting into it. I can't ...
0
votes
1answer
11 views

fn_trace_gettable Error SQL Server 2008

When I Execute SELECT * FROM FN_TRACE_GETTABLE(N'E:\Trace_Files\trace1.trc', 1) It says "You do not have permission to run 'FN_TRACE_GETTABLE", What type of permission on server required to execute ...
0
votes
1answer
17 views

What permissions do I need to grant on service accounts on SQL root path when relocating?

During a Win2012 with SQL Server 2012 two-node cluster installation, I accidentally set the system root to be the mount point volume hosting folders for the various attached LUNs for the system and ...
1
vote
2answers
44 views

Way to test alerts for backups?

We have some SQL Servers that are backed up using T-SQL and some that are using 3rd party backups (like Egnyte). Is there a way to setup alerts inside SQL Server for that? I also need a way to test ...
1
vote
2answers
47 views

How to use variables with RESTORE FILELISTONLY

Storing the result of RESTORE FILELISTONLY in a temporary table called #filepaths. IF object_id('sp_restore') IS NOT NULL drop procedure sp_restore go CREATE PROCEDURE sp_restore AS BEGIN ...
1
vote
2answers
38 views

sp_testlinkedserver output verbose

I've built a script/Agent job that goes and polls our linked servers every 10 minutes to make sure they are online. Now, when one goes offline, It generates an email and notifies me. See below: ...
1
vote
3answers
182 views

Can I turn auto-shrink off while on production server with people connected?

I'm going to turn auto-shrink off on our SQL Server 2008, but I was wondering if I need to wait until the end of the day when no one is on the server? Or, can I just make the change now? Thanks!
0
votes
1answer
15 views

xp_logevent Invalid Parameter Type

I'm working with SQL Server 2012 Enterprise Edition SP2 on a Windows 7 32bits. I have this code inside a stored procedure. Begin try -- EXEC CLR Stored Procedure exec ...
1
vote
2answers
37 views

Cancel Query in remote ssms from ssms in my pc

We connect to our customer's database server with vpn. Sometimes we manage Sql server to connect database server or to connect with ssms in our pc's. I executed a query with ssms in database server, ...
0
votes
1answer
37 views

Work with table named Group [on hold]

I have a table named Group in my database , when I try to work on it it gave error : SELECT GroupID,GroupName FROM Group it said : Msg 102, Level 15, State 1, Line 1 Incorrect syntax ...
-4
votes
2answers
48 views

How to List out all the tables on the SQL server which do not have a Clustered index? [on hold]

SQL Query to retrieve the tables on the server which does not have the clustered index.
2
votes
2answers
61 views

SQL Server Backup Job failed multiple times

I am getting the same error as mentioned by Mr.Ali Sql Server Backup Job failed Can anyone please explain the possible ways to fix this error as the backup is failing since 1 month. Here is the ...
1
vote
1answer
23 views

Correlated query Issue [on hold]

In the below query i have 2 tables product and productstatus. In product table I have productId and productName and in productstatus table there are locationid,productid,currentstock and ...
2
votes
1answer
100 views

How Do I Use PowerShell to Get a SQL Server Backup Status?

I need a power-shell script to obtain the following information Name of the database , LastBackupDate of the database and this information should be sent via an email converting the results to HTML ...
2
votes
1answer
70 views

Filter table before join

I have a stored procedure that populates the temp table #employee_benefits with a list of Ids. This table ends up being roughly 10,000 rows long. The query below then selects from a table called ...
2
votes
0answers
53 views

what could be a good value for “Cost Threshold for Parallelism”? [on hold]

I would like to reduce the WAIT time that I have on the CXPACKETS, as you can see on the pictures attached. I believe I could raise the cost threshold for parallelism to 50, because 5 is too low. I ...
0
votes
0answers
41 views

Wait Stats, Server Up Time and CXPACKET

I have been looking at the following post and using the query to look at my top wait stats: http://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/ My top wait stat is ...
6
votes
4answers
485 views

Does SQL Server ever delete old error log files?

I know I can cycle the current error log easily by running sp_cycle_errorlog, but I'm wondering if SQL Server will ever delete the old/archived error log files at all. Can't seem to find an answer to ...
2
votes
1answer
98 views

Paging in SQL Server: Is an order by clause required? (currently, rows are being missed)

We have some code that pages through a SQL result. (Currently running on SQL Server 2008) We notice that when paging is done, some rows are not returned. Let me clarify this a bit: nHibernate ...
1
vote
2answers
93 views

Currently all connections getting “Timeout expired”

I have an application which connects to SQL Server. Currently I am getting, Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because ...
1
vote
1answer
31 views

many Servers of SQL server 2012 needs mirroring

I have two SQL server 2012 instances and I want to configure mirroring between the 2 servers with database. My questions are: How can it automatically change host of one if the other one was dropped ...
1
vote
1answer
13 views

many Servers of SQL server 2012 needs mirroring [duplicate]

I have now simply 2 SQL Server 2012. I want to configure database mirroring between the 2 servers. My questions are: How can it automatically change host of one if the other one was dropped ? Is ...
3
votes
2answers
214 views

Physical Server or a Virtual Machine SQL Server?

Is there a anyway to figure out via a SQL Script to know whether SQL Server is running on a Physical Server or Virtual Server ?
3
votes
0answers
81 views

SQL server 2014 locks up on insert query, while SQL server 2000 runs fine

One of the applications I am supporting, is running into a weird issue. In a particular page, there is an insert query. INSERT INTO TBL_Parts_In_Arrival_Details ( PIAD_Parts_In_Arrival_Detail_ID, ...
0
votes
0answers
36 views

Which bitness of SQL Server Express will be compatible?

I need to install SQL Server Express on a Win 7/64-bit system, but I must have MS Office 2010/32 bit installed. Would I be correct in assuming that I must use the 32 bit version of SQL Server ...
2
votes
0answers
32 views

AFTER DELETE trigger will not fire during a cascade delete

I've got two tables, corresponding to Nodes in a graph and Aisles to which they may belong. In addition, each Aisle has a Node at which it starts and ends. Aisle Table: Aisle char(4) Start_Node ...
1
vote
1answer
32 views

How to recover a database from a failed Availability Group?

We are currently testing a SQL Server 2012 AlwaysOn HA implementation where we have 2 out of the 3 nodes are synchronous. The third, asynchronous node, does not have a vote in the quorum. There is a ...
5
votes
1answer
108 views

Query optimizer recommends adding index instead of using existing index

I am trying to determine why the query optimizer in SQL Server is recommending creating a new index instead of using an existing index that appears to be sufficient for the query. First the table. ...
10
votes
2answers
949 views

Why would a table use its primary key as a foreign key to itself

Looking through a database, I came across a table that used its primary key as a foreign key to itself. I've seen that a table can have a foreign key to itself to build a hierarchy structure, but it ...
1
vote
2answers
43 views

Insert New Foreign Key Row for new Strings

Lets say I have a table new_data like this: ndx | someval | somemachine serial | integer | integer ---------------------------- And let's say I have a reference table new_data_someval_ref: ...
0
votes
0answers
22 views

Migrate DB2 to SQL Server [on hold]

I want to migrate DB2 to SQL server. First all data from DB2 to SQL and then all changes from DB2 to SQL with near real time. what solution Shall I use?
0
votes
1answer
18 views

Invalid Identifier on Linked Server

I have an Oracle 11g database that I am linked to on a SQL Server 2014 box. I am trying to run a query that I will eventually dump into a table on my SQL Server box. The following is the query I am ...
2
votes
2answers
103 views

Assembly 'system.web, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.' was not found in the SQL catalog

I am trying to deploy a SQL CLR function using the HTTPUtility.UrlDecode method of System.Web but I can't get it to deploy. Error received: .Net SqlClient Data Provider: Msg 6503, Level 16, State ...
0
votes
1answer
28 views

SSIS - insert system date variable as a execute sql task parameter

I am trying to insert the system:starttime variable into a table by passing a parameter into an execute sql task. I dont have much knowledge of SSIS data types, and I am currently having trouble ...
0
votes
0answers
42 views

SQL Server: efficient query with (double) linked servers

I am DBA of server A (SQL Server 2008R2), linked to server B (SQL Server 2012SP1), linked to server C (not sure which version). I have no control on server C, and I cannot contact its DBA. On server ...
1
vote
4answers
234 views

How to determine the size of my tables in the SQL Server database

Is there any built-in function/stored procedure/query which is helpful to retrieve information about the size of MyTable in the SQL Server database?
0
votes
1answer
43 views

SQL Server stored procedure that would enforce atomicity?

Let's say I have following insert statements INSERT INTO tEmpl (lastName) VALUES('Smith') INSERT INTO tEmpl (lastName) VALUES('Jones') INSERT INTO tEmpl (lastName) VALUES('Smitty') INSERT INTO ...
0
votes
1answer
30 views

How to make get a Row Change from SQL [on hold]

I've a question related to SQL Query with sample data tblModel(MODEL nvarchar(50)) MODEL MODELA MODELB MODELB MODELC MODELA MODELA MODELA MODELC I want to make a query to show data with ...
2
votes
2answers
110 views

How can I wipe all databases and users from a SQL Server database?

Okay, here is the story. I have a Windows 7 Ultimate box with a SQL Server 2008 R2 Standard installation that I inherited from a person who left the company long before I started at my company. No ...
0
votes
1answer
52 views

Copy Database from Production to Development

I need to copy database from production to development instance in SQL Server 2012 as I don't want to mess up the production server database. Can someone suggest how I can do this ?
0
votes
1answer
30 views

Identify faulty sub-query (subquery returned more than 1 value)

I am trying to resolve an issue with a query that fails with this error: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when ...
0
votes
0answers
36 views

How can I obtain concurrent deletes for this table?

We have a program that is currently doing something to the effect of: SET TRANSACTION ISOLATION LEVEL READ COMMITTED BEGIN TRANSACTION UPDATE [Source].[dbo].[SourceTable] SET [ProcessedOn] = ...
2
votes
1answer
42 views

Database Size Troubleshooting

I have a SQL Server database and the .MDF file is almost 9GB in size. However, the data and indexes only seem to be taking up a little over 1GB. I've shrunk the database (with and without ...
4
votes
1answer
95 views

Proving the usefulness of a specific index

I'm looking for a way to prove that some recently added indexes are positively impacting a production system. I've collected some dmv statistics to show that the indexes are indeed being used ...
1
vote
1answer
23 views

Can you use CDC on a subscriber for transactional replicaiton

I want to track changes from a few tables in a source database. I am considering using transnational replication to get a reporting copy of those tables and isolate the IO on a separate server. Can ...
0
votes
3answers
38 views

How to enable windows authentication on server that is not part of domain

We have an SQL server instance running on a standalone server (not part of the organizations domain network). Is there any way that we can use windows authentication to logon to sql server without ...
1
vote
1answer
52 views

Delete from table where two of the three keys in another select

I have tableA which has 4 columns: IDA (bigint), IDB (int), IDC (varchar(255)) and comment (varchar(255)). The primary key is (IDA, IDB, IDC). I'm required to delete the records where the count of ...
0
votes
1answer
17 views

set right permission to get connection ip for a user mapped to login

I have a problem with properly settings the rights permissions for my user to get access to connections ips. I know that, to get the conn ip I must set the VIEW SERVER STATE to the login that I use ...