SQL Server: Variables, Parameters or Literals? Or… Constants?

The age-old question “Should I use Variables, Parameters, or Literals in my code?” We’ve all seen the pros and cons for each of them and had to choose the option with the least negative impact. What if I told you there was a fourth option? For years, I wished SQL Server would support constants, a…

1

SQLCMD and PowerShell: Generate 450 Million Names With 20 Lines of Code

(It’s actually 487,861,706 names but it didn’t seem like a good title). Skip to the solution. Note on file sizes: As a full of this sample run require 25GB of disk space, I’ve placed a simple restriction in the sample code. Prior to running the code without the restriction, readers should be familiar with TempDB…

2

Hacking SQLCMD Mode: Introducing PowerShell

Disclaimer and a heartfelt thanks:  Whenever possible, I will endeavor to give credit to people that provided a solution, idea, or inspiration for my own blog posts. These posts would not have possible without all the amazing people in the SQL Server and PowerShell community sharing their own solutions. While I’m not aware of anybody…

1

SQL Server Management Studio: Hacking SQLCMD Mode

Notice: This article is geared toward people already familiar with SQLCMD mode in SQL Server Management Studio. Though not extremely advanced, readers should understand documented functionality of SQLCMD first. A basic understanding of DOS Command Shell will also provide the best results from trying these examples. The steps outlined in this article deal with executing…