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)

-9
votes
0answers
23 views

Mirroring error #1418 [on hold]

I have configured mirroring in server without witness but I am getting a error no 1418 please suggest how to solve it. Even if I tried to create a endpoint but I couldn't create it.
1
vote
1answer
29 views

How do I transfer logins from 2008R2 to 2014 with passwords?

I've tried Tasks>Generate Scripts... and set 'Script Logins' in the Advanced Scripting Options, but I get this in the output: /* For security reasons the login is created disabled and with a random ...
0
votes
2answers
47 views

Memory Allocation in Shared DB & IIS Environment

In my use case, we have production servers that host both IIS & SQL on the same machine, not ideal but no flexibility to change that. Basically a single machine is both a DB and an Application ...
1
vote
2answers
74 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
0answers
23 views

Possibly tempdb out of space or a system table is inconsistent

While running DBCC CHECKDB I got this error Msg 8921, Level 16, State 1, Line 1 Check terminated. A failure was detected while collecting facts. Possibly tempdb out of space or a system ...
2
votes
2answers
67 views

Perform admin tasks (e.g. create database, add diagram support) in SQL Server when not connected to domain

My situation: I have installed SQL Express on my machine, while logged in as a domain user. I work remotely so I need to connect to a VPN to be on the domain, but I often prefer not to work while ...
1
vote
1answer
67 views

Snapshotting Database Tables

I have a reporting database (in SQL Server) that takes nightly snapshots of the production data (Oracle) for users to query against for the next day, but now the requirement is getting to be that they ...
0
votes
0answers
8 views

Dynamically REVOKE CONNECT FROM guest in SQL Server 2005

I wrote this simplistic script (I'm not very familiar with TSQL and dynamic SQL) to revoke all connections from guest accounts: DECLARE @database_id int, @database_name nvarchar(100); DECLARE ...
11
votes
3answers
166 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 ...
3
votes
1answer
248 views

Shared locks taken under Read Committed Snapshot Isolation (RCSI)

I am seeing waits for shared locks (LCK_M_S) when using RCSI. My understanding is that this isn't supposed to happen since SELECTs do not require shared locks when using RCSI. How can I be seeing ...
1
vote
3answers
30 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 ...
2
votes
0answers
27 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
38 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 ...
0
votes
2answers
983 views

SQL Server to Oracle export using Microsoft OLEDB Provider for Oracle

I am trying to Export Data from SQL Server to Oracle using the "Microsoft OLEDB Provider for Oracle". I am using "Export Data..." option from Task menu. I get to connect to the source database (SQL ...
1
vote
1answer
35 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
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 ...
-1
votes
0answers
39 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 ...
2
votes
2answers
210 views

Migration to databases Domain Users do not have access

I migrated databases to new servers, however the applications that were previously used with the databases are failing to load. I have changed the connections and etc. The jobs also seem to be ...
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 ...
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
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 ...
2
votes
1answer
222 views

Does openquery use distributed transactions?

Does openquery in SQL Server 2005 use distributed transactions? If so, in which cases does it?
3
votes
2answers
64 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. ...
3
votes
1answer
85 views

Error trying to open database

The database is for ms exchange. I am getting the following error. Any ideas guys?
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 ...
1
vote
0answers
28 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
1answer
39 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 ...
10
votes
4answers
14k views

How do you kick users out of a SQL Server 2008 database?

We need to do a restore, and cannot because other users are connected. We thought we had disconnected every process, but apparently not. How can we, from Management Studio, kick off everyone else so ...
0
votes
1answer
30 views

Who and when were changed Database default location settings?

I need to know when and who changed SQL Server Database default location settings. How can I do that?
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
0answers
50 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 ...
0
votes
3answers
402 views

Merge Replication identity field issues

One of our clients is using our software with merge replication of a database on a SQL Server 2008 R2 machine. There are two production environments in separate geographical locations only one of ...
1
vote
1answer
143 views

Why SMO's Transfer tries to login into linked server when scripting?

Consider this code sample: var sourceDatabaseConnectionString = "Data Source=MyServer;Initial Catalog=MyDatabase;User Id=MyLogin;Password=MyPassword"; var serverConnection = ...
4
votes
1answer
182 views

ERWIN create and use database

Im trying to generate physical database from my logical model using ERWIN 7. All is well in the script that is generated automatically, there is only the problem that the model is created in the ...
3
votes
2answers
1k views

Linked Server Query Results: OPENQUERY vs Distributed Transactions

I have two databases. They are on different servers. One is named REPORTDB and the other is named TRANSDB. TRANSDB is referenced as a linked server on REPORTDB named TRANS. I execute a query like ...
0
votes
2answers
764 views

Create an Audit trail on SQL Server 2008 to trace all privilege users

I need to create a trace of all the commands issued by members of SysAdmin or SecurityAdmin server Roles. I figured, I could use Profiler to do that but it will not comprise all the added members. I ...
0
votes
0answers
20 views

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

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 ...
3
votes
4answers
775 views

SQL Server audit query that fires a trigger

Using SQL Server, does exist a way to audit from inside a trigger the sql that fires it? I need to know the SQL query that fires a trigger over a database without a profiler. Thanks
4
votes
3answers
2k views

How to compare two SQL Server 2008 configurations

I have a problem with my application that works on my dev SQL Server 2008 (Developer Edition), but not on a production SQL Server 2008. Is there an easy way to export the settings from the production ...
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
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 ...
2
votes
2answers
48 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 ...
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 ...
9
votes
5answers
329 views

Efficiently Filter Large Set With Disjunctions

Let's say I have a single table CREATE TABLE Ticket ( TicketId int NOT NULL, InsertDateTime datetime NOT NULL, SiteId int NOT NULL, StatusId tinyint NOT NULL, AssignedId int NULL, ...
15
votes
4answers
4k views

Using SQL Profiler on a database that's in production

As a developer, I use SQL Profiler quite often. It's a good debugging tool, both to track what my code is doing and to analyse performance problems. But I've always used it on my development ...
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 ...
-2
votes
2answers
45 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 ...
1
vote
1answer
48 views

SQL Server Express Freezes for a couple minutes

I have SQL Server Express on an AWS micro instance. These instances have only 615MB of RAM. For the most part it performs fine. My application can make up to about 15 db connections. However, every ...
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 ...
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 ...