admin's blog

MSSQL: Get primary key column(s)

SELECT [name]
FROM syscolumns
WHERE [id] IN (SELECT [id]
FROM sysobjects
WHERE [name] = @table_name)
AND colid IN (SELECT SIK.colid
FROM sysindexkeys SIK
JOIN sysobjects SO ON SIK.[id] = SO.[id]
WHERE SIK.indid = 1
AND SO.[name] = @table_name)

http://blogs.x2line.com/al/articles/175.aspx

Keywords: MSSQL, Primary key

ENABLE_BROKER, DISABLE_BROKER run indefinitely

If it seems ENABLE_BROKER and DISABLE_BROKER will run forever, it will be probably true. This mostly happens when you run:

ALTER DATABASE [databaseName] SET ENABLE_BROKER

and

ALTER DATABASE [databaseName] SET DISABLE_BROKER

These operations need exclusive database lock.

Keywords: MSSQL, ENABLE_PROKER, DISABLE_BROKER, indefinitely, forever

How to: Truncate Transaction Log

ALTER DATABASE DBNAME SET RECOVERY SIMPLE;
DBCC SHRINKDATABASE (DBNAME, 5)
ALTER DATABASE DBNAME SET RECOVERY FULL;

https://support.gearhost.com/…ql-2008.aspx

Keywords: MSSQL, Transaction log, Truncate

Programming and Extending SSIS

http://media.techtarget.com/digitalguide/images/Misc/sqlserver_ch14.pdf

Keywords: SSIS, Programming SSIS, Extending SSIS
Syndicate content