5 DROP TSQL statements I can’t live without

TSQL DROPs for temp tables, procs, functions, SQLAgent jobs, synonyms This is probably the most simple TSQL I will ever post. However, it becomes useful more often than it would seem. Many times I will write a script/proc or get someone else’s code which doesn’t do any checking or clean up. Temp table drop TSQL … Read more

SQLAgent job owner change TSQL

SQLAgent job owner change TSQL TSQL to change SQLAgent job owner Today I discovered many SQLAgent jobs had non-sa ownership of the job. It was replication jobs created by me. Here is a TSQL script to change job ownership from whatever user to ‘sa’. Or to whatever user you want. Just change two parameters: @NewOwner and … Read more