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)

0
votes
2answers
420 views

Restore to a point between two full SQL Server backups

I have two SQL Server database backups from Server1. Backup1 was made on, say, 2013-01-01 and Backup2 was made on 2013-01-03. What I want to do is restore Server2 to the intermediate state on ...
1
vote
1answer
2k views

Read only/Standby database - Set user permissions

Example database: WarehouseDB Example user: reporting Database state: Read only/Standby mode How do I give the user 'reporting' access to only WarehouseDB without giving them sysadmin privileges? ...
5
votes
1answer
1k views

SQL Server OPENQUERY vs Regular Query against AS400

I log into a SQL Server database which has an AS400 server as a linked server. I've discovered that running queries against this AS400 server is MUCH faster if I run the select in an OPENQUERY... ...
10
votes
1answer
5k views

Why does SQL Server 2012 Express use 9.5GB of RAM on my server?

I am building an application in which I plan to embed SQL Server 2012 Express as the primary datastore. When testing on my development machine (Win7-32 with 3GB RAM), I never observed the ...
8
votes
2answers
530 views

At What Point Does Having an Index Become Efficient

I've found a lot of resources that mention that adding an index to a table makes searches faster and inserts slower, but only if the table is large. This creates a tradeoff, which is a design ...
2
votes
1answer
1k views

Rename Primary Key constraint on Azure

I'm trying to change primary key on a table in Azure storage. The plan is to create a new table, move data over and drop the old table. The problem is that I need all the constraints names to be the ...
2
votes
1answer
522 views

Decryption not working when SQL Server database copied to new server

I am copying a database from an old server to a new server. The database has an encrypted column. From my searches I see that I need to backup the master key from the old server and restore it in ...
2
votes
2answers
353 views

Speed up data transfer from db to application

I have build an application that handles data stored in a MS SQL server database. This server is hosted externally of our company and has to be connected to via SSH because of company rules. On a ...
1
vote
1answer
62 views

Is it a good idea to have an index when the column value changes several times over record lifetime?

I have a table where one of the columns represents an object state - let it be State of type int. The State value starts with 1 and changes to 7 with values in between. Over a row lifetime there're ...
3
votes
0answers
349 views

SqlDependency permissions

The db is SQL Server 2012. All data tables are in the dbo schema. All data access is done via stored procedures in a different schema (user rt). I want to add query notifications for some tables, so I ...
10
votes
2answers
364 views

Setting READ UNCOMMITTED when reading DMVs

I've seen several people call SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED before reading system DMVs. Is there ever any reason to do this, assuming you aren't mixing calls to DMVs and tables in ...
1
vote
1answer
842 views

Is it bad to assign specific processors to SQL Server 2008 R2 cluster instances?

I have a SQL Server 2008 R2 failover cluster with a passive node and an active node. The servers are physically identical. I have two instances of SQL Server, one set to use all the CPUs in the ...
3
votes
2answers
187 views

Find top by values by percents using range in SQL Server

What will be easier way to group records by range of percents. Here what I try to accomplish Select top percents between 50 and 75 * from myTable order by PKI Here is way I did this but I have ...
4
votes
2answers
464 views

Backup Only Database Schema Everynight

I have an instance with 15 databases on SQL Server 2012. I will set up to backup system which will work every night. I want to backup only the schema because several databases are very big. I haven't ...
0
votes
0answers
9 views

speed up data transfer from SQL server to application [duplicate]

I have build an application that handles data stored in a MS SQL server database. This server is hosted externally of our company and has to be connected to via SSH because of company rules. On a ...
4
votes
2answers
618 views

How to keep off-site developer databases up to date with production?

We have a production database running on SQL Server 2008 R2 with files stored in it. We were concerned about the size of the database so we've opted to enable FILESTREAM so the files would be stored ...
3
votes
0answers
209 views

Are the following statements concerning sys.dm_exec_requests true?

Parallel plans mean that cpu_time can be greater than total_elapsed time. Therefore, per-query wait time is not possible to determine accurately from DMVs on servers with more than one CPU thread. ...
2
votes
2answers
726 views

How can I do a differential query (delta plus/minus) telling me what rows are in view A that are not in view B and vice versa?

I have two views which use radically different means to accomplish what I hope is the same end view. One uses complex query expressions and walks entire giant tables and is highly expensive, and the ...
1
vote
0answers
356 views

SQL Server keeps crashing [closed]

I have had SQL Server 2012 on my server for about 6 months. Over the last few weeks, a problem has developed, whereby the SQL Server stops functioning, and any attempt to connect or query returns the ...
2
votes
0answers
152 views

Configuring SQL Server Job agent

I am trying to configure the SQL Server Job Agent using the following scripts USE [msdb] GO CREATE USER [mydbuser] FOR LOGIN [mydbuser] GO EXEC sp_addrolemember N'db_datareader', N'mydbuser' GO EXEC ...
-1
votes
3answers
252 views

What is a good Diff tool when comparing on-premise to SQL Azure? [closed]

We're working on migrating our database (~400 tables) from SQL 2008 R2 to SQL Azure. We're currently in the proof-of-concept stage, figuring out the process we'll be following. We have a process that ...
2
votes
0answers
501 views

SQL Server Reporting Services Slow TotalTimeDataRetrieval Fast ExecuteReaderTime

I wrote a report that is executed by a few hundred users each day and the underlying stored procedure for the data set only takes milliseconds to execute. According to the ...
2
votes
3answers
3k views

Inserting rows into other table whilst preserving IDENTITY

I'm performing ETL logic on a SQL Server table. I'm going to be synchronizing data from one table to another. For all of the records that need to be added to the target table based on the source ...
3
votes
2answers
2k views

Shrink database operation in maintenance plan failed

See updates below I have a nightly DB maintenance plan and it's causing some strange behaviour. About 1 out of 10 runs it causes the DB to not response to queries. It takes about 5 minutes for the ...
5
votes
1answer
76 views

SQL Server help tables?

If I write in SQL Server : SELECT number FROM master..spt_values WHERE Type = 'P' ORDER BY Number I get a list of sequential numbers which I can already use, instead of writing a table with ...
6
votes
4answers
16k views

How does paging work with ROW_NUMBER in SQL Server?

I have an Employee table that has one million records. I have following SQL for paging data in a web application. It is working fine. However what I see as an issue is - the derived table tblEmployee ...
4
votes
2answers
210 views

Performance on SQL Join

I have a query which takes ages to run mainly due to a join between 2 tables on a PK and FK. The Key is prefixed with 2 letters (which is always the same, RN) followed by 7 digits So RN1234567 for ...
1
vote
1answer
571 views

Bandwidth usage in Sql Server

Our compagny has a central Sql Server Database which is connected to many applications (Web, Backend/Frontend services, backoffice, ..) This database is hosted in a small country (for taxing ...
1
vote
1answer
96 views

Stateful views in SQL Server

Actually I got stuck while searching a materialized view approach in SQL Server. My problem was that I have two databases and I have created some views whose functionality is to read data from one DB ...
5
votes
1answer
498 views

sql_slovak_cp1250_ci_as vs Slovak_CI_AS

Can someone explain to me what is the difference between collation sql_slovak_cp1250_ci_as vs Slovak_CI_AS? I have a db set to sql_slovak_cp1250_ci_as and shared hosting supports only Slovak_CI_AS. ...
1
vote
1answer
596 views

Connecting to a SQL Server database from a Flash program [closed]

I currently have the ability to utilize Microsoft SQL Server 2012. I am developing a project with Adobe Flash Builder 4.7. If I link my database with Adobe Flash Builder is there any additional ...
2
votes
1answer
394 views

Size of the ldf file increasing [duplicate]

Possible Duplicate: Why Does the Transaction Log Keep Growing or Run Out of Space? I have some sql server database for which recovery model is set to full.Now for some databases the ldf ...
2
votes
4answers
313 views

SQL Server BPA 2008R2

I have been using SQL server BPA for getting good information from Microsoft. I was using its 2005 version in which i used to export the results in csv format but recently I got two new servers which ...
5
votes
2answers
2k views

Allowing end users to kill their own queries

I am an end user (programmer/analyst) without permissions to kill my own queries in our datawarehouse. This causes problems when I need one killed (like right now - 5:30 on a Friday afternoon) and ...
1
vote
1answer
223 views

weird sql server behavior when inserting and selecting

Today after one of the drives on our sql server ran out of space. The drive contained eventracker logs, so I didn't think it was a big deal, but then I noticed when I insert a record into a database, ...
0
votes
1answer
90 views

Does SQL Server cache data results for DAO?

I was surprised to be confronted with the idea that using .NET and DAO one could make use of the SQL Server data cache in a way not at all possible with stored procedures (which benefit from the plan ...
25
votes
7answers
3k views

What is the difference between a “record” and a “row” in SQL Server?

There was a rather innocuous question about adding dates and times in SQL Server that set off a rather fascinating taxonomic debate. So how do we differentiate between these related terms and how we ...
0
votes
2answers
117 views

Is there a combination of columns in sys.dm_exec_sessions that is unique per the server?

In SQL Server, each session has its own spid. Spids are unique at any given notice, but spids, like process and thread identifiers in the OS are recycled. However sys.dm_exec_sessions has other ...
2
votes
1answer
146 views

View SQL's errorlog in Amazon RDS

Is there a way to view the SQL Server errorlogs in Amazon's RDS? I usually use sp_ReadErrorlog, but in RDS we need to be a member of securityadmin role.
3
votes
2answers
85 views

With the advent of integrated source control, do stored procedure changes still need comments?

Back in the old days, my team had a policy that any stored procedure modification required comments in two places: Top of the stored procedure with an overall summary of the changes made Comments ...
4
votes
2answers
1k views

SQL Server 2012 database backup successfully report but no backup file

I have created maintenance plan in SQL Server 2012. And every day, the maintenance plan should backup the database. There is no database backup file when I look in the folder where the backups must ...
-6
votes
2answers
6k views

Display month in columns and the sum of sales below the columns in sql [closed]

My table is like this: Sitecode Month Amount -------- ----- ------ XX Jan 1000 XX Jan 3000 XX Apr 3000 XX Apr 1000 What I want is, to ...
3
votes
1answer
685 views

Error while restoring database in SQL Server 2008 R2

This error occurs while I restore database from .bak file A system assertion check has failed. Check the SQL Server error log for details. Typically, an assertion failure is caused by a software ...
-2
votes
2answers
4k views

SQL Server - How many type of timeout can happen, and how?

When working with SQL Server, there can be multiple application host accessing it, and each application can have one or many connection. Each connection can potentially have multiple transaction ...
1
vote
2answers
758 views

WSUS for SQL server patching

Can we patch Microsoft SQL server using WSUS? Is it not recommended?
3
votes
2answers
4k views

How to Find the Foreign Key Associated with a Given Primary Key

All, I want a way to establish which columns in a given database are joined via PK/FK relationships. I can return the PK/FK information for a given table via SELECT * FROM ...
2
votes
0answers
158 views

SQL Server : Transactional Replication Filter By Computed Column

There is a database that contains records for multiple groups of people. These records do not contain a column indicating which group the record is "owned" by (very frustrating). I need to setup ...
0
votes
2answers
208 views

SQL Server 2008: Diff table data on different servers with exact schema

I'm trying to find a good open source tool that simply compares data in a database on one server to a table (of the same schema) on another server. Then I want to generate INSERT statements for the ...
2
votes
1answer
133 views

Availability Groups and Partition Swapping

Is it possible to use SQL 2012 Availability Groups over two machines and perform partition swapping on the primary machine ?
0
votes
2answers
384 views

Remote Desktop Session's Machine ID for SQL Server Query

How to get machine name of a user, who is connected on an instance through Remote Desktop and used windows authentication login. I need it for each query she has executed. sys.dm_exec_connections just ...