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
3answers
691 views

Simple XML .query SELECT statement times out on 1 SQL SERVER instance

I dropped and recreated a stored procedure on a DB on a SQL Server 2012 instance (SERVER1/INSTANCE1), after which the sproc started hanging on a line. Using profiler I have reduced a recreateable ...
1
vote
0answers
607 views

Linked server error when querying one table

I am running 2 queries using the same linked server. SELECT * FROM [SERVER].[Customer].[dbo].[ccr_AxCust1] SELECT * FROM [SERVER].[Customer].[dbo].[ccr_AxCust2] For Query 1 this returns results ...
0
votes
2answers
294 views

“an agent job has not been created for this subscription”

I have set up merge replication with a publisher on my SQL Server 2008 R2 box with the distributor on this box too; in Express I have created a subscriber but the subscriber won't run because of the ...
2
votes
2answers
155 views

Is there really any benefit in wrapping random ad-hoc queries in a transaction?

I am no db expert, but I was very surprised when someone working at our client's company asked us to send all queries wrapped in a transaction like below: SET TRANSACTION ISOLATION LEVEL READ ...
-1
votes
1answer
607 views

Totals Column - Blank if Zero or NULL

A report currently computes a "totals" column like so: ,CASE WHEN ISNULL(CLM_BREAKFAST_TYPEA.MealsA, 0) + ISNULL(CLM_BREAKFAST_TYPEB.MealsB, 0) = 0 THEN '' ...
3
votes
1answer
756 views

Displaying Parent Child Information, With Certain Parent Columns Only Shown Once

For a TSQL report, I have a one-to-many parent-child relationship. I want to report both parent and child relationships in the same report, like so, with the parent columns on the left and child ...
3
votes
2answers
2k views

SQL Query too slow on SUM function

I've a table with around 32 million rows having clustered unique index on CountryID,RetailerID,ProductID,DateID,EventID,TypeID and query is SELECT f.RetailerID , TypeID ...
2
votes
1answer
141 views

CTE query doesn't print the right structure?

I have this table which represents hierarchy : childID parentID NAME siblingOrder 1 1 a 0 212 1 ab 1 112 ...
0
votes
1answer
509 views

Selecting from an excel spreadsheet into SQL Server table

This question has been asked before but I tried giving full admin rights to the SQL Server user on C:\temp\ folder location (I am using Windows authentication into SQL Server Express). So for the ...
1
vote
1answer
2k views

Permissions using .NET SqlDependency

SQLDependency Notifications work fine logged in as Windows Domain User, using Trusted Connection. But not as SQL-User: I created a db login, user and role as follows: CREATE LOGIN myLogin WITH ...
0
votes
1answer
249 views

FTs catalog in SQL Server for multiple FT index

I have created one catalog for FTS index, can the same catalog be used by by another table in index.
0
votes
3answers
2k views

SQL Server Database grew too much too fast

I have an issue with one database. The issue is as follows: The database is being running on SQL Server 2000 Standard for the last 6 years in Full Recovery mode. In the beginning of this summer the ...
1
vote
2answers
205 views

How do I track why my SQL Azure occupied space pulsates?

This is inspired by this StackOverflow question. I have this code: SELECT CONVERT(INT, SUM(reserved_page_count) * 8 / 1024) FROM sys.dm_db_partition_stats for detecting database space consumption ...
1
vote
3answers
419 views

Getting the information that exists in “Job properties -> Notifications” page?

I use SQL Server 2008 R2 and I need get some properties from the msdb database. I need a query to get information that exists in the Job properties -> Notifications page. In which table I can ...
1
vote
2answers
1k views

How do I unload data from a database to a flat file?

I am aware of the concept of bulk insert wherein I load data from a flat file to a database. Now I want to unload data from a table to a flat file, i.e. I want to export data in a table to a flat ...
1
vote
1answer
112 views

who i can join msdb.dbo.sysalerts table with msdb.dbo.sysoperators table?

i use sql server 2008 r2. and i want create script of my jobs. i need find all object that exist in one job. To achieve this goal, i get all operators whit this query Select O.* From ...
2
votes
1answer
144 views

How can I connect to a database after its disk has come back online?

I have problems with database after reconnecting a hard disk: .Net application works with database. Disconnect hard disk with physical files. Make any request to the database (of course we will have ...
1
vote
2answers
6k views

How do I view a Microsoft SQL Server Compact Database

I have installed SQL Server 2012 Enterprise Edition. I can use SQL Server Data Tools to add databases and tables and query tables etc. Next, I used Visual Studio to try out a tutorial on creating a ...
3
votes
2answers
164 views

Moving a database to a new server

My database server is being decommissioned at work. We have a new database server to take its place. Both servers have the same operating system and SQL Server 2008. I need to move all my databases ...
-2
votes
2answers
924 views

How to improve TempDb on RAMDisk showing performance on par with physical hard drive [closed]

Given 2 SQL Server Instances where the second instance is configured with a RAMDisk for tempdb and the following test case. -- Create source data select top(1000000) * /* ~10 cols */ into #t1 from ...
6
votes
2answers
4k views

How to optimise T-SQL query using Execution Plan

I have a SQL query that I have spent the past two days trying to optimise using trial-and-error and the execution plan, but to no avail. Please forgive me for doing this but I will post the entire ...
-2
votes
1answer
1k views

Importing delimited files into SQL server [closed]

I am trying to import a large file into SQL server that is | delimited. I know basically nothing about the data, I just want to get it imported. When I go to Database->tasks->import I use the ...
1
vote
3answers
3k views

Import .bak file in Microsoft SQL Server 2008 Service Pack 3 [duplicate]

I have a backup of my database as a TestDatabase.bak file but I am unable to restore it. When I try to restore I receive the following error message in SSMS: RESTORE could not start database ...
1
vote
1answer
59 views

Make database use more than one file

I have to following problem: since my database runs out of memory in a few days, I am looking for a way how to make the database use more than one file. I would like to store upcoming data in another ...
0
votes
1answer
105 views

Describe Interim Table and Basic Concept behind it?

Hy Everyone... Can anyone describe me what is interim table in sql Server 2008? what is the basic concept and structure behind it. thanks in advance.
10
votes
3answers
6k views

general memory requirements for sql server 2008 r2

I'm not experienced with DBA work, but I'm trying to make a case for requesting additional resources for our sql server and was hoping I could get some smart folks to provide a rough rough estimate of ...
2
votes
5answers
17k views

Why is SQL Server consuming more server memory?

Sqlserver is consuming 87.5 % of my server Ram. This recently causes alot of performance bottleneck such as slowness.I Research on this issue. One common solution i could find on the internet is to ...
1
vote
0answers
132 views

Inline TVF with One Row Result

I have several times converted scalar functions into inline tvf. Usually this is the basic design I used in inline tvf: CREATE FUNCTION TVF(@ID INT) RETURNS TABLE AS RETURN( WITH BASE AS( ...
8
votes
3answers
3k views

Does disconnecting the network stop a query?

I recently executed an update query against 100,000 records. I realized I'd made a mistake while the query was running and quickly unplugged the network cable. Does the update query stop ...
3
votes
2answers
6k views

Connect to SQL Server 2012 from an Windows XP client

We have an SQL Server 2012 Standard database, to connect to it we use SQL Server 2008 Management Studio (since 2012 SSMS is not supported on Windows XP). The problem is that SQL Server 2008 gives all ...
3
votes
3answers
2k views

Select rows after a specific ID

I have the following query, it chooses from a news articles table. Due to multiple sorting factors, I cannot locate the next page of date. The parameter I have is the last ID in the query result set, ...
4
votes
1answer
340 views

Changing autogrow settings with database mirroring

Recently I changed the Autogrow settings for some of the databases on our SQL Server 2008 R2 server. These are involved in a database mirroring configuration, with the principal on SERVER1 and the ...
4
votes
1answer
78 views

Transfer logins to another server

I moved a database from SQL Server 2005 to SQL Server 2012. Is there any way of restoring all the logins on the new server?
3
votes
2answers
138 views

SQL Server logs in Gmail

First off, I'm using SQL Server 2008 R2. When I set up my maintenance plan and got to the "Select Report Options" step, I selected to email the report to the Operator I already have set up. This ...
1
vote
1answer
2k views

Reporting Services TempDB keeps going into restoring mode

I am looking into an issue with SQL Server 2008 Reporting Services. It has been working fine until yesterday morning. Now I notice that ReportServerTempDB keeps on going into Restoring... mode. I ...
3
votes
4answers
3k views

Can I force a user to use WITH NOLOCK?

Can I force a user's queries to always run with the hint NOLOCK? e.g. they type select * from customer But what is executed on the server is select * from customer with (nolock) This question is ...
6
votes
3answers
530 views

How to determine Windows Server start time using T-SQL

I am looking for a way to find out when the Windows Server was last started using only t-sql commands. I am trying to stay within the default security configurations (i.e. I don't want to enable ...
2
votes
1answer
2k views

ORDER BY items must appear in the select list […]

Using Microsoft SQL Server 2008, I get the following error. Msg 104, Level 16, State 1, Line 43 ORDER BY items must appear in the select list if the statement contains a UNION, INTERSECT or ...
1
vote
1answer
21 views

New instance with same @@VERSION as existing instances

I have a SQL Server 2008 R2 server with several instances installed. Is there a way to add a new instance and have it be to the same build as the existing (and updated / patched) instances?
7
votes
5answers
4k views

.bak file not visible in any directory in SSMS

I have a .bak file created today by someone else, manually created through SSMS 2008 R2. I'm trying to manually restore the database, unfortunately the file isn't appearing when I go to browse it. I ...
9
votes
2answers
796 views

DBCC CHECKDB unfixable corruption: Indexed view contains rows that were not produced by the view definition

TL;DR: I've got an unfixable corruption in an indexed view. Here the details: Running DBCC CHECKDB([DbName]) WITH EXTENDED_LOGICAL_CHECKS, DATA_PURITY, NO_INFOMSGS, ALL_ERRORMSGS on one of my ...
9
votes
2answers
2k views

When does sp_executesql refresh the query plan?

You'll have to forgive my naivety as I'm not a DBA but my understanding is that over time the statistics of a database change and a stored procedure must be recompiled to keep the query plan up to ...
1
vote
1answer
50 views

How to distinguish the current operation is done from system or from sql server management studio

We want to record who insert or update the records in sql server database, so we add "CreatedBy" and "ModifiedBy" fields. When the records is operated from the system, we can easily get the person. ...
6
votes
2answers
426 views

SQL Server Tuning a table for massive inserts

I'm trying to solve a performance issue and I need advice. I have a table, which about twice a day has a massive surge of inserts coming in, and exactly at the same time everybody is trying to read ...
0
votes
2answers
221 views

Full text catalog does not allow me to hit on singular forms

I have created a full text catalog for a column under database name -> "Storage" -> Full Text Catalogs. It is accent sensitive and "default catalog" is set to false. The language for the column ...
2
votes
3answers
5k views

overwrite table with data from another table - SQL

Our users want to refresh a QA database from production but want two tables (lets call them T1 and T2) to retain the original QA data. So I copied two tables from QA (DB1) to a temp QA database (DB2). ...
0
votes
1answer
44 views

Apply profiler template to saved log

I need to check for deadlocks in my customer's system. He provided me with unfiltered logs. Can I filter them after running the trace somehow? (I don't have direct access to his server) It seems ...
4
votes
1answer
4k views

Importing a large column (8000 chars) from Excel using SSIS

I'm trying to set up a regular import of an excel spreadsheet that we get from a vendor. I'm using SQL 2008 R2 SSIS to import it into a table. The problem connection manager is an OLE DB connection ...
1
vote
2answers
198 views

How to avoid timeouts during big DML operations

I have a big insert script I need to run. Its about 55,000 records and 160 columns. The script is already created and I can't create it again. The problem I have is that this runs for about 4 hours ...
10
votes
2answers
6k views

Need to understand parallel query execution error

Today we experienced a degradation in performance on our production sql server. Durring the time this occurred we logged several "The query processor could not start the necessary thread resources ...