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
36 views

In SQL Server, should I force a LOOP JOIN in the following case?

Typically, I recommend against using join hints for all the standard reasons. Recently, however, I have found a pattern where I almost always find a forced loop join to perform better. In fact, I am ...
1
vote
0answers
23 views

Phantom Transactions using Version Store in tempDB

We are seeing version store space increasing on one of our servers, and there are ~20 sessions that are showing as actively accessing version store rows for over 24 hours. The problem is, when I try ...
0
votes
0answers
33 views

OUTER APPLY vs LEFT JOIN

I'm working on the query bellow. Its structure is based on someone else's similar query... SELECT tptype.Code AS ThirdpartyTypeCode, ptf.Ticker AS TextId, finIn.InternalCode AS ...
-1
votes
0answers
33 views

MS SQL Server Implement Limit Functionality

I am facing problem to implement the pagination on grid. Actually after applying all the filter we get 3000k records from database but if pull the 3000k data the query take time so I am showing only ...
1
vote
1answer
30 views

Looking for ideas on maintaining data warehouse in close to real-time - ETL tools, etc

I have done a fair number of traditional data warehouse implementations where the loads were done in a batch-oriented manner, i.e. the data is refreshed nightly or, at most, every few hours. I now ...
0
votes
1answer
32 views

What data will be lost with DBCC CHECKDB (REPAIR_ALLOW_DATA_LOSS)?

I have a corrupt database. The last known good backup was over 2 weeks ago. I've run a CHECKDB and have the page numbers where SQL Server located the corruption. I've looked at the data on the ...
1
vote
1answer
61 views

What is the best way to get all data for a date range, plus the last event just before the range?

For this question assume the following: There is a table of events [Event] There is a table of employees [Employee] There is a table that relates the two [EventEmployee] (EventID + EmployeeID) Each ...
1
vote
1answer
27 views

Avoiding entitized characters when using FOR XML PATH for string concatenation

I have this query: SELECT DISTINCT f1.CourseEventKey, STUFF ( ( SELECT '; ' + Title FROM ( SELECT DISTINCT ...
1
vote
1answer
41 views

Error checking with sp_send_dbmail

This question is kind of multifaceted. First, what I'm trying to actually accomplish: I am in an environment where there is not really heavy data validation on inputs. So there is lots of opportunity ...
1
vote
0answers
27 views

Profiling parameters

I was trying to fine the parameters of a query I suspect to be causing unnecessary logical read and eventually captured it in profiler, however parameters @p3 and @p4 are not listed. Is anyone able ...
1
vote
3answers
29 views

New SQL Server 2008 instance, load old instance DB's

BACK STORY: I'm a developer with a local instance of SQL Server 2008 on my workstation. I just recently upgraded my motherboard and found out (much to my dismay) the old motherboard's RAID drivers ...
0
votes
0answers
49 views

A rollback on a production server that's been running too long

I have a problem with a production server that is causing considerable locking and performance degradation. It all started the night of Tuesday into Wednesday with a procedure that inserts data into ...
1
vote
0answers
29 views

Using #temp to work around Reporting Services blocking issue

Having utterly failed to resolve why a perfectly acceptable but admitidly large stored procedure was suffering the blocking process lck_m_s when called via a report in SQL Reporting Services I have ...
0
votes
1answer
20 views

SQL Server Permission [duplicate]

I installed SQL Server, I deleted my windows user account, now I'm trying to access SQL Server using administrator account but it could not connect. It throws error like this The database TEST is ...
3
votes
2answers
61 views

Intermittent RESOURCE_SEMAPHORE_QUERY_COMPILE Wait Stats

I'm trying to troubleshoot some intermittent CPU spikes that we're witnessing on one of our production SQL Servers. We're running SQL Server 2008 R2 Standard Edition with 28 GB RAM and 4 CPU cores. ...
0
votes
0answers
18 views

How can I find which records of `Data Warehouse` must be updated according to CDC captured changes?

I use SQL Server 2012 for OLTP Database and created a Data Warehouse in SQL Server 2012. I design Facts and Dimensions inside Data Warehouse with several Views. Some of my Fact table are made by ...
2
votes
2answers
47 views

Creating Clustered Index uses all my tempdb space. Why?

Table size = 44GB (no clustered index) Row Count = 122016576 Disk space allocated to tempdb = 200MB I wanted to create a clustered index for the table due to slow query times so I ran the ...
3
votes
0answers
49 views

Restoring differential backup creates DEFUNCT log file?

Here is my problem. I'm trying to move a database to a new server via a full restore, then cutover with a quick differential backup/restore. I can do a full restore without a problem, but when ...
0
votes
1answer
12 views

Oprhaned entries in msdb..sysjobactivity

In this question: http://stackoverflow.com/questions/18445825/how-to-know-status-of-currently-running-jobs This answer was proposed: SELECT sj.name , sja.* FROM msdb.dbo.sysjobactivity AS sja ...
0
votes
0answers
14 views

ODBC Crash try add a DSN System connection

I get the following error: odbc administrator a problem caused the program to stop working correctly. The windows will close the program and notifies you if there is a possible solution I get ...
1
vote
1answer
37 views

How Automatic Failover Works (AlwaysOn)

I'm going to use AlwaysOn technology on my servers, but it's some unclear points in the documentation: Automatic failover looks like Primary replica (A) unaccessable Secondary replica (B) becomes ...
-2
votes
2answers
44 views

Index is not used with same Query on two Servers

I have two notebooks with same specs (same model, only ram is 24GB/32GB, same ssd) and exact same database and same sql server version. SQLIO is 3300 and 3600. Now I run a query on one notebook and ...
0
votes
1answer
13 views

Why can't I access IIS Manager on my server with Reporting Services installed?

I have a Windows Server 2008 Server running SQL Server 2012 (including SSRS). I've noticed that the site is intermittently slow on first run, and found this blog post about the cause and how to fix ...
1
vote
1answer
36 views

Optimistic Paging and separate query for COUNT?

I am using SQL SERVER 2012 FETCH/OFFSET after searching a lot that this will give me the best performance. But for paging to work, I need a Total count. There are 2 ways to achieve this. 1) Paging ...
1
vote
2answers
39 views

Order of maintenance plan tasks

Please could you tell me the correct order of maintenance plan operations in SQL Server? Check integrity Update statistics Rebuild indexes Is correct this order?
1
vote
2answers
43 views

Casting fails on subquery result

I'm in a bit of a pickle, I have to perform a query on a database with rather poor data quality. I am trying to evaluate a field which contains a date, but which was defined as a nvarchar. I thought I ...
0
votes
4answers
30 views

SQL Server 2005 database log size increasing drastically? [duplicate]

My friend works in a company (pretty small in size) that is running SagePro ERP which has a SQL server 2005 database. Now the problem is, the database size (over the period of 7 years) has increased ...
1
vote
1answer
44 views

SQL Server query disk write/sec limit

I am facing an issue which it looks like the server is hitting disk write limit. But after some test, I realize it wasn't. I was running the following query: DECLARE @MyCounter int; SET @MyCounter = ...
0
votes
0answers
16 views

Adding a new partition to the partitioned table is skipping the last filegroup

I have created one partitioned table and trying to add a new partition to that. I ran the following scripts to create a new filegroup and add a new partition to the table. But when I run the alter ...
0
votes
0answers
21 views

Table with multiple lookups

I bet this may be a duplicate and I'm not forming the question correctly, so feel free to point me in the right direction. Background We have a SQL Server with some legacy data. They're all ...
1
vote
1answer
41 views

Use of NOLOCK with CDC capture tables

In using SQL Server's Change Data Capture, I notice that the fn_cdc_get_all_changes_... table valued functions all use NOLOCK when querying against the capture tables. Is this a recommended practice ...
1
vote
1answer
27 views

Database cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery

I have received a database file and the instructions for loading it is to install SQL Server 2005 and then attach it using SQL Server Management Studio. After installing everything, I tried to attach ...
1
vote
3answers
40 views

Programatically copying data from table from offline database to online database [on hold]

I have a local database and an online database. When i make an entry into my local database, it should also automatically make an entry in the online database. Can anybody tell me how I can do that?
1
vote
2answers
39 views

Loop through all databases and remove all users

We are doing a conversion from one system to another which is requiring backup/restores. I am trying to create a process that will remove all users after the restore on the new servers as no user ...
2
votes
1answer
49 views

Clustered composite key high fragmentation and fill factor

I've recently made a table to hold the language preferences of my users as follow: CREATE TABLE [dbo].[systemUserLangPreference]( [systemUserID] [int] NOT NULL, [langID] [int] NOT NULL, ...
1
vote
1answer
27 views

Translating a query from MS Access to SQL Server

I have a legacy query from years ago that was written for an MS Access backend: DELETE category.* FROM category LEFT JOIN product_category ON category.id = product_category.categoryid ...
0
votes
0answers
19 views

sql server 2000: no longer able to expand jobs in sql server agent

In SSMS on a Windows 7 machine, while connecting to a server running SQL Server 2000, I am no longer able to click on the Jobs to see the Object Explorer Details. Previously, this was not an issue, ...
0
votes
3answers
67 views

Get first login-Hit on huge table

I have table like this in my database : ID (pk,int,not null) UserID (int,null) HitDate (datetime,null) Every time a user has any transacation in my application one hit inserted in this table. ...
0
votes
1answer
51 views

data warehouse design help

I'm struggling with the design phase for a data warehouse. It's not the traditional sales example you find on MSDN or all books etc. I've been tasked with creating an education data warehouse, that ...
1
vote
2answers
29 views

Location of #th iteration of a character or a word in a sql text field

How can I get the location for the #th iteration of a character or a word in a sql server text field?
2
votes
3answers
67 views

Listing indexes and constraints

I am looking at a SQL Server database for an application I have inherited. I have not looked into SQL Server for approximately 10 years, so please bear with me. The database table I am looking at has ...
0
votes
1answer
30 views

Slow performance of remote restore

Over the weekend, I was participating in a DR test. On the database side, that meant restoring backups from the production system to the DR system. What struck me as odd about the performance of the ...
1
vote
3answers
49 views

Inserting Serbian Latin and Cyrillic characters

I am using SQL Server 2012 Express as part of my asp.net development workstation. Database and table collation is set to Latin1_General_CI_AI. Attribute types are nvarchar(max) and varchar(max). ...
1
vote
1answer
35 views

Spy sql queries generated by an application

I need to know what SQL queries is generating some application. It is possible to see it in some kind of sniffer or what? I tried look in Management studio, but it shows only most expensivie queries.
-3
votes
0answers
40 views

SQL Server 2014 v/s NoSQL(MongoDb, RavenDb, CouchDb) [on hold]

Now SQL Server 2014 is out and there is lot of excitement regarding SQL Server 2014. How can we compare SQL Server 2014 v/s NoSQL(MongoDb, RavenDb, CouchDb)?
5
votes
2answers
186 views

Why do Indexed Views not permit non-unique clustered indexes?

I've been looking into using Indexed Views to increase performance on a few of our most commonly used views. However Indexed Views do not support non-unique clustered indexes which goes a little ...
1
vote
1answer
37 views

Full text index search returns an unexpected result

When I search TaxIdentityNumber using contains an unexpected result is returned; the result contains numbers that are not matched to query. For example, I search using '"5689523657*"' and get ...
0
votes
1answer
14 views

SQL Server distrb.exe & Logread.exe using huge SQL.txt file in C:\Users\sqlsrvacct\AppData\Local\Temp folder

I have the following situation: SQL server 2008 R2 SP2 I have both the Distribution and Subscription database in this server. LogReader agent and Distribution agent are running in continuous mode the ...
0
votes
1answer
39 views

TSQL change column constraint between null and not null

I am doing a exercise to change a column's constraint between null to not null. Table name: Production.categoriesTest. Please review my question and give me suggestion on what I did wrong and how to ...
2
votes
2answers
45 views

Running query progress indication

I have a query: SELECT * FROM OPENQUERY ( oracle, 'SELECT * FROM [some_table]' ) It runs for about 7 hours. I only need to run this query once to import data into a new system when we ...