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)

1
vote
2answers
113 views

Format function returning minutes instead of months?

While exploring the new function FORMAT I have come across the following issue, would like to know if any one else has faced a similar problem and found the fix for this, or if it is a bug? SELECT ...
2
votes
1answer
306 views

SSIS - How do I execute a single OLE DB Command for mutiple paths?

I have an SSIS package (2008 R2) that I'm working on and I find myself duplicating the same OLE DB commands repeatedly and whenever there is a change its a nightmare to go back through and update all ...
7
votes
3answers
2k views

Splitting SQL query with many joins into smaller ones helps?

We need to do some reporting every night on our SQL Server 2008 R2. Calculating the reports takes several hours. In order to shorten the time we precalculate a table. This table is created based on ...
3
votes
2answers
642 views

How can row estimates be improved in order to reduce chances of spills to tempdb

I notice that when there are spill to tempdb events (causing slow queries) that often the row estimates are way off for a particular join. I've seen spill events occur with merge and hash joins and ...
0
votes
2answers
214 views

Does a SQL Server job run on the server or the local machine?

Does a SQL Server job always run on the server, or will it run in the context of the local machine, similar to a DTS package run from Enterprise Manager on the user's machine? The job in question ...
2
votes
2answers
709 views

Are there design patterns/best practices in writing dynamic SQL in stored procedures? [closed]

I'm an experienced programmer but I'm new to SQL/databases so please bare with me :). One of my current tasks involve editing (and refactoring, if needed) a dynamic generated SQL statement in a ...
2
votes
3answers
651 views

Does Change Data Capture (CDC) work in a SQL Server 2012 AlwaysOn Failover Cluster Instances setup?

Does Change Data Capture (CDC) work in a SQL Server 2012 AlwaysOn Failover Cluster Instances setup? There would be two nodes in the AlwaysOn Failover Cluster Instances setup and two Domain ...
-2
votes
0answers
194 views

SQL server 2012 upgrade causing reindexing to take a long time / fill up log file [closed]

I have a customer who has upgraded their SQL Server from SQL Server 2005 to SQL Server 2012. According to them, no other changes were made. They have an ERP database which does a full reindex once a ...
0
votes
0answers
451 views

Creating Superset and Subset table with relationship mapping

I have requirement in one of the project where different entities like Teacher,School,Student Store addresses in single table and maintain their relationship. Example -School can add teacher and ...
7
votes
2answers
614 views

Is a geographically distributed application with SQL Server replication a good idea?

We are currently thinking about a target architecture for a geographically distributed application. This application tracks and schedules the movements of all material units across various production ...
0
votes
1answer
61 views

Merge subscription behaviour

I have a merge subscription with the ExchangeType parameter set to 1 (upload only). Rows are transferred to the publisher as expected. If I delete a row at the subscriber, the corresponding row at ...
8
votes
1answer
3k views

Parent-Child Tree Hierarchical ORDER

I have to following data in SQL Server 2008 R2. SQLFiddle Schema: CREATE TABLE [dbo].[ICFilters]( [ICFilterID] [int] IDENTITY(1,1) NOT NULL, [ParentID] [int] NOT NULL DEFAULT 0, ...
1
vote
1answer
127 views

Does DBMS (e.g. of SQL SERVER 2008) use virtual memory?

Or in other words ... . Does the DBMS somehow circumvent the OS Cache manager and acccess the memory directly OR it lets the OS do its job, behave as a normal process and use the concept of virtual ...
4
votes
2answers
2k views

Reduce Clustered Index seek cost SQL Server 2008 R2

I am running a query and it have records in lakhs, it takes more than 20 mins to fetch data. After running the execution plan i noticed that clustered index seek cost can be be the reason. How can I ...
7
votes
3answers
4k views

How to see what is cached in memory in SQL server 2008?

Is there a way how to find out what is cached in SQL Server 2008 R2? I have found the following nice article: ...
3
votes
2answers
432 views

How large will the Transaction Log backup be?

I encountered a production database of 12 GB with a log of 90 GB. Full and differential database backups are made with a third-party backup tool, but no one is backing up the transaction log so it got ...
0
votes
1answer
175 views

How to add custom sequence number in table which is going to be populated automatically

I have table something like this CREATE TABLE [dbo].[ado_test_table]( [id] [int] IDENTITY(1,1) NOT NULL, [tip] [varchar](10) NOT NULL, [datum] [datetime] NOT NULL, [doc_number] [int] ...
1
vote
1answer
401 views

Autogrow of database1_log file in database database1 took 1010871 milliseconds

in past i had a problem of that query been executed for 7 days. i couldnt find any solution. so i created again new database with indexes. Now i am running a simple query: UPDATE query query has ...
0
votes
5answers
2k views

Copy a SQL Server database from one server to another on demand

I have two servers, Prod and Test, both running SQL Server 2008 RTM. Is it possible to have a PowerShell- or VBScript that could copy a database from one server to another? The copy should of course ...
2
votes
1answer
268 views

How long takes populating catalog in SQL Server 2008 R2 when update a row?

I have installed SQL Server 2008 R2 with FullText search feature installed. I created a catalog and fulltext index on a table (let's say Table1). I used the following commands (sql queries): USE ...
1
vote
1answer
188 views

Sql Server 2012 and native client 10

What is the difference between SQL Server Native client versions 10 and 11? Can I use Native Client 10 with SQL Server 2012 running?
4
votes
2answers
665 views

How to setup SQL active/active cluster to achieve Blue / Green instance switching?

I am wondering if anyone has ever used a multi-instance cluster (nee 'Active/Active') to achieve blue/green (or A/B) deployment scenarios, and what the best way of configuring it is (using SQL 2012 / ...
2
votes
0answers
205 views

Linked Server Login Timeout but SqlCmd works

I've got a SQL 2005 SP4 server that connects to a 2008 SP3 instance via linked servers using the SQL Server server type. Every once in a while, one of those linked servers will start throwing login ...
3
votes
2answers
377 views

Autogrow. Primary vs additional data files

My databases all use autogrow, which grows the primary MDF file on a percentage. But one of the databases, from a third party application grows by adding additional .NDF files. Where is this option ...
5
votes
4answers
482 views

PK as ROWGUIDCOL or use a separate rowguid column?

There's a long-winded debate going on here so I'd like to hear other opinions. I have many tables with uniqueidentifier clustered PK. Whether this is a good idea is out of scope here (and it's not ...
1
vote
1answer
99 views

How can I achieve a unique constraint with two fields? [duplicate]

I have a table with e.g. Name and IsDeleted fields. I want to add a row constraint so that only one Name value can have IsDeleted as 'false'. There can be many duplicate Name values, but they must all ...
4
votes
1answer
39 views

Verify Query Request Received

I have a software system which queries data via OLEDB from an external SQL Server 2005. The query request is sent every 15 minutes. I want to verify that the SQL Server is receiving the query ...
4
votes
2answers
85 views

Partitioned Views - Storage of Indexes

I have a single table that contains 4 billions rows that I plan on splitting up in to separate tables for each Quarter of the year. Then I want to create a partitioned view across all tables. At the ...
0
votes
1answer
720 views

SSIS Adding column to excel sheet template destination when importing from SQL Table Source

I have an excel sheet template that has 3 columns. I also have a SQL server table that has the same 3 columns plus an additional 4th column. I need to import all 4 columns from the SQL table into the ...
3
votes
3answers
461 views

Cannot open SQL Server profiler file

Scenario Debugging a failed transaction, I asked the DBA to run a trace on SQL Server. Eventually he send me a .trc file. Issue I use the fn_tracegettable() function to access the trace: select * ...
2
votes
1answer
201 views

SQL Server full safety mirror commit overhead less then Time to send?

How is it possible that the time to send value is greater then the mirror commit overhead? The mirror operates under full safety so this means that the commit is only done @ principal when the commit ...
6
votes
1answer
749 views

How to set SQL Server index pages per fragment?

I have SQL Server 2008, and a number of databases. I have discovered that one of my table's indexes is extremely fragmented (How I know: http://msdn.microsoft.com/en-us/library/ms189858.aspx) The ...
4
votes
1answer
366 views

Performance impact of sp_configure blocked process threshold change

I've been tasked with identifying any blocking happening on a production server. My plan to achieve this is to use EXECUTE sp_configure 'blocked process threshold', 5 In combination with a server ...
0
votes
1answer
135 views

When creating remote BLOB store is “RBSFilestreamFile” always the name of the file to be added to the FILEGROUP?

When creating a remote BLOB store in SQL Server (2008 R2) is "RBSFilestreamFile" always the name of the file when adding it to the FILEGROUP like in this query (this is the name I've seen used in ...
5
votes
1answer
149 views

Execute output from query

I've got this query that builds my drop login statements. As part two I want to execute this output. Ideally I want to do this in a sql job with two steps (generate and execute). Can this be done? ...
0
votes
2answers
97 views

SQL Server 2005 xp_sendmail error

I have come across a SQL 2005 server that uses SQL mail to send emails. This setup works fine as long as the MAPI profile points to an Exchange 2003 server, but breaks when the profile points to an ...
3
votes
3answers
6k views

Does SQL Server CASE statement evaluate all conditions or exit on first TRUE condition?

Does the SQL Server CASE statement evaluate all the WHEN conditions or does it exit once it finds a WHEN that evaluates to true? If it does go thru the entire set of conditions does that mean that the ...
-1
votes
2answers
855 views

Error installing SQL Server 2008 - all componets installed successfully except database engine

Below is the error I copied, please someone help me, I have tried at least 10 times in the last 3 days. It is SQL Server 2008 R2 and I wanted to install it on Windows 7. Microsoft SQL Server 2008 ...
0
votes
1answer
111 views

Efficient way to fetch records since a given criteria

I'm trying to implement a logic where the user can say give me n records since a given id#. E.g. SELECT TOP (100) col1, col2, ... colN FROM Table1 WHERE ID > @id ORDER BY ID Performance is the ...
11
votes
2answers
369 views

What throughput should I expect with MPIO?

Dell PowerEdge 2950 with two 1 Gbps NIC's going to two 1 Gbps ports on a switch which then goes to a NetApp with four 1 Gbps NIC's that present as one virtual interface. 24 drives, 7200k SATA, NetApp ...
1
vote
1answer
433 views

SQL Server 2008r2 Enterprise evaluation expired - Options?

I have a client that has a recently expired SQL Server 2008r2 Enterprise Evaluation edition. I've been tasked to get it licensed and running SQL Server 2008 r2 Standard. How can I achieve this?
0
votes
2answers
116 views

Aggregate query on multiple values of same field

I am using SQL-Server 2012, I have a table of credit card transactions as follows: CardScheme RespCode ========================= Visa Declined MasterCard Approved MasterCard Approved ...
6
votes
2answers
952 views

Turning OFF CHECK_POLICY by default

We moved from SQL Server 2000 to SQL Server 2005. The client software, which I can not change, creates a user without option CHECK_POLICY = OFF; After creating a user, I have to run the command ...
0
votes
1answer
1k views

Oracle database link via ODBC to SQL Server does not recover automatically

I have a test environment with an Oracle 10XE database which is linked to an SQL-Server 2005 via an ODBC data source. For reference here I named the connection MSSQL_LINK. The production environment ...
0
votes
1answer
416 views

The UPDATE permission was denied on the object

I'm connecting to a remove Microsoft server running MsSQL via PHP. The code looks something like: $con = mssql_connect('0.0.0.0:123', 'user', 'pass') or die(log_mssql_error(__FILE__, __LINE__, ...
6
votes
1answer
237 views

Failed copy job deletes all users

Since the progression of this was apparently somewhat difficult to follow the first time around: I attempted a completely boring, been-done-a-thousand-times-before copy of a database using the copy ...
0
votes
2answers
135 views

Is there any way to connect to one server and utilize a linked server using Windows authentication and NTLM?

I currently have SQL Server 2005 (Server A) that has a SSAS 2005 linked server (Server B). The powers that be do not want to enable Kerberos authentication, so I'm stuck with NTLM. The problem is ...
0
votes
2answers
128 views

Addtional configuration when deploying Data Tier Applications?

I'm starting a few new database projects and I'm attempting to create them at Data Tier Applications. There are two items I'm not able to find documentation for. I would like to set the db owner to SA ...
3
votes
2answers
703 views

sp_executesql adds statements to executed dynamic script?

The Question: As far as I can tell, sp_executesql adds statements to the beginning of submitted dynamic SQL script. But, a SQL Profiler trace does not capture the extra statements, and neither does ...
6
votes
1answer
256 views

Strange behaviour DBCC Shrinkfile

I am attempting to run a dbcc shrinkfile in chunks of 1GB against a database where 95% of the data has been archived and deleted. I'm leaft with a 235GB file where 9GB is data/indexes. I want to ...