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)

0
votes
0answers
295 views

Cannot start SQL Server service on SQL Server cluster [closed]

I have a SQL Server 2008 cluster with 2 nodes. I rebooted both machines and now I CANNOT start the SQL Server service from: Node1 or Node2 or ClusterSQL (the cluster SQL Server) I am getting an ...
1
vote
1answer
2k views

Changed server name, now maintenance plan fails

I am using SQL Server 2008 R2. When I try to execute a maintenance plan I get the following error: Message [298] SQLServer Error: 15404, Could not obtain information about Windows NT group/user ...
3
votes
0answers
777 views

Preferred Methods Of Indexing MS SQL Server Audit Data To Splunk

What is your preferred method for indexing MS SQL Server for Splunk? I am collecting audit data in various environments by various means (profiler, app logs, and extended events) but I hope to ...
0
votes
1answer
275 views

Can I deactivate log shipping jobs without raising errors?

I've set up log shipping from Server A to Server B. I then set it up from B to A when B was the primary. I've reverted back to A being primary and disabled the backup, copy and restore jobs ...
6
votes
4answers
879 views

Gaps and islands: client solution vs T-SQL query

Can a T-SQL solution for gaps and islands run faster than a C# solution running on the client? To be specific, let us provide some test data: CREATE TABLE dbo.Numbers ( n INT NOT NULL ...
6
votes
2answers
123 views

RID vs INCLUDE on a large field

I have a table that stores notes create tblNote( Id int identity(1,1), ParentId int , ParentType varchar(32), NoteType varchar(32), Note varchar(max), CreatedBy ...
3
votes
1answer
1k views

How does this undocumented syntax work? {fn CurDate()} or {fn Now()} etc

Recently I've been looking through some fairly old stored procedures that were written for SQL Server 2005, and I've noticed something that I don't understand. It appears to be some type of function ...
5
votes
2answers
3k views

SSIS keeps force changing excel source string to float

There is a column in Excel that is supposed to be text, but SSIS sees numeric text there and automatically makes it double-precision float [DT_R8]. I can change it manually in the Output branch's ...
3
votes
6answers
3k views

Backup sql database directly to FTP server

Is it possible from SQL Management Studio to create a backup directly to an FTP server? Basically, instead of choosing the destination to a disk, I sould like to be able to specify an FTP location ...
4
votes
2answers
905 views

Securely generate a UNIQUEIDENTIFIER in SQL Server

I intend to be using a UNIQUEIDENTIFIER as an access key that users can use to access certain data. The key will act as a password in that sense. I need to generate multiple such identifiers as part ...
0
votes
0answers
240 views

RESTORE DATABASE is terminating abnormally [closed]

I want to restore the database My current query is Use master DECLARE @ErrorMessage NVARCHAR(4000) ALTER DATABASE [dummydata] SET SINGLE_USER WITH ROLLBACK IMMEDIATE BEGIN TRY ...
0
votes
5answers
13k views

The DELETE statement conflicted with the REFERENCE constraint

I'm trying to delete all users but getting the error: Msg 547, Level 16, State 0, Line 1 The DELETE statement conflicted with the REFERENCE constraint "FK_M02ArticlePersons_M06Persons". The conflict ...
3
votes
2answers
396 views

Find all the SP's where a particular column is not updated

I want to find stored procedures where a particular column is not updated. As an example SP1: BEGIN UPDATE YourTable SET Foo = @Foo, Bar = @Bar WHERE Id = @Id ...
1
vote
1answer
1k views

SQL Server 2005 error while starting service

I am getting error while starting the service & errorlog is: 2013-04-04 14:50:49.14 Server Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 Copyright (c) ...
4
votes
1answer
236 views

Insert performance progressively deteriorating for indexless table

I have a miniature SQL Server database being filled in by a mathematical model. The database contains two tables created thus:- CREATE TABLE [dbo].[small_table]( [id_col_1] [tinyint] NOT NULL, ...
0
votes
1answer
252 views

Need help in converting this cursor to a set based operation

I have a stored procedure which runs as part of a report database refresh nightly which takes about 2 hours complete. The object B_RPT_RC_AUDIT_ASSIGNED_TO_TEMP_T2 has 8 million rows. Can you suggest ...
0
votes
2answers
57 views

What query can give me this result?

I have these three tables: Table1 pro_id(Pk) pro_name 1 ABC 2 def Table2 pid pro_id 1 1 2 1 ...
4
votes
2answers
687 views

Slow SSRS Report in production

I have an SSRS report which gets its data by firing a series of stored procedures. Now the report is timing out big time when run in production, yet when I pull down the prod database and restore to ...
8
votes
1answer
1k views

Is SQL Server data compression categorically good for read-only databases?

Some literature on SQL Server data compression I read state that the write cost increases to about four times what would normally be required. It also seems to imply that this is the primary downside ...
4
votes
2answers
2k views

SSIS Data Flow Task Excel to SQL table NULL value will not work for small INT datatype

I have a package that imports excel data into a SQL table. One of the columns in the table is of "smallint" data type and it allows for nulls. The excel file column that has the data that is suppose ...
5
votes
2answers
502 views

Database stuck in restoring and snapshot unavailable [closed]

I tried to restore my database from a snapshot. This usually took around a minute to complete the last couple of times. When I did it today, it didn't complete for around 30 minutes and the spid was ...
4
votes
3answers
762 views

How to add additional hard drive(s) to existing database

I have a database that is close to filling the hard drive that it lives on. I'd like to expand the database on to another hard drive to deal with this. I see there's a Files option in the database ...
-1
votes
2answers
1k views

Select query having count and variable

I have a table like the one below. I need to form a select query. I'm going to pass a RefID like SELECT SNo FROM Register WHERE RefID = 1 And beside the SNo in the Statement, I need to have ...
2
votes
5answers
7k views

SQL Server 2008: How to send an email when a step in a SQL Server agent job fails, but overall job succeeds

I have a SQL Server job with 6 steps. Steps 5 and 6 must be run regardless of any failures in the first four steps, so these first four jobs are set to skip to step 5 if they fail. However, if steps ...
8
votes
1answer
4k views

How to trace SQL queries which are crashing SQL Server

We have a SQL Server 2008 database server (it happens to be running under MS Failover Clustering, but I don't think that is relevant here). Our application runs Hibernate for DB access, and since we ...
15
votes
7answers
4k views

Why should an application not use the sa account

My first question ever, please be gentle. I understand that the sa account enables complete control over a SQL Server and all the databases, users, permissions etc. I have an absolute belief that ...
1
vote
1answer
92 views

How SQL Server detects a record internally?

I am following this SO post where the author (stack programmer) states SQL server uses the identity column as the key value to refer to a particular row. So only a single identity column can be ...
2
votes
2answers
513 views

Bandwidth comparison between log shipping and transactional replication

Which technique uses more network bandwidth: Log shipping Transactional Replication Can some one share any benchmarks for the same ? What would be the Memory and I/O impact on the Primary server ...
3
votes
2answers
73 views

SQL Server migrations go through client machine or not?

I want to migrate a SQL Server db on one machine to another machine. Both machines are remote. If I run the Copy Database wizard, will it pull all the data across the Internet to my client machine and ...
5
votes
1answer
397 views

Unexpected Table Scan with Parameterized LIKE

I'm experiencing an unexpected table scan on SQL Server 2005 against a heap table when parameterizing a LIKE statement... but when the same value as the variable is hard-coded, the expected Index Seek ...
7
votes
2answers
408 views

Concatenation Physical Operation: Does it guarantee order of execution?

In standard SQL, the result of a union all is not guaranteed to be in any order. So, something like: select 'A' as c union all select 'B' Could return two rows in any order (although, in practice ...
0
votes
3answers
3k views

SQL server ODBC connection for Active Directory user who doesn't log in to the windows

Do you think it is possible to create a SQL server ODBC Connection for an active directory user who doesn't log in into the windows. Ideally this type of users will be used in the batch process. So, ...
4
votes
1answer
141 views

How to reinsert corrected rows from the conflict table?

I have a bidirectional merge replication. I had failure constraints because the primary key was just integer. I change the primary key to the old primary key + a location identifier.The problem is how ...
2
votes
3answers
640 views

Backups script completes, but doesn't back up all dbs

I'm running sql server 2005 and I've made a simple backup script that backs up all the databases on one server. The script always succeeds, but when I go to check the log or the files, I see it has ...
5
votes
1answer
574 views

Process attempted to unlock a resource it does not own

SQL Server 2005 SP4 32-Bit I have a DBCC CHECKDB job running nightly. Last night, soon after the job started, I got the errors below. The database is NOT in suspect mode, and CHECKDB comes back clean ...
2
votes
1answer
2k views

SQL Server uses only 1 CPU of 4 available

I've two machines with SQL Server 2012 Express SP1 with default configuration settings for CPU usage. I'm using this query on my work machine: SELECT cpu_count FROM sys.dm_os_sys_info It returns ...
1
vote
4answers
1k views

Automated SQL backup on a timely fashion, & cleaup the database for the backed up data

I need to back up SQL database (historian), on a timely fashion, and then clean up the database by removing the backed up data. I am using MS SQL 2008 (R2), on a Windows XP machine. The biggest issue ...
-1
votes
1answer
148 views

IO Frozen in error SQL error log

The log shows IO DBName is Frozen follow by thaw but yet my database schedule backup task which normally been running isn't since the network team are doing backs (not database backups, according to ...
3
votes
1answer
10k views

Find out number of active locks on a table

I was wondering if there is a way to find out the number of active locks held on a table in SQL Server?
1
vote
2answers
3k views

SSIS Expressions Date Format get just YY for year

I found many articles on date formatting expressions in SSIS but I couldn't find one that specified how to get just the Year such as 13 for 2013 or 12 for 2012... I tried DATAPART("yy",GETDATE()) ...
3
votes
1answer
150 views

How can I determine what is using a particular resource (table, view, or function, etc) on my SQL Server?

I've been looking for tables that could use better indexing. I've created a stored procedure that provides a list of tables that have no indexes other than a primary key: CREATE PROCEDURE ...
6
votes
2answers
2k views

Bitmask Flags with Lookup Tables Clarification

I've received a dataset from an outside source which contains several bitmask fields as varchars. They come in length as low as 3 and as long as 21 values long. I need to be able to run SELECT queries ...
-1
votes
1answer
531 views

SSIS SQL Result to tab delimited txt file [closed]

I have created a package that Runs a Sql Query and then puts the results into a flat tab delimited txt file. When I opened the flat file in excel everything was in the right columns but in columns ...
2
votes
1answer
511 views

Setting DATEFIRST to 6

I would like to set FIRSTDATE to 6 (ie: saturday), i have read that to change it parmanently i could set the default language of the login to one of an existing language from the sys.syslanguages and ...
3
votes
1answer
246 views

SQL Server 2012 catalog.executions to sysjobhistory - any way to join them?

I have exhausted my resources and can't find a foolproof way to join the ssisdb.catalog tables to the jobs that run them. Trying to write some custom sprocs to monitor my execution times and rows ...
1
vote
1answer
200 views

How to suppress an informational raiserror message

I have a setup script that calls sp_configure a few times to set up some system variables, it works fine but I have a few of the following statement Configuration option '%ls' changed from %ld to ...
0
votes
2answers
136 views

Can I use replication/mirroring to have a “Current” database and a “Full History” copy?

I have a database that is used for current operations. The amount of data is starting to get a bit to much for the applications using it. Most of the data is older and is very rarely needed. I am ...
6
votes
2answers
220 views

How do I demonstrate Transaction Log activity?

Say I have the following setup: use tempdb go set nocount on go create table MyTest ( Column1 varchar(100), Column2 text ) go insert mytest (Column1, Column2) select REPLICATE('a', 100), ...
0
votes
2answers
1k views

Estimated Execution Plan SQL Server Sort?

I'm running a query and its taking a age to execute, looking at the execution plan I can see that 51% of the cost is in the SORT? when in the actual query i am not ORDERING BY anything. Anyone got ...
3
votes
1answer
2k views

Why is a hash match operator in this very basic query

I'm beginning to learn some about looking at execution plans and making queries more efficient Consider these two basic queries select distinct pat_id, drug_class, drug_name from rx select pat_id, ...