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)

2
votes
1answer
374 views

Can I create a second filestream container on an existing SQL Server 2008 database without going offline?

Our production DB is using the FILESTREAM option for our sharepoint environment. The volume where the files are residing is getting full and I am planning to add another volume to ease space issues. ...
3
votes
1answer
5k views

moving large number of tables to different filegroups

An existing database has a large number of tables stored in the PRIMARY filegroup. I want to move theses tables and their indexes on different filegroups automatically, depending on the "prefix" of ...
1
vote
1answer
130 views

Sql Server Resource Governor - track IO

I know I can use the performance counters to track Resource Governor CPU and Memory Usage. Is it possibly to track the I/O usage for each work load group? I haven't seen anything specific or any ...
10
votes
2answers
261 views

Index fragmentation while continuously processing

SQL Server 2005 I need to be able to continuously process about 350M records in a 900M record table. The query I'm using to select the records to process becomes badly fragmented as I process and I ...
10
votes
1answer
14k views

How to control the excessive use of ram by SQL Server?

The database server that I am using is running 6 different SQL Server instances. It has 48 GB RAM. And one of them is consuming more than 10 GB of RAM, total consumption is 20 GB for now. The RAM ...
1
vote
1answer
449 views

Migrating data in SQL Server from source to target with schema change at target

We have a strange scenario. We have a source database running on SQL Server 2005 where we push data to a target database running on SQL Server 2008 R2. The source database table has 5 columns. The ...
7
votes
1answer
275 views

Table order in Join Query

if i say: Table1 left join Table2 is it the same as saying Table2 right join Table1 ? In other words, should i expect to get the same results from 2 identical queries where the only thing that is ...
3
votes
2answers
17k views

How do I troubleshoot loss of connection with SQL server

I have an application that intermittently has a break in the connection between it and the SQL Server instance it requires to function. What is a good way to go about troubleshooting this type of ...
5
votes
1answer
1k views

Service Broker & AlwaysOn Availability Groups: Odd Transmission Queue Behavior

I have also posted this question on my blog: http://www.sqldiablo.com/2012/04/15/service-broker-alwayson-availability-groups-odd-transmission-queue-behavior/. I’ve been working on a project over the ...
2
votes
1answer
455 views

SQL Server 2008 R2 .mdfs write protected

I had to replace my hard drive, XP pro sp3, and all my applications - including SQL Server 2008 R2 developer edition. My databases are all on a separate physical drive. I find I cannot move or copy ...
2
votes
1answer
3k views

How can I move LOB_DATA ( varbinary/image/text) to different Filegroups

LOB_DATA : varbinary(max),varchar(max), image , text columns. I have 4 tables with large amount of LOB_DATA in it. I would like to move LOB_DATA in these tables to different File group in a different ...
1
vote
1answer
149 views

Which should be used after messing up clustered index? Update statistics, Reindex or Reorganize

If I have a clustered single column index, e.g FooId in SQL Server 2008, 2012 and I know I have messed up the order of the rows to not have sequential order of the FooId column anymore, which ...
30
votes
1answer
5k views

What's the point of WHERE 1=2 for SELECT INTO table query

If we want to create a new table from an existing one in SQL Server we can do the following SELECT * into Table2 from Table1 WHERE 1=2 Whats the point of where clause? I tried it without the where ...
9
votes
2answers
8k views

Subqueries' aliases same as main queries' aliases

I have an SQL query whose aliases are the same as some of its subquery's aliases. For example: select * from ROOM r where ... ( select * from ROAD r ...
10
votes
2answers
3k views

Tracking stored procedure usage

Besides using SQL Server Profiler, is there any way to track which stored procedures are being used, or at least when they were last executed?
13
votes
2answers
39k views

High Disk I/O from sql server or is High disk I/O slowing sql server?

I've been arguing with a DBA and a couple hardware guys about performance issues on our SQL server. Normally everything is fine, however over the past few weeks we have been having huge lag spikes in ...
2
votes
3answers
179 views

Setting up database structure for Students, Managers, and Administrators

I'm trying to figure out how to set up the structure for users. Users can have multiple Managers and Managers can manage multiple Business Units. Administrators have full control of the system. I'm ...
7
votes
2answers
369 views

What is the preferred method to roll out updates to hundreds of databases

I am trying to determine the best way to roll out SQL scripts to hundreds of distributed servers. I have a slow SSIS package and a very fast OSQL/BATCH process. I am on a project where we have ...
2
votes
1answer
889 views

Is it correct, order of where clause doesn't matter when it is used with join?

I have question on execution of queries in which join is used with where clauses. I read this question on join with where conditions. I tried options like disabling rules and checked actual query ...
1
vote
1answer
918 views

Can't connect to Analysis Services or Reporting Services on localhost

I'm able to connect to my SQL Server 2008R2 localhost Database Engine and Integration Services. However, when I try to connect to Analysis Services, it fails with the message: "A connection attempt ...
1
vote
1answer
148 views

What is the use of creating full text catalog in full text indexing

Just want to know about the processes happening in full text indexing. I know by defining the full text indexing for a table, it will index all the words saved in that table. But i didn't get the use ...
1
vote
1answer
971 views

PowerShell error for installation SQL Server 2012 RTM Developer on Windows 7 X64

I had a lot of grief with upgrading from 2008 R2 and PowerShell. Created a thread but doesn't seem to be promising to solve it, so de-installed, and now I am installing from scratch 2012 . And ...
3
votes
1answer
166 views

SQL Calculation based on 'similar' rows within table

I'm using SQL Server 2008 R2, building a fact table for SSAS. I can therefore accept solutions to this via either SQL query to SSIS task. Let's say I have a fact table that looks a little like this, ...
2
votes
2answers
344 views

Can I store half of a record on one page and half of the record on another page?

I'm watching Paul Randal's MCM video from http://technet.microsoft.com/en-us/sqlserver/gg313756.aspx From 27:11 of the video, the author said a record must be saved in one page, you can't have half ...
4
votes
4answers
2k views

RSync Database File Deltas in SQL Server 2008

Alright, I feel like this is a terrible idea, but I need some help understanding why this is bad: I'm still working on implementing a disaster recovery/business continuity solution for our ...
1
vote
2answers
92 views

Manage select results in sql

We need to manipulate a set of records returned from a select query. This can be done in : Either by saving the whole record to a table variable and then do the required process. We can do like this ...
241
votes
4answers
94k views

What's the difference between a temp table and table variable in SQL Server?

This seems to be an area with quite a few myths and conflicting views. So what is the difference between a table variable and a local temporary table in SQL Server?
5
votes
2answers
3k views

Is there any benefit to having one sql server login for multiple users?

I just entered a development project where the developers use the same SQL Server login to connect to a central database for their work. I have never come across this before, as each dev usually has ...
3
votes
1answer
565 views

SQL Server Clustering for HA combined with Log Shipping for DR

Has anyone implemented SQL Server log shipping in a clustered environment? Are there any issues or things to consider when implementing this scenario?
3
votes
1answer
1k views

Activity Monitor showing long duration for WAITFOR RECEIVE

In Activity Monitor, the following query is causing high CPU and 281ms average duration. WAITFOR ( RECEIVE conversation_handle , service_contract_name , message_type_name , message_body ...
7
votes
3answers
304 views

Prevent Data Sources from being deployed outside designated folder

Before I just go ahead and put a really awful check constraint on the Catalog table, I wanted to solicit some better ideas first. I want to ensure that all shared data sources on our report server ...
1
vote
1answer
134 views

SQL Data type for “Reference” fields in table - SQL Server

I am learning SQL Server. I need a bit of advice regarding data type for fields that will be referred to but will not actually themselves require values. I don't know the correct term to use(edit ...
2
votes
1answer
2k views

SQL Server Database Mail failing to send emails with error Sender address rejected: Access denied

The environment is a 2 node 2008 SQL Cluster. The first node was running fine but after failover to the second node Database Mail no longer can send emails. I am using Basic authentication. The ...
2
votes
1answer
292 views

Cluster communication - SQL Server Failover Cluster

I am running a lab enviornment on my laptop two node SQL 2008 R2 running on windows 2008 R2 clustered Vms Based on my understanding a) Public Network or all Communication network I see checkbox ...
1
vote
1answer
7k views

Unable to telnet to port 1433 in SQL Server clustered instance?

Situation: I believe that multiple port 1433 can be implemented as long as the IP address are all unique. I’ve created SQL Server 2008 R2 SP1 clustered virtual instance on top of my Windows Server ...
4
votes
2answers
3k views

Cross-database call fails in a job but succeeds in SSMS

I create two databases, a table in the second database and a stored procedure in the first database. The stored procedure cross-database accesses the table. I create a sql server login and I also map ...
0
votes
2answers
2k views

Disk performance causing SQL Server Command Timeout?

I setup a perfmon collector to capture data around some recent SQL Server command timeout errors and most indicators point to disk issues. CPU and memory numbers look normal. This is a SQL Server 2008 ...
1
vote
4answers
5k views

upgrading sql server 2000 database to sql server 2012

Seeking some advice about an oudated database system we're working with.... hope this is an appropriate place to post this question. I work with a city government arts program. In 2004, we ...
3
votes
2answers
6k views

What to use, CASCADE DELETE rule or ON DELETE trigger for one to many constraint?

I would like to ask about how to handle this relationship. For better view I've tried to simplify and convert my situation into how I think StackOverflow question voting has (sorry if not :-) I ...
2
votes
1answer
407 views

Not able to attach database file without transaction log file [duplicate]

Possible Duplicate: How do I attach a database in SQL Server? I lost the transaction log file. I tried re-attaching the data file without the log file, to create a new log file, SQL Server ...
3
votes
3answers
1k views

Sql Server 2008 database is suspected

My database in sql server 2008 has marked suspect. How can I fix this problem?
2
votes
1answer
398 views

encoding format of multilingual text while saving to database

I have website that save content in various languages. just to display that i have enter to database. Suppose i copy a French text in sql server table column it will display correct on my website, ...
6
votes
2answers
160 views

Optimization: One time vs Staging

I ran into a situation with two options: Use a single query with a cost of ~0.07 INSERT INTO @vals SELECT ... FROM ... JOIN ... JOIN ... WHERE a.col = 1 OR b.col IS NOT NULL Use two ...
1
vote
1answer
148 views

SQL ServerRecovery Model Change Tracking

Are SQL Server recovery model changes logged anywhere...WMI, error logs...etc? For instance, if I change from FULL to SIMPLE, is this recorded anywhere?
5
votes
1answer
1k views

sp_ExecuteSQL, performance and table variables

Is anyone able to explain some behaviour I'm seeing with SQL Profiler? Taking the following two batches: exec sp_executesql N' declare @t table ( x int ) insert into @t (x) ...
1
vote
2answers
201 views

INSERT statements in a transaction and locking a range of rows

I have a table that is concurrently accessed by many users. Typically, INSERTs to the table are made one at a time. Occassionaly, users will add a "batch" of rows at the same time. The batch is ...
5
votes
3answers
499 views

What is the easiest way to use a SQL Server backup to retrieve just a few rows?

I need to manually retrieve a few rows from a SQL Server 2008 database backup. Normally I create a new database, restore the database backup to the new database, and run my queries. The database is ...
5
votes
4answers
2k views

CTE Running in Infinite Loop

My CTE runs in an infinite loop for a specific customer and I am not able to find out why. Here is the query: ;WITH ClassTree AS (SELECT ID, NAME, Parent_ID FROM ...
4
votes
1answer
9k views

Unique index corrupted SQL. Select query returns single row but create unique index fails

I am not able to repair my database due to below errors, when I run dbcc checkdb(DBNAME, REPAIR_ALLOW_DATA_LOSS) I am getting the errors listed here. When I run a select query for these key values, ...
8
votes
1answer
1k views

What are the security implications of sp_executesql?

By default, in SQL Server, the [public] role has EXECUTE rights on sp_executesql. However, I've inherited a database server where the previous DBA has revoked the EXECUTE right on sp_executesql. As ...