Tag Archives: T-SQL

Writing the Correct Query is Important

There’s a saying in the data world: garbage in, garbage out. We use that when we can’t get good information from our database because the data we’ve stored isn’t as useful as we would like. That’s a problem, and it’s … Continue reading

Posted in Editorial | Tagged , , | Leave a comment

Quick Prompt Tips–Custom Procedure Templates

One of the things that I often do is create stored procedures. The syntax for doing so is simple, but it has a number of items that need to be included. SQL Prompt makes this much quicker with the “cp” … Continue reading

Posted in Blog | Tagged , , , | Leave a comment

Be Careful of Your Create Stored Procedure Batch

I was rehearsing a demo with someone recently and we had some stored procedure code that looked like this: CREATE PROCEDURE UpdateEmpID @empid INT AS BEGIN UPDATE  dbo.Employees SET empid = 3 WHERE  empid = @empid ; END However, this … Continue reading

Posted in Blog | Tagged , | Leave a comment

Finally, Create or Alter

There are lots of reasons to upgrade to SQL Server 2016, but this is the one for me. We finally get a CREATE OR ALTER statement in T-SQL. This not only makes lots of code easier to write, it means … Continue reading

Posted in Editorial | Tagged , | 2 Comments

#SQLNewBlogger – T-SQL ESCAPE for Wildcards

Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers. I ran into a really interesting issue recently. I was working with a table and wanted to determine if … Continue reading

Posted in Blog | Tagged , , | 1 Comment

The GUI Helps Build SQL Prompt Snippets

SQL Prompt is an amazing tool for writing T-SQL. It helps you to concentrate on your code, without having to go off and examine Books Online or other documentation, or even worry about formatting. One of the keys to making … Continue reading

Posted in Blog | Tagged , , ,

Using TRY..CATCH in SQL Prompt

I learned something new recently about SQL Prompt. I was working on documenting and experimenting with snippets and found a quicker way to write code. One of the things I think is great is to use the TRY..CATCH structure. I … Continue reading

Posted in Blog | Tagged , , , | 1 Comment

Creating a Logon Trigger–#SQLNewBlogger

Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers. Suppose you want to audit logins for your SQL Server instance. There are multiple ways to do this, but … Continue reading

Posted in Blog | Tagged , , , | 2 Comments

The Snippet Manager in SQL Prompt

I love SQL Prompt, since it makes T-SQL coding quicker and easier. One of the handiest things is the Snippet Manager. I’ll show you how this works. When I type something, like “cl”, I get a list of things, as … Continue reading

Posted in Blog | Tagged , , ,

Finding the Attribute

I was playing with some Extended Events recently. If you haven’t tried, I’d encourage you to do so. However, working with XML is not my favorite. I know I can get the GUI in SSMS 16.x to show me events, … Continue reading

Posted in Blog | Tagged , ,