Here’s a shot from our engineer, behind the scenes of my live talk today.
Tom Austin and @way0utwest live at #sqlinthecity – a behind the scenes look! pic.twitter.com/ADsWhc2tEg
— Robert Chipperfield (@rmc47) December 15, 2016
Here’s a shot from our engineer, behind the scenes of my live talk today.
Tom Austin and @way0utwest live at #sqlinthecity – a behind the scenes look! pic.twitter.com/ADsWhc2tEg
— Robert Chipperfield (@rmc47) December 15, 2016
Next week is the 2016 version of SQL in the City and you can register now to attend. It’s free and doesn’t require any travel. You can watch the event live from the comfort of your office chair.
In the many years that we’ve run SQL in the City, we’ve had events in London and various cities around the US. It’s been a lot of fun and we want to continue the tradition, but with an experiment.
This year we’re broadcasting SQL in the City from the Redgate Software offices in Cambridge, UK. We have seven hours of sessions mixed in with tips and tricks that will help you become better SQL Server developers and DBAs while showing you some new ways you might use the SQL Toolbelt to work more efficiently. Even if you’re not a Redgate Software customer, I’m sure you’ll learn some things about SQL Server.
In order to make things more convenient for everyone around the globe, we are broadcasting on two days, December 14 and 15. The content is the same both days, but the times vary. Wednesday will be an early day for my in Cambridge as we broadcast for Asia and Eastern Europe. Thursday will be a late night as the conference is scheduled to fit the Western Europe and US time zones.
I hope you’ll join us and get excited about our new SQL Clone and Data Platform Studio as well as learn a few things about DLM Automation, SQL Monitor, ReadyRoll and more.
Awhile back I was working in SSMS and saw this window.
It threw me off since I was trying to write some code and hadn’t expected it. I clicked Escape, Enter, a few things and was getting frustrated when it disappeared.
I ignored it until I saw the window again and then investigated. I’m glad I did because I was able to answer a question from someone else recently that didn’t know how to get rid of it.
Tl;Dr CTRL will make it appear or disappear.
When I am working with SQL Prompt, it’s in the background. I usually just depend on it to pop up some code or give me information. This means when I have a cursor, there’s no sign of SQL Prompt. Notice this below.
As soon as I select an area, as little as one space, I get a small SQL Prompt window in the left sidebar. As you can see in the image below, this has a down arrow on it.
I can click on this, but being a keyboard person whenever possible, I accidently discovered that CTRL will expand this, as shown below.
What threw me initially is that not all my snippets are in this list. Only those that have the $SELECTEDTEXT$ token inside them. These are handy snippets that I want to use to encapsulate text.
For example, let me surround a simple query.
I see the SQL Prompt icon and can click CTRL to open the list. If I type “cv”, I get the Create View snippet.
Once I then hit tab, I get the snippet with my query inside.
This is especially handy with things like TRY..CATCH, where I can write the TRY part and then quickly surround it with the structure.
Once you get used to this, and learn not to habitually tap the CTRL key (as I do), you’ll find this list of snippets handy. And if you don’t like them, just tap CTRL and get rid of the list.
The basis of all the DLM Automation from Redgate is a series of PowerShell cmdlets. They might look intimidating or confusing, but they aren’t. This is part of a series of posts that examine how you use each one.
Previously I looked at New-DatabaseConnection. In this post, I’ll go through Invoke-DlmDatabaseSchemaValidation. This is the cmdlet that one uses to check if your set of scripts will actually produce a database. This is equivalent to the “build” plugin that exists for a few platforms.
The way this works is that the location of the database scripts is passed to this object through a pipe. This will then validate the scripts on LocalDB with a build of the database and the static data scripts. If this works, then an output object is returned.
Let’s see how this works. I have a valid database folder on my computer. This has all my object code in subfolders, including static data in the data folder. I want to validate this folder.
I can do that with this code. I’ll pass the location of the scripts into the cmdlet.
$output = “e:\Documents\GitHub\SimpleTalk_Devlopment\ScriptFolder” | Invoke-DlmDatabaseSchemaValidation
When I do this, a LocalDB instance is created and the code validated. I get a message to that effect. The output variable has the confirmation message.
This means the code is valid. However, does this really work? Let’s edit some code and see. I’ll change the code for a procedure. Here’s the original GetCountryCodes.sql.
Let’s change this to top 100 and add an ALTER, but I’ll get an extra comma in there. This is no longer valid SQL.
Let’s re-run the build. We now see this has failed with an error, and the file is the one I edited:
This is a quick look at builds, but there is more that can be done. You can specify the server and database to be used, combining this with the New-DlmDatabaseConnection I previously wrote about.
I urge you to experiment with this cmdlet if you want to perform your own builds.