Tag Archives: T-SQL

Quick Scalar Tables–#SQLNewBlogger

Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers. This actually comes from Itzik Ben-Gan, by way of Kevin Feasel.  Kevin’s post is about CROSS APPLY, which is … Continue reading

Posted in Blog | Tagged , , | Leave a comment

Rename a Primary Key–#SQLNewBlogger

Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers. Having system named objects is one of those things that people may debate, but as you move to more … Continue reading

Posted in Blog | Tagged , , | Leave a comment

Getting Table Change Scripts–#SQLNewBlogger

Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers. One of the really basic things I think everyone should understand is how to get scripts from Management Studio … Continue reading

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

Using sp_executesql Parameters –#SQLNewBlogger

Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers. I haven’t used sp_executesql much. Instead, my habitually way of executing dynamic SQL has been with EXEC(). There are … Continue reading

Posted in Blog | Tagged , , | Leave a comment

Basic XML Node Query–#SQLNewBlogger

  Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers. I saw a question recently about querying an XML document. Certainly avoid this in the database if you … Continue reading

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

Getting the Previous Row Value before SQL Server 2012

Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers. I ran across a post where someone that was trying to access the previous value in a table for … Continue reading

Posted in Blog | Tagged , | Leave a comment

LAST_VALUE–The Basics of Framing

I did some work a 3-4 years ago, learning about the Windowing functions and enjoying them so much I built a few presentations on them. In learning about them, and trying to understand them, I found some challenges, and it … Continue reading

Posted in Blog | Tagged , | Leave a comment

It’s 2016 RLS for T-SQL Tuesday #79

It’s T-SQL Tuesday time again. I missed last month, being busy with travel, though I should go ahead and write that post. Maybe that will be next week’s task. In this case, Michael J Swart is hosting this month’s blog … Continue reading

Posted in Blog | Tagged , , , | 1 Comment

OBJECT_ID()–#SQLNewBlogger

  One of the things that is needed in quite a few functions is the object_id of a particular table/view/procedure/function in SQL Server. For example, I was looking at STATS_DATE recently, and it has this definition. STATS_DATE (object_id, stats_id) In … Continue reading

Posted in Blog | Tagged , , | 2 Comments

Quick Tests for a Function

I was writing a poorly performing UDF the other day and then wanted to replace it with a better performing one. However, I wanted to be sure that the function was the acting the same externally. In other words, does … Continue reading

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