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)

7
votes
2answers
935 views

When do I need to backup the Service Master Key?

I'm reading some documentation and whitepaper about Transparent Data Encryption. Some documentation mention to backup the Service Master Key as well (For clarification I'm not talking about the ...
4
votes
1answer
150 views

Always being logged in as SA and not Windows account

First off i would like to appologise if i sound stupid as i do not have much knowladge of SQL Server. I have recently started a project working with SQL Server 2008 R2. I have access to the database ...
6
votes
1answer
348 views

What would be a good name for a job schedule?

I have encountered many different names for job schedules in SQL Server, ranging from the job name where it is used to a short recap of the schedule itself. I would like to give a clear, descriptive ...
2
votes
0answers
346 views

What does duration measurement in sql server actually measure?

What precisely does the query duration measure when conducting a profiler trace? I have a stored procedure which performs data access (SELECT), and it is taking an average of around 30 seconds to ...
2
votes
2answers
1k views

SQL Server 2005 Tools makes SQL Server 2008 Express install fail

When I tried installing SQL Server 2008 Express, the install failed due to this line. How can I circumvent this, or fix the issue?
6
votes
1answer
821 views

Service Broker: Queue Monitor is dropped after poison message

I have searched everywhere and there isn't an answer online. There is one similar question on stackoverflow but it's not exactly the same and it has no accepted answer. When I setup event ...
5
votes
2answers
3k views

Column definition for a SQL Server equivalent to Access BOOLEAN type

The BOOLEAN datatype in Access (ie, Jet/ACE) returns a -1 for True and 0 for False; the field is always required (i.e., it cannot be set to NULL). The SQL Server BIT type returns 1 for True and 0 for ...
3
votes
1answer
74 views

Is it possible to enlist a TSX to an MSX in a different domain?

In Domain1, I have an MSX with 75+ TSXes registered. Now I've been given some SQL Server instances in another domain. Is it possible to enlist Domain2 instances to an MSX in Domain1 ?
4
votes
3answers
1k views

How can you save all user-defined functions to txt files on your local hard drive?

I am running SQL Server 2008 and need to back up the UDF scripts/queries that I have created. How can this be done in a timely manner? I tried right clicking on the folder icon where the UDF are saved ...
5
votes
2answers
11k views

How can I strip non-numeric characters out of a string?

Users enter a search term in a box, and that value gets passed to a stored procedure and checked against a few different fields in the database. These fields are not always of the same data type. One ...
3
votes
1answer
393 views

Connecting Linked Server

Hi I want to fetch data from MS SQL DB of a Remote server using Linked Servers. I have linked the servers. I am fetching data as follows. select * from [IP of server].[Database Name].[dbo].[Table ...
9
votes
1answer
4k views

Should I add SET NOCOUNT ON to all my triggers?

It is fairly common knowledge that you should have SET NOCOUNT ON by default when creating new stored procedures. Microsoft has changed the default template to include this in 2012. I thought ...
-3
votes
1answer
1k views

Single query to copy data from 3 tables into a single empty table

In an interview today, I was asked if I could write a single query to copy data from 3 source tables to an empty destination table. I started saying "I will use a temp table or table variables", ...
2
votes
2answers
553 views

SQL Server 2008 R2 Dormant Users

I would like to know if Too many Dormant Users/sessions on a SQL Server instance can force SQL server to not to create new connections or give connection denied error to the application which is ...
8
votes
2answers
946 views

Sql server 2008 filestream maximum number of rows

We are using filestreams in Microsoft SQL Server 2008 (SP2) - 10.0.4000.0 (X64) and Windows server 2008 to store millions of files. Since there are millions of files all of them are grouped into 100 ...
2
votes
4answers
229 views

How does the database decide which Index to use

DDL create table t ( id int, id1 int ) create index Example_Index On t(id,id1) create index Example1_Index On t(id1,id) DML insert into t(id, id1)values(1, 100) insert into t(id, ...
1
vote
0answers
179 views

SQL Server Service seems stuck [closed]

I'm running a stored procedure and it just doesn't finish. Here are a couple of things I have noticed: Normally, the procedure takes 20mins but now it's running for over an hour by now. Normally, ...
4
votes
4answers
13k views

T SQL Table Valued Function to Split a Column on commas

I wrote a Table Valued Function in Microsoft SQL Server 2008 to take a comma delimited column in a database to spit out separate rows for each value. Ex: "one,two,three,four" would return a new table ...
2
votes
2answers
174 views

Which edition of SQL Server express

I am looking to learn SQL server - specifically T-SQL programming, writing stored procedures etc and getting familiar. I had a look at the MS site to download SQL Server express, however it gives me ...
3
votes
1answer
109 views

can sql generate a good plan for this procedure?

I have read that procs that do not always do the same thing per se, will not always have a good plan generated. That is (correct me if I'm wrong), if I have a proc that if the day is even it reads ...
1
vote
0answers
208 views

ClientHost for Logon Trigger showing NULL values [closed]

I am trying to create a Logon trigger, in SQL SERVER but EVENTDATA().value ('(/EVENT_INSTANCE/ClientHost)[1]', 'NVARCHAR(15)') is returning NULL values. Why So ?
2
votes
1answer
313 views

.NET SQL Server Authentication Schema issue

I am currently working on a project for a client. The application is written in ASP.NET C#. The Database used is SQL Server 2008. The project has been to migrate the old Oracle database to a new SQL ...
10
votes
1answer
11k views

Stored Procedure to return dynamically created table data

Quick back story, we are working with an outside vendor that has a survey system. The system is not necessarily designed the best in that when you create a new survey and the system creates a new ...
3
votes
1answer
714 views

AG and SQL Backups

I am using always on in sql 2012 and have an AG setup. I would like to know if i were to backup the primary database and restore it would that be allowed without taking the cluster down etc. ...
4
votes
2answers
74 views

Deleting NULL results

Currently I'm just trying to delete objects with the Name column being Null from a temp table with the following... delete from #PulledData where #PulledData.Name0 = NULL I've also tried = 'NULL', ...
3
votes
1answer
2k views

Management Studio all buttons disabled

I get an odd problem in my SQL R2. Although I can attach a new db to my db instance, but all buttons on the tool menu panel are disabled. So I cannot execute any sql query statements. It is really ...
8
votes
2answers
658 views

How does SQL Server store the information in Job Schedule Properties?

I know there is SELECT * FROM msdb..sysjobschedules, but that just shows the next time a job is scheduled to run. I want to know how this is all determined and stored. So where does it store the ...
9
votes
3answers
1k views

PostgreSQL Initial Database Size

There are 2 parts to my question. Is there a way of specifying the initial size of a database in PostgreSQL? If there isn't, how do you deal with fragmentation when the database grows over time? ...
2
votes
0answers
289 views

Could not allocate space for object 'dbo.History' in database '[path to mdf]' because the 'PRIMARY' filegroup is full

I have a local project i am working on, on my own workstation. I use a local SQL server as well. The project contains alot of data, and as of now, i just need to be able to store all this data in the ...
2
votes
0answers
319 views

SQL Server SSIS issue retrieve data when i enter into login of server side?

can any one try solve my problem here i am facing a problem Failed to retrieve data when i enter into login of server side here is the error message TITLE: Microsoft SQL Server Management Studio ...
1
vote
1answer
231 views

Merge Replication Snapshot Files

I am using Merge Replication with SQL 2012. I look in the snapshot directory, but the largest file in there is a prc file which is 646 KB. I know for sure that the biggest of my replicated tables is ...
4
votes
2answers
941 views

Change column data type across database

I have a bunch of tables with many columns of data type ntext. I wish to change all such columns in all tables of a particular database to nvarchar(max), because of planned deprecation (EDIT: also ...
1
vote
2answers
801 views

How do I normalize a database with lots of many-to-many relationships?

I am building a database that is based around a business project, in this case called a "Program." Each Program will have multiple Reports, Clients, and Partners. My first thought was to place each ...
4
votes
1answer
7k views

Quick look at how much RAM is allocated to SQL Server?

With SQL Server 2005, you could look at the Task Manager and, at least, get a cursory look at how much memory is allocated to SQL Server. With SQL Server 2008, the Working Set or Commit Size never ...
0
votes
1answer
193 views

AlwaysOn SQL Server setup questions

I just have a few questions regarding the setup of Always On HA, and Clusters. When you setup an AG, and it gets to setting up your IP address for the cluster how can i switch from using DHCP to a ...
3
votes
1answer
346 views

Will SYSTEM_USER return the unique user id for users authenticated by Active Directory

I want to set up Active Directory authentication for my users, who will be assigned to specific database roles. I also need to log activity and ensure I have captured the IDs of the indivudals ...
5
votes
1answer
279 views

SQL Server: Effect of Setting These Index Options

A reindexing script was recently run in our dev environment that set ALLOW_ROW_LOCK = FALSE and ALLOW_PAGE_LOCKS = FALSE on all the indexes in the database. This was done while testing new reindexing ...
1
vote
1answer
5k views

Cannot telnet SQL Server port 1433

I have Windows Server 2008 with SQL Server 2012 Enterprise installed on it. I disabled the Windows firewall and I'm sure that there isn't another firewall. I cannot telnet my server. I enabled ...
9
votes
2answers
3k views

SQL Server Decimal(9, 0) vs INT

One of our customers uses for some columns the datatype DECIMAL(18,0) in his SQL Server 2008R2 database. Because the columns grow quite slowly, he recently proposed to change the datatype to ...
2
votes
2answers
2k views

Tempdb autogrowth settings

Following on from a recent question that I asked on Tempdb. I was wondering how to correctly set the autogrowth property when adding and moving the tempdb files? I ask because I would like to let SQL ...
10
votes
2answers
3k views

Good way to call multiple SQL Server Agent jobs sequentially from one main job?

I've got several SQL Server Agent jobs that should run sequentially. To keep a nice overview of the jobs that should execute I have created a main job that calls the other jobs with a call to EXEC ...
3
votes
2answers
631 views

Optimizing real-time Database table in Microsoft SQL server 2008

We are using a web interface to monitor our jobs state and its started and completed timestamps. We have >200,000 job instances running on each day for different job run-users. We maintain the state ...
2
votes
2answers
1k views

difference between having many non clustered index with single columns and with combination of many columns

Folks I am a newbie to DB design stuffs. I am wondering what would be the difference and performance difference between having designed many non clustered index with single columns and non ...
2
votes
2answers
259 views

Stored procedure compilation blocking due to many parameters to sp_executesql

I am seeing blocking due to locks on compiling a particular stored procedure (as described in KB 263889). Basically, several processes are waiting with LCK_M_X on the same resource "TAB: ...
8
votes
4answers
6k views

SQL Server equivalent to functionality of Oracle RAC?

I did some Googling and couldn't find an answer to this question more recent than a few years ago, so I thought I'd ask. Oracle's RAC feature offers load-balancing for both read and write ...
3
votes
1answer
2k views

Version of Witness Server for mirroring SQL 2012

Can I use SQL 2008 R2 as a Witness Server for 2 instances of SQL 2012 Servers being mirrored?
3
votes
2answers
2k views

Export as csv or xsl file from SQL Server 2008 express R2

I am basically LAMP developer got some assignment where SQL Server is required. I have installed SQL Server 2008 R2 Express and imported backup file in it. Now, I want to export user table in excel ...
4
votes
2answers
138 views

why SELECT is still using CPU & DiskIO?

I have a large database, about 30GB. In order to delete some data from a table (most data is in this table, simply because the # of rows), I have to do delete in batch. However, if I delete in too ...
4
votes
2answers
3k views

Differences between estimated and actual execution plans

I'm new to SQL Server and I want to tune my first query. In SQL Server 20xx, what is the difference between "display estimated execution plan" and "include actual execution plan" ?
5
votes
1answer
809 views

SQL Server 2012 Resource Governor Enhancement

In SQL Server 2012 what specific enhacement was made regarding controlling memory usage by using Resource Governor. Up until SQL Server 2008 R2 resource governor was only able to control memory ...