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
207 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 ...
5
votes
1answer
2k 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
544 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
410 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 ...
7
votes
2answers
637 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
179 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
155 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
3answers
7k 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
136 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
105 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
144 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
288 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
6k 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
566 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
73 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
1k 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
393 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
763 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
222 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
229 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
152 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
451 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
584 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 ...
1
vote
1answer
3k 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
161 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
255 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
171 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
3k 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 ...
7
votes
2answers
2k 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
993 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
2k 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
384 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
559 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
227 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
4k 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
1k 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
1k 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
130 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
1k 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
591 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 ...
4
votes
3answers
4k views

SQL Server Management Studio Express 2012 “ONLY”

I have installed SQL Server Express(SSMS) 2012 with management tools. After a few months, the Management studio has stopped working. The error is: «« Evaluation period has expired. For more on how ...
1
vote
1answer
292 views

What is connection time?

We are currently trialling ManageEngine SQLDBManager Plus. On the dashboard for a server it shows connection time in milliseconds (currently 15ms). Can anyone tell me what Connection Time represents ...
4
votes
4answers
439 views

Sql server database restore vs index rebuilds

In SQL Server, if Database Restore Time takes less time compare to Index Rebuilds OR Reorganize . Can we Choose Restore as a option for DE-fragmentation. If its not a 24/7 database.
6
votes
3answers
215 views

Can I check the services currently running through SSMS?

I want to check which services has started and which has not by running a script/query on SSMS.
4
votes
1answer
294 views

Can I check what the allocation unit size is on my drives via a query?

Assuming that I do not have access to windows server, can I run a script from SSMS that would allow me to check whether allocation unit size is formatted with 64K?
0
votes
1answer
705 views

Active/Passive to Active/Active

In layman terms, what does it mean to have "Active/Active"? What are the steps to achieve this configuration? Edit: We currently have an "Active/Passive" setup which isn't efficiently making use of ...
2
votes
0answers
356 views

SQL Server : where with cast(value as varbinary) vs cast(value as varbinary(300))

Are there any theoretical performance differences between these queries in the scenarios below. Scenarios are: MyTable has Value nvarchar(300) MyTable has Value nvarchar(max) Q1: declare @p ...
4
votes
1answer
386 views

Why would a SQL Server 2008 R2 database disable a table index when upgraded to SQL Server 2012

I've restored a database backup in a new SQL Server 2012 server from a .bak made in SQL Server 2008 R2, and one of the tables has it's primary key index disabled. This doesn't happen when I restore to ...
3
votes
1answer
3k views

Best way to copy a SQL Server database from a remote server to local computer?

More specific my db is hosted at appharbor and I want to copy that db to my local SQL Server Express 2012. Up until now I have used Management Studio to export the data and later used the schema ...
6
votes
2answers
5k views

Safely moving and creating new tempdb files

Two things I'd like to know, how do you safely move tempdb with minimal downtime? Also, how do you create new tempdb files? Is it 1 per core? So quad-core = 4 tempdb files, creating three new ones?