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)

4
votes
2answers
1k views

Scrubbing Names via SQL Query/Batch

We have sensitive information (names of people) and we're looking to put into place a script to "scrub" of the names. Has anybody come up with a good algorithm to do this, something other than just ...
3
votes
2answers
961 views

How do I replicate SQL Server index INCLUDE and STATISTICS functionality on PostgreSQL?

I'm working on a project that must support two database engines; SQL Server and PostgreSQL. We are using NHibernate as the ORM. We are running into performance issues with certain queries. Using ...
5
votes
4answers
3k views

T-SQL INNER JOIN Optimisation

Well, I really have read so many articles, used different techniques and done some random things to do this. My problem was that a have big tables (over one million rows) and some small (with few ...
2
votes
1answer
827 views

Why use custom CLR aggregate functions for string concatenation and geometry unions in SQL Server?

I often need to do string concatenation or geometry unions over a column in SQL Server 2008 and I'm aware that you can write custom aggregate functions in .NET and register them with SQL Server to do ...
2
votes
2answers
1k views

SQL Server: Do Statistics Updates cause query plans to be flushed? Should they?

I've found that a big, nasty data-extraction query that runs daily needs updated stats to avoid making horrible query plans based on incorrect rowcount estimates (let's not worry about whether or not ...
2
votes
2answers
918 views

SQL Job in idle state

A created a new SQL Job in SQl Server Agent. I followed the steps mentioned in the article http://msdn.microsoft.com/en-us/library/ms187910.aspx Still it is in idle state. PLease note that the ...
1
vote
2answers
247 views

How to get the free temporary memory available in a server

How to get the free temporary memory available in a server For example:- I am running one SSIS package to upload data to tables. First it will move all the data to temporary table and then it will ...
3
votes
1answer
139 views

should we replace some non-clustered indexes with clustered indexes

We have some data saved for reporting each of our tables currently has a unique id column that has an auto generated clustered index on the pk and a non-clustered index for the fk. I am thinking that ...
2
votes
2answers
314 views

Validate and Verify Data After SAN Migration

We are preparing to migrate to a new SAN and I have been tasked with verifying/validating data after migrating a server. Other than the DBCC commands that would tell me about data integrity, and ...
1
vote
2answers
76 views

SQL Server 2008 error when changing cores

I have a virtual machine (virtualbox) with Windows Server 2003 and SQL Server 2008, running with 4 cores. I wanted to use 6, but when i changed the machine configuration, for some reason SQL Server ...
4
votes
1answer
771 views

setup transaction replication in cross domain

I'm trying to setup transaction replication between two domains under the same active directory. The publisher server is in a DR site domain and the remote distribution server is in the main site ...
11
votes
2answers
3k views

SQL Server VARCHAR Column Width

Searching around the web, I have found conflicting advice on whether there is a performance impact when specifying overly-wide VARCHAR columns, e.g. VARCHAR(255) when VARCHAR(30) will probably do. I ...
7
votes
1answer
327 views

Could Stack Overflow run on SQL Server Web Edition?

I am starting a new web venture that may need to scale to a high number of users. I am confident with the SPLA licencing for SQL Server Web edition, but want to know if I will need to factor in ...
1
vote
4answers
120 views

copy ldf from one server to another

I keep getting "file is open in another program" when i try to copy LDFs from one production to dev. Is there another way to copy these ldfs to dev server?
4
votes
1answer
2k views

SSIS how to parse column with erratic data

I have a question on how to parse out a column and hoping a SSIS/Database guru can help out :) Here is the problem. I have a column saved as a string/varchar format in SQL Server, and need to parse ...
3
votes
2answers
4k views

Can someone explain why select with nolock will query a potion of updated data?

I was reading the answer from here (from stackoverflow, I think should ask in here) NOLOCK means placing no locks at all. Your query may returns portions of data as of before UPDATE and ...
3
votes
1answer
384 views

Shrinking log file

Some of the sql log files (idf) are hugh like 5gb. Found a article (http://extended64.com/blogs/rhoffman/archive/2009/06/11/shrink-sql-server-2008-database-log-file-script.aspx) but not sure why he ...
0
votes
1answer
298 views

Shrinking log file [duplicate]

Possible Duplicate: Shrinking log file Some of the sql log files (idf) are hugh like 5gb. Found a article ...
1
vote
2answers
150 views

xSQL trace file error

I am trying to use this programme that goes by the name xSQL Profiler but the problem is that it keeps giving me a error where it says: Trace mietrak did not start. Please check if the Trace File ...
2
votes
1answer
260 views

SQL Server Cluster Failover Making DB Inconsistency Error

I encountered the following DB tables inconsistency error whenever I do a cluster 'move' over from Server-A to Server-B and then do a DBCC CHECKDB on the database in Server-B: SQL Server detected ...
3
votes
1answer
874 views

Rebuild or Reorganize indexes based on fragmentation

I am using an Index Defrag Script, which provides a nice way to rebuid or reorganize indexes based on fragmentation percentages. I like to rebuild my database indexes if their fragmentation is over ...
15
votes
9answers
2k views

Version control for database objects

The database our developers are working on is too large (have a lot of database objects). We have to control db objects changes (change management). Our company cannot have a person who would be ...
0
votes
3answers
42 views

helping hand for sql server resources

I'm just getting into SQL-SERVER, so forgive me if this is a basic question. I need help, recently work on database programming, For my query development, to understand complex query, to can ...
2
votes
2answers
2k views

SET LOCK_TIMEOUT, is it session or statement based?

For what period does the LOCK_TIMEOUT LAST? I do a "SET LOCK_TIMEOUT 10" and a "SELECT @@LOCK_TIMEOUT" in one command after a login and get 10 returned. Immediately after this I do a "SELECT ...
68
votes
4answers
9k views

Why are numbers tables “invaluable”?

Our resident database expert is telling us that numbers tables are invaluable. I don't quite understand why. Here's a numbers table: USE Model GO CREATE TABLE Numbers ( Number INT NOT NULL, ...
3
votes
2answers
316 views

Is it important to release memory back to the server?

I have a SQL Server 2008 R2 instance running on a production system. I'm not a DBA; I'm more a developer, but my client is currently asking me: How important is it to release memory from SQL Server ...
3
votes
3answers
710 views

t-sql - combinatorics

I'm trying to find all possible character combinations in a variable length string. For example: '--' would have 2^n = 2^2 = 4 possibilities, 'x-', '-x', 'xx', '--' I think that essentially I need ...
6
votes
4answers
1k views

What is the fastest way to reset SQL Server database if you can not use RESTORE?

I have integration tests that require test database to function. Since tests should generally be independent, I reset the database in the beginning of each test. I can not use RESTORE, since some ...
1
vote
1answer
148 views

Is it possible to allow write-through computed columns for legacy code that expects a column to be read/write?

I have this existing table for IP storage: CREATE TABLE [dbo].[IPAddresses]( [ID] [int] IDENTITY(1,1) NOT NULL, [IPv4Address] [varchar](15) NULL, [IPv6Address] [varchar](45) NULL, ...
2
votes
1answer
419 views

How to retrieve / read SQL Image Data which is stored in the database?

From one application, we are storing all images in SQL database in the Image datatype. From another application, i need to retrieve the images and display it on User Interface. I am able to store the ...
2
votes
1answer
514 views

SQL Drive getting full delete millions of rows

I'm looking for the easiest way to accomplish this in the limited hard drive space that I have. I have a SQL drive that is dangerously close to getting full. We have about 15 tables that have over ...
10
votes
2answers
3k views

Do SQL Server Express Editions support CLR procedures?

Do SQL Server Express Editions (2005, and 2008) have support for installing, enabling and running CLR Stored procedures and functions.
3
votes
1answer
2k views

Found important issue with SQL Server 2008 R2. Need Advice

Recently while installing my copy of SQL Server 2008 R2; the power went OFF. So now it does say the some features are installed and some are not but when I run SQL server detection manager it says ...
1
vote
2answers
9k views

Select multiple rows from one row based on column values

I have a product table where the value of two columns can imply either one or two actual product results. If column X = 1 AND Y = 0 return one result, if X = 0 and Y = 1 return one result, if X = 1 ...
2
votes
3answers
299 views

What affects the speed of a count(*) besides the number of records

I have a query like SELECT COUNT(*) FROM Foo Where Bar = 1 AND Baz = 2 the table has 12934600 records of which 1000001 match that predicate Looking at the query statistics I see (1 row(s) ...
0
votes
1answer
1k views

SQL Server 2008 R2 SQL Server Profiler and “exec sp_reset_connection”

Yesterday i ran the "SQL Server Profiler" tool and outputted the data to a table, now when i look in it i find many "exec sp_reset_connection" rows and thats expected with our data access layer! But ...
5
votes
2answers
2k views

Query execution showing error as login failed

I want to retrive the table values from other server Query EXEC sp_addlinkedserver @server = 'OPSERVER', @srvproduct = 'SQL Server' EXEC sp_addlinkedsrvlogin @rmtsrvname = 'OPSERVER', @rmtuser = ...
1
vote
1answer
1k views

Looking for a tool to convert between MySql, Sql Server CE, Sql Server and SQLite [closed]

Our old product supports 4 different database types for storing data: SQLite MySql Sql Server CE Sql Server There is also an export feature, which allows to export some data and here is the ...
1
vote
1answer
457 views

Can a maintenance workload after a SQL Server reboot cause SQL outage or issue when application load resumes?

Configuration: Hardware: HP ProLiant DL980 G7 CPU: 4 Xeon X6550 @ 2.00GHz Memory: 393,206 MB SQL Version/Ed, OS: SQL Server 2008 Enterprise Ed (SP1) - 10.0.2757.0 (X64) Windows: Microsoft ...
0
votes
2answers
202 views

MOM and EOM in SQL Server 2005

What is the most sample and practical way to know the MOM (middle of month) and EOM (end of month) in an store procedure on SQL Server 2005? (without doing a select case / switch) EOM is the last day ...
6
votes
2answers
5k views

What is the difference between ALTER INDEX and DBCC DBREINDEX?

Is the only difference between ALTER INDEX [index_name] on [object_name] REBUILD with (ONLINE=OFF, FILLFACTOR=90) and DBCC DBREINDEX([dbname], 90) just that the DBCC command will reindex all ...
-1
votes
2answers
1k views

How database users see their objects in sql server

I have a large SQL Server 2008 database that has many tables, stored procedures, and functions. This database also has several users. How can I make it so that each user, after connecting to the ...
2
votes
3answers
4k views

Easy or Schedulable way to move data from Production to Test

What I am looking to do, is schedule a copy of data from my production database to my dev/test database. The dev/test database will be newer than the production database in terms of schema, but the ...
2
votes
1answer
441 views

Is staggering reindexing jobs a good strategy?

I have inherited a server with 35 databases and a job that reindexes all tables on all databases (using sp_MSForEachTable). It's taking over 14 hours to complete and is now blocking other processes. ...
2
votes
1answer
627 views

high 'total_worker_time' for stored proc using OPENQUERY in SQL Server 2005

I have a stored procedure in SQL Server 2005 (SP2) which contains a single query like the following (simplified for clarity) SELECT * FROM OPENQUERY(MYODBC, 'SELECT * FROM MyTable WHERE Option = ...
2
votes
4answers
4k views

Cannot connect to MS SQL 2008 R2 by DBVisualizer. “Native SSPI library not loaded” error

I try to connect to MS SQL 2008R2 database by DBVisualizer. I use jTDS driver, but following error occurs An error occurred while establishing the connection: Long Message: I/O Error: SSO Failed: ...
2
votes
1answer
722 views

Reducing sort time for querying aspnet_users table in Sql Server

I've recently taken over software development for a small company. My mandate includes managing our SQL stuff, which is something I don't really know much about, and I don't think the guy before me ...
1
vote
2answers
376 views

Is it good practice to assign a system account for database owner?

I can see the owners of my databases usign this query SELECT name , SUSER_SNAME(owner_sid) FROM sys.databases What are the things I should consider when choosing an account for database ...
3
votes
1answer
468 views

How can I restore SQL Server database to a custom location, if the backup file was renamed?

Suppose I have an SQL Server database called bubu and the respective backup file is bubu.bak. If I want to restore it with the backing store in a custom location, I use the following T-SQL statement: ...
1
vote
3answers
1k views

SQL Server 2008 Partitioning Evaluation

I'm trying to do a performance comparison of a table with partitioning and the same table without partitioning. So we have Subcriber and SubscriberPartitioned tables. Tables structure is: ...