Tuesday, November 9, 2010

MSSQL101 enable xp_cmdshell

EXEC master.dbo.sp_configure 'show advanced options', 1

RECONFIGURE

EXEC master.dbo.sp_configure 'xp_cmdshell', 1

RECONFIGURE

Tuesday, August 10, 2010

MSSQL select value into variable

Declare
@intTableCount int



set @intTableCount = (select COUNT(*) from INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = 'dbo'
and TABLE_NAME = 'Table_Name')

select @intTableCount
 
It will trow an error if you omit the ( and ) .
 
Till Next Time

Wednesday, June 9, 2010

mssql READ UNCOMMITTED

SET TRANSACTION ISOLATION LEVEL


READ UNCOMMITTED

go
 
till next time

MSSQL SQL Server Agent appears with "Agent XPs disabled"

sp_configure 'show advanced options', 1;


GO

RECONFIGURE;

GO

sp_configure 'Agent XPs', 1;

GO

RECONFIGURE
 
Till Next Time