20 March 2019
20 March 2019

Scripting out several databases on a server

3
0
A while ago, I wrote an article Automated Script-generation with Powershell and SMO about using SMO to script out a SQL Server database. It has remained surprisingly but agreeably popular. SMO is still there, but now part of the sqlserver module that is included with SSMS and downloadable. Someone recently asked me whether it was … Read more
26 February 2019
26 February 2019

Identifying Page Information in SQL Server 2019

SQL Server 2019 has some new and very interesting functions to identify information about pages. Many operations, such as analyzing current activities, locks or deadlocks, may result in some metadata pointing/blaming one page in the database. However, how to translate this information to get a database and object name? The image below is an example of … Read more
17 February 2019
17 February 2019

How To, and Not To, Escape a String In TSQL

1
3
You are never too old to learn an important lesson. Like most programmers, I read programming language documentation for one of two reasons. 1. You have just found out about something new 2. You find out that you were wrong about something you thought you had read the first time, probably 10 years ago. Today’s … Read more
10 February 2019
10 February 2019

6 SSMS features that deserve some attention

0
3
SSMS new versions are full of very interesting features. With SQL Server 2019 arriving, it’s normal that our focus is captured by the new features in the database engine, however, SSMS has also a lot to offer. Let’s highlight some very interesting features this tool has to offer on its new versions. Vulnerability Assessment Sometimes … Read more
08 February 2019
08 February 2019

Using Temporary Procedures

1
6
I’ve often read in forums how people have special utility databases with all their stored procedures and functions for working on the databases on the server. It is great because you don’t want your utilities intruding into the actual databases that you are developing or testing. The problem is that it doesn’t work. Let me … Read more
12 January 2019
12 January 2019

A real parameterization problem with a plus

1
1
A few weeks ago I faced this problem: One query on my application was (fortunately in the development environment) was facing a very bad execution time. Since the query was generated by entity framework, I used SQL Profiler to capture the query with all its parameters and execute in SSMS. The query was created using … Read more
09 January 2019
09 January 2019

SQL naming conventions

SQL naming conventions for tables, and all the associated objects such as indexes, constraints, keys and triggers, are important for teamwork. Poorly-named tables and other objects make it difficult to maintain databases. Table names must follow the rules for SQL Server identifiers, and be less than 128 characters. It is possible to force SQL Server to … Read more