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
3answers
305 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
135 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
399 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 ...
3
votes
2answers
398 views

Distribution database compatibility level

Using SQL Server transactional replication with a distributor on 2008R2, and publishers/subscribers all on SQL 2005. Does the compatibility level of the distribution database matter? Should it be ...
2
votes
2answers
1k views

SQL Server cluster failover

If I have a cluster and I pause the SQL Server Service on the active server with the cluster interpret this as a failure and attempt to fail-over? I tried this on a failover cluster test on my laptop ...
6
votes
1answer
5k views

How to make a union view execute more efficiently?

I have a large table (tens to hundreds of millions of records) that we have split for performance reasons into active and archive tables, using a direct field mapping, and running an archive process ...
0
votes
1answer
3k views

querying multiple values from one column [closed]

we have a table called transaction_details. when i write this query SELECT DESCRIPTION, item, cust_code, pack_description, uos, pack, total_value, total_value_vat, total_value_goods, price_indicator ...
3
votes
1answer
2k views

How can I set the index fill factor back to server default?

I have some indexes that I was playing with on my dev server. I set the fill factor of these indexes using the following command: alter index all on dbo.Table rebuild with (fillfactor=80) That ...
5
votes
1answer
456 views

Copy a SQL Server 2000 database to another box without interrupting the backup chain

I have a small-but-important MS SQL Server 2000 database that I'd like to copy to a development box. I understand that the usual way to do this is to make a copy of a full backup file, and restore ...
2
votes
2answers
1k views

Using SSIS to get record counts for tables that may not exist

I have an SSIS package that executes simple queries against a list of servers. I am having an issue with one particular simple query: If a table exists, get the rowcount. Otherwise report "not ...
8
votes
1answer
607 views

Are SQL Server Database writes slower with Snapshot Isolation?

I have a lot of deadlocks going on in my system. I would like to use Snapshot Isolation to fix them, but my DBA has reserves about it. One of his concerns is that Snapshot Isolation slows down ...
16
votes
5answers
5k views

Why are periodic restarts required to keep my instance performing well?

We've got a production DB server on SQL 2005. Everything runs normally for a while, but after a couple weeks we see a notable performance drop. Only restarting SQL Server brings performance back to ...
4
votes
1answer
4k views

Management Studio 2012 Backward Compatibility

Two quick questions for anybody that's tried this: Will Management Studio 2012 install and run side-by-side with, say, Management Studio 2008? I vaguely recall not being able to do this with 2008 ...
2
votes
2answers
2k views

Union of Columns

I have some SQL queries that retrun the following. Total Pre Orders Web Total Pre Orders Phone Total Orders Web Total Orders phone Each one of those queries retrurns a the query name and the count ...
1
vote
3answers
517 views

Checking if the query is made async or sync on SQL Server 2008 R2

I have tried to make async calls to my SQL Server instance as you may see on my SO post: ASP.NET MVC 4 asyncronous database call: never returns the HTTP response I did a benchmarking and the sync ...
4
votes
4answers
556 views

How to scale my SQL Server 2008?

My DB is SQL Server 2008 and I want to scale up the system by 5 fold (maybe more in the future). The system currently has 95% read & 5% write from front end. And from backend actual data is bulk ...
2
votes
1answer
465 views

How to change ANSI_NULLS option for a table?

I have a table that mistakenly has ANSI_NULLS option set to OFF. I'd like to set it ON for this table. The table has millions rows of data. Is it possible to change this option without creating a new ...
1
vote
1answer
2k views

How do I delete rows from a table on a linked server

I need to delete rows from a table in several databases on several servers with the same schema. OPENROWSET() does not seem to be the answer. If I do this: SET @sqlStr = ' SELECT TOP 0 * FROM ...
2
votes
1answer
489 views

SQL Server 2012 data striping

Is data striping possible like mentioned here data striping in older SQL Server 2005 in the newest version of SQL Server like SQL Server 2012? I know this is possible in 2008 and 2008R2.
9
votes
1answer
4k views

Running an SSIS package owned by a domain user from SQL Server running on a local service account

I want to run an SSIS package containing Transfer SQL Server Objects tasks. The involved servers are on the same domain, but the SQL Server services are running on local service accounts. So the ...
3
votes
3answers
480 views

SQL 2008 Developer Edition, not using all CPU´s

My SQL Server doesn´t want to use the second CPU for our Vault database. I tried to use different configurations for the CPU affinity in SQL Management Studio, but doesn't seem to fix it. I've read ...
3
votes
2answers
2k views

SQL Server Restore DB from MDF file, lost LDF and DB was not cleanly shutdown

My dev DB server was formatted by some admin without my knowledge. Thankfully I had mdf file kept in some other drive but ldf was in its default location. Since I don’t have DB backup I am now left ...
1
vote
3answers
120 views

User Rights - Can alter Sp's but not tables

How can i make user permissions so that user can CREATE\ALTER\DELETE Store Procedures, but cannot CREATE\ALTER\DELETE tables in database.
6
votes
2answers
325 views

Does the order of columns in a columnstore index matter?

I have a table with ~200 million rows and ~15 columns in it. I am planning to create a COLUMNSTORE index on my table. Will there be any change in performance based on the order of columns that I use ...
4
votes
1answer
180 views

SQLConnections 100 + instance problem in database

I am using a SQL Server Database in my CRM Project. It is not Microsoft CRM, it is a simple BPO website that 100+ users used to work on. Sometimes there are more than 100 users logged in, and works ...
3
votes
2answers
343 views

What do these statements mean in the MS β exam 70-461 “skills measured” list?

I have registered for the upcoming beta exam 70-461 entitled Querying Microsoft SQL Server 2012. I've been reading through the exam overview and found a bunch of descriptions I'm not exactly sure ...
3
votes
2answers
2k views

Do I need a separate Id column for this “mapping” table?

I have a table of Producers and a table of Products, both of which are of the form: Id - int, Primary key Name - nvarchar A Producer can carry multiple Products, so I was going to create a table ...
6
votes
1answer
367 views

Dimension Help - Deciding Fact or Dimension

We have the following Dim and Facts: Customer Dim: SCD Type 2, Info about the customer ie first purchase date, name, address, etc Product Dim: SCD Type 2, about our products Customer Snapshot ...
3
votes
2answers
947 views

Upper or Lower Case Optimisation on MS SQL Server

Does anyone know if MS SQL Server text queries are optimised for upper or lower case strings? I read somewhere the it was uppercase, but cant seem to find the reference to it again. Of course if ...
7
votes
3answers
301 views

How can I identify when to create a new table to hold data that can be obtained from a query?

We have a payment table, and agents get commission on payments. Commission is based on a few different factors, such as how long it took to get the payment, so there is some calculations involved when ...
2
votes
2answers
4k views

How to deny drop permission for a table?

Is there a way to deny drop permissions for a specific table from a user or role?
2
votes
1answer
786 views

SQL query to INFORMATION_SCHEMA.TABLES to only return those I have select access to

I currently have a query in SQL 2008 that can return me a list of tables for a given database, provided I have View Definition access to them. select TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, ...
8
votes
3answers
675 views

Is there a performance benefit to placing transaction log files on a separate drive?

There are many blog posts and best practice articles extolling the virtues of placing the SQL Server data file on one hard drive and the transaction log on another. The reason given is that that the ...