Monthly Archives: February 2014

sql transactions – Nested transactions, Saving transactions

Today I come across an interesting article about SQL Transactions by Kenneth Fisher. This blog and subsequent pointers explains very well about transactions, nested transactions, saving transactions and best practices of using transactions in stored procedures. I was experimenting around … Continue reading

Posted in Script, SQL, SQL Query | Tagged , , , , | Leave a comment

Run query on multiple databases or tables sp_msforeachdb or sp_msforeachtable

I had been using sp_msforeachdb for long to search any object (table, column, Procedure, etc) on a given SQL instance. I come across similar SP sp_msforeachtable which can be used to run against all tables. Example:

Posted in SQL, SQL Query | Tagged , , , , , , | 2 Comments

SQL Orphaned users – Solution

I would like to explain about Orphaned users in simple terms which covers majority of scenarios. User permissions are managed in SQL Server with Logins (Authentication at Server Level) and Users (Authorization at Database level), these records are connected with … Continue reading

Posted in SQL, SQL Query | Tagged , , , , | Leave a comment