Tag Archives: T-SQL

A Basic Update Trigger: #SQLNewBlogger

I had someone ask me about using triggers to detect changes in their tables. As I explained a few things, I thought this would make a nice series, so I’ve written a few posts on triggers that can be useful. … Continue reading

Posted in Blog | Tagged , , | 6 Comments

Using AI to Test a SQL Query

Someone sent me this code. WITH p AS ( SELECT ID, ROW_NUMBER() OVER (ORDER BY ID ASC) AS RN FROM wp_posts WHERE post_parent = 94341; ) UPDATE p SET menu_order = RN That’s not great code. In fact, it won’t … Continue reading

Posted in Blog | Tagged , , , | 1 Comment

Create a Linked Server: #SQLNewBlogger

I had a customer recently that was asking about Linked Servers and some development advice. I was going to show them a few things and realized I hadn’t created a linked server in my demo environment, so I did it … Continue reading

Posted in Blog | Tagged , , , | Comments Off on Create a Linked Server: #SQLNewBlogger

Can I Change a Primary Key Value? #SQLNewBlogger

I heard someone say recently that you can’t change a primary key value in a row. That’s not the case, so I decided to show a quick proof of that. Another post for me that is simple and hopefully serves … Continue reading

Posted in Blog | Tagged , , | 1 Comment