how to decrypt an encrypted stored proc in 2005
SQL 2005 still obfuscates object encryption in a similar manner to SQL 2000. It is simply an XOR of the encrypted bytes against a known sample to dump out the real unencrypted bytes. The trick is getting to the the encrypted bytes. In SQL 2005, instead of querying the SYSCOMMENTS view to get the binary bytes to decrypt, you need to run the following query from the dedicated admin connection (DAC) to get the bytes to decrypt: SELECT imageval FROM sys.sysobjvalues WHERE id = object_id
UPDATE STATISTICS stored procedure
Here's the stored procedure that I use to update statistics on a database. I don't use sp_updatestats as it doesn't allow you to change the number of rows to sample. I typically run it weekly on the databases that I support. CREATE PROC isp_UPDATE_STATISTICS(@dbName sysname, @sample int)AS SET NOCOUNT ON DECLARE @SQL nvarchar(4000)DECLARE @ID intDECLARE @TableName sysnameDECLARE @RowCnt int CREATE TABLE ##Tables( TableID INT IDENTITY(1, 1) NOT NULL, TableName SYSNAME NOT NULL) SET @
SQL Server jobs on production instances
The most important thing that a Database Administrator does is backups. To automate them, we schedule them as jobs. But what other jobs are important on SQL Server instances? Here are the jobs that I have on every SQL Server 2005 production instance: Name Code Schedule Notes Back
SQL Server security
Normal 0 7.8 pt 0 2 false false false MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-or