SQL Server – Simple Tip On Altering SQL Server Tables With Data – Avoid “Saving changes not permitted”

This is a very simple yet handy tip that most SQL Server users are not aware of. Can't alter tables with data?! If you use SQL Server, you must have seen this dialog when you try to alter a table in SSMS (like adding a new column to an existing table containing data). What does … Continue reading SQL Server – Simple Tip On Altering SQL Server Tables With Data – Avoid “Saving changes not permitted”

SQL Server: SSMS Says “Lock request time out period exceeded.” – Identify Blocking Source Quickly

Time-tested approach Although I explain the process for table expansion, the troubleshooting steps to find any blocking session is to run sp_who2 and look at the BlkBy column to get the session id that is blocking a session (assuming you can identify sessions from the information in the other columns) and examine the blocking session. Then … Continue reading SQL Server: SSMS Says “Lock request time out period exceeded.” – Identify Blocking Source Quickly

SQL Server SSMS Templates – Get A Jump Start On Queries/Code

You are a developer or a DBA. You run queries – a lot of them. This blog post shows you how you can simplify reuse of your queries and use already pre-built ones for which you just have to pass in the specific parameter values. Frequently run queries (without SSMS templates): You run some queries … Continue reading SQL Server SSMS Templates – Get A Jump Start On Queries/Code

SQL Server: Run A Script In Command Line Mode (SQLCMD) Inside SQL Server Management Studio (SSMS)

In mature IT shops, all deployment scripts in a release are run into the database using command-line batches as opposed to doing it by hand. Error running SQLCMD scripts in SSMS Occasionally, when one is testing a single script within a release to make sure it works, he/she needs to jump to the command line to … Continue reading SQL Server: Run A Script In Command Line Mode (SQLCMD) Inside SQL Server Management Studio (SSMS)