Top "Sql-server-2008-r2" questions

Use this tag for questions specific to the 2008 R2 version of Microsoft's SQL Server.

Script to kill all connections to a database (More than RESTRICTED_USER ROLLBACK)

I have a development database that re-deploy frequently from a Visual Studio Database project (via a TFS Auto Build). Sometimes …

sql sql-server tsql sql-server-2008 sql-server-2008-r2
Select SQL Server database size

how can i query my sql server to only get the size of database? I used this : use "MY_DB" …

sql sql-server sql-server-2008 sql-server-2008-r2
How to check date of last change in stored procedure or function in SQL server

I need to check when function was changed last time. I know how to check creation date (it is in …

sql-server-2008 stored-procedures sql-server-2008-r2 sql-function
CREATE TABLE IF NOT EXISTS equivalent in SQL Server

CREATE TABLE IF NOT EXISTS works on mysql but fails with SQL Server 2008 R2. What is the equivalent syntax?

sql sql-server sql-server-2008-r2
Check if table exists and if it doesn't exist, create it in SQL Server 2008

I am writing a Stored procedure in SQL Server 2008. I need to check if a table exists in the database. …

sql sql-server tsql sql-server-2008-r2
SQL Server 2008: How to query all databases sizes?

I have MS SQL 2008 R2, 500 databases. What is the most efficient, easiest and 'modern' way to query all databases sizes. …

sql sql-server tsql sql-server-2008-r2
How to find out what is locking my tables?

I have a SQL table that all of a sudden cannot return data unless I include with (nolock) on the …

sql sql-server sql-server-2008-r2 locking query-optimization
Exit single-user mode

Currently, my database is in Single User mode. When I try to expand me database, I get an error: The …

sql-server sql-server-2008-r2
Search of table names

I use the following to search for strings in my stored procedures: use DBname SELECT Name FROM sys.procedures WHERE …

sql sql-server sql-server-2008-r2