Tagged Questions

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)

2
votes
1answer
269 views

Would using timestamps solve consistency issues with snapshot isolation?

I'm considering using Snapshot Isolation for some large queries being send from an Access 2007 frontend. These queries are occasionally causing ASYNC_NETWORK_IO waits, and some blocking as well. I'm ...
0
votes
1answer
197 views

Replication Monitor reports little to no latency, but my tracer token is taking hours to go from Distributor to Subscriber

I sent a tracer token through a replication job that was reporting about 2 seconds of latency about two and a half hours ago. I sent the token through because I noticed a row that was inserted on a ...
4
votes
2answers
912 views

Lock escalation problem on a trigger

I've inherited a SQL Server 2005 database that is getting 2-3 deadlocks a day. I've tracked it down to a scheduled job that runs during the day and inserts into a table with a trigger. The trigger ...
3
votes
1answer
350 views

Query requires 'Update statistics' very often in SQL Server

We have a few tables in our database. Since most of our queries are date based, we have constructed clustered index on 'date + primary key (surrogate)' combination and we enforce joins on date as well ...
0
votes
1answer
55 views

Subscriber database to be in sync using Distributor

I have database D1 as a publisher, D2 as a subscriber and they are using Distributor 'DIST' which is reside on the subscriber side. Both D1 and D2 database having DR databases called DR1 and DR2. I ...
1
vote
2answers
2k views

Get the list of all Tables, Views, Stored procedures that are not added in a publication for replication

How do i get the list of all Tables, Views, Stored procedures that are NOT added in a publication for replication?Can you help me to make the stored Proc for that?I am new to Replication....Thanks
1
vote
0answers
101 views

Transfer data from DynamoDB to SQL server 2008?

I want to transfer data from amazon dynamo DB to SQL server 2008. What are the tools or methods which can be used to do this ?
2
votes
4answers
992 views

How can I remove a bad execution plan from SQL Azure?

DBCC FREEPROCCACHE doesn't work in SQL Azure. How else can I force a plan to kick itself out of the cache in a way that won't hurt a production system (i.e. I can't just go alter tables willy nilly)? ...
1
vote
0answers
139 views

SQL server slow on Xeon machine, fast on Corei7 x990

i have searched this problem but have had no luck find any improvement. I have a complex application that used stored procedures in SQL server. Some of the stored procedures use cursors due to the ...
0
votes
2answers
141 views

Why does using a variable make a difference in performance?

I have a table that constantly doing insert, and I am trying to run a delete script to remove old record. The delete script looks like this: DECLARE @StarDate DATETIME = '2013-01-13'; DECLARE ...
8
votes
1answer
223 views

Are the cost percentages in this SQL Server plan over 100% for a valid reason?

I'm looking through the plan cache, looking for low-hanging optimization fruit and came across this snippet: Why are many of the costs listed above 100% ? Shouldn't that be impossible?
2
votes
0answers
337 views

SQL Server Internal Memory Pressure

I am trying to identify the cause of internal memory pressure. From what I have learned, Resource Monitor Ring Buffer returns an indicator for internal pressure. For example by using this query, ...
3
votes
2answers
1k views

Multiple SQL Server data files on same SAN disk

I'm currently in the process of creating a new database, and have previously only ever used a single data file and a single log file. I've done some research online regarding the benefits of multiple ...
2
votes
1answer
763 views

Database locked

I canceled a query which took too long time. After that, the SQL-Server database was locked. After I restarted SQL Server, the mode of my database was "in recovery". Now I can't access my database ...
1
vote
4answers
4k views

With SQL Server 2008, how can I roll back a transaction done some time before?

I am coding up a script to merge some accounts (and other tables) as an out-of-band customer request. All the updates will be done in a single transaction. They are all updates (no inserts or deletes) ...
4
votes
2answers
1k views

Objects in Tempdb that are not associated with a session

I have a SQL Server 2005 instance where my tempdb i apparently holding on to objects that are not in use anymore. The database has 24gb total and is apparently unable to go below 8gb in use. For ...
2
votes
1answer
128 views

how to show only changed rows

if want querying the following table : EventDateTime (DateTime), Host (guid), Flag ( bit) 2013-04-01 05:00, {id-x}, 0 2013-04-01 05:01, {id-x}, 0 2013-04-01 05:02, {id-x}, 0 2013-04-01 05:03, {id-x}, ...
1
vote
0answers
251 views

Database Timeout Error from VB Application

Recently we are receiving so many database timeout error from different servers we are using vb application -- which will use ODBC connection to connect database - here no problem when we run the ...
1
vote
1answer
498 views

What would cause extra records to be inserted during a INSERT trigger

The following trigger that joins Inserted table on itself creates multiple unwanted records: CREATE TRIGGER [dbo].[trFooInsert] on [dbo].[Foo] AFTER INSERT AS BEGIN IF EXISTS(SELECT 1 FROM ...
0
votes
1answer
1k views

Add user to sql server with the required permission

In my sql server express 2008 r2 i have about 15 login account. Now i want some about 5 users have full permission while some other 5 users with limited access to some database, and other users only ...
3
votes
1answer
375 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 ...
0
votes
2answers
4k views

How to Drop Tables using a variable in SQL Server?

DETAILS: I am trying to create a stored procedure where I can pass a variable table name through from MS-Access to tell SQL Server to Drop a table. WHY?: In my Access Database I am running a ...
2
votes
1answer
2k views

Getting error when trying to use OPENQUERY Msg 7321, Level 16, State 2, Line 1

When I run this query: SELECT * FROM OPENQUERY([XXX], 'SELECT * FROM Database.Table WHERE (MBCONO=650) AND MBCUNO LIKE a%' ) I get the error: ...
1
vote
3answers
2k views

Database user permissions: GRANT VIEW DEFINITION but DENY on some object types

I'm trying to figure out a combination of permissions that will allow a partner to see basic db schema but not expose objects including code. So, VIEW and SELECT on TABLES (including keys) ...
1
vote
0answers
1k views

connect sql server using windows authentication in another pc

I am having sql server 2008 r2 express installed in a PC. I have some other PC which are connected to this pc in a local network.Now those PC connect to my pc's sql server using sql authentication. ...
3
votes
2answers
2k views

SQL Server how to detect unused views and/or get usage stats

Is there a way to determine in SQL Server if a view is no longer being used? (without removing it) Ideally i would like to know usage for SQL Server 2000 as well as 2012 if that is possible. I am ...
1
vote
2answers
705 views

Microsoft SQL Server how can i detach localdb to run on any computer

I am working on a personal project and have implemented a database system using the Entity Framework code first tutorial on msdn, link below, http://msdn.microsoft.com/en-gb/data/jj193542 I am ...
2
votes
1answer
335 views

SQL Application Role access-control

I have been researching the use of Application Roles within Microsoft SQL Server and was wondering if there is a way to limit a user to only be able to set specific application roles. As I understand, ...
0
votes
2answers
5k views

Linked Server to SQL Server 2000 server from SQL Server 2012

I have a new SQL Server 2012 instance, and am migrating a database from SQL Server 2000. Some of the stored procedures in the DB I am moving reference another database back on that 2000 server. What ...
0
votes
0answers
86 views

Huge sizes Replication Tables in Sql Server db, how to deal with? [closed]

I've a sql server database that is configured to work with old software, i've no details about the software, but i know that DB uses replication. the DB size dramatically increases. When i ...
5
votes
1answer
98 views

How is SQL Server host identity ensured?

When I connect to some e-commerce website with my browser I use HTTPS that uses a certificate that (more or less) guarantees that example.com is indeed example.com. Now I connect to a SQL Server ...
2
votes
1answer
109 views

Restoring a database back to a point in time before full backup was made

A problem with one of our database tables arose at the end of last week and I wanted to restore that database to a server in order to retrieve the table. We only have the last backup, and a full set ...
4
votes
1answer
233 views

How can I alter the fill factor of an index outside of an ALTER INDEX command?

I am using a COTS package to perform index rebuilds across my SQL Server portfolio. The package unfortunately doesn't have an option to set index fill factors globally for an individual instance or DB ...
2
votes
2answers
184 views

SQL Server BULK INSERT

I have a file saved using BCP and I want to know the specification of the table of the database that it needs to be materialized on the database. Is that possible? Thanks
0
votes
1answer
283 views

Why is CDC capture failing due to a missing dbo principal

I am having a problem running the CDC change capture job against some of my test databases. The error message I'm getting is the following: Executed as user: NT AUTHORITY\NETWORK SERVICE. Cannot ...
1
vote
1answer
310 views

Moving model database

I have moved the model database by using following method For each file to be moved, run the following statement. ALTER DATABASE model MODIFY FILE ( NAME = modeldev , FILENAME = ...
1
vote
3answers
4k views

importing MySQL dump to SQL Server 2012

I have a database schema from MySQL which I want to import to SQL SERVER, I have tried dumping from MySQL with compatibility for SQL Server, but with no success. Tried dumping as Excel still no dice. ...
0
votes
1answer
200 views

Trying to create a Data Model

It may sound stupid but it's my first experience ever with databases. It's a simple database for a car accessories store. I was hoping when making a sale on a certain item it effects the quantity of ...
4
votes
3answers
1k views

DBCC CHECKDB Notification

There are plenty of questions on DBA.SE regarding DBCC CHECKDB and how to resolve problems when errors are returned. My specific question is on actually getting notified that DBCC CHECKDB returned ...
2
votes
1answer
2k views

SQL Server taking a lot of memory

I have SQL Server Express on my VPS(2GB RAM) with a database size of 1.5 GB that I expect will increase to 15 GB. I have noticed that SQL Server is using 1.5 GB RAM even when only small queries has ...
1
vote
1answer
556 views

Unique index for subquery with RANK() function

I have the following tables: CREATE TABLE Revision ( RevisionId INT PRIMARY KEY IDENTITY, UserName NVARCHAR(256) NOT NULL, DateTime DATETIME NOT NULL DEFAULT GETDATE() ) CREATE TABLE ...
-1
votes
1answer
49 views

what kind of owner to defined when creating Sql server DB for web site? [closed]

what kind of owner to defined when creating Sql server DB for web site ? I am trying to create db and i need to select owner. my db will serve aspnet web site and I wonder witch owner will be safe to ...
6
votes
3answers
22k views

How to Handle TimeZone Properly in SQL SERVER?

I have some issue which needed to be fixed quickly. My local development server is in middle east. But my production server is in UK. Now, I need to show the date to user to thier timezone. For ...
-4
votes
2answers
3k views

Get Hierarchial Data in Self-Referencing Table (Parents , Childs) [closed]

In the following Fiddle, sqlfiddle I will pass a sno and I need all the parents of that sno in a table. And all the children of that sno in another table Please refer to this question. Since ...
3
votes
2answers
1k views

sql server full text search - fuzzy searching?

Is there a way to configure fuzzy searches in sql server full text search. Meaning if I search for a term called POWDER, I must get matches (i.e. strings) which contain any variations of it within an ...
4
votes
1answer
2k views

Moving MSDB database

When I am trying to move msdb database from it's default location (C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA) to another drive(E:). After moving the database I am getting ...
0
votes
1answer
107 views

Why is there such a huge performance difference in these two join statements?

I have a query which i first wrote as (query has been simplified a bit) : select ROW_NUMBER() OVER (ORDER BY c.CategoryTypeID), c.name, count(p.id) from category c inner join product p on p.indID = ...
0
votes
1answer
124 views

How to deny access to see the logins in a database

I create a login in SQL Server 2008 R2, and when that user connects to a database, it can see all the logins in the security logins. Can I deny access to watch the logins of the database?
4
votes
2answers
89 views

Database Install Issue

I was navigated over here from Stack Overflow, hopefully you can help me out. So I've got a dilemma. Our company has bought a volume license for Microsoft SQL Server 2012 Standard Edition. We ...
1
vote
1answer
111 views

Should all queries where you expect a specific order, include an ORDER BY clause?

In order to better understand the SQL Server query processor, I've been thinking about how the ORDER BY clause works, and how SQL Server provides results. It appears SQL Server will provide results ...