-->
SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

SQLStudies

My name is Kenneth Fisher and I am Senior DBA for a large (multi-national) insurance company. I have been working with databases for over 20 years starting with Clarion and Foxpro. I’ve been working with SQL Server for 12 years but have only really started “studying” the subject for the last 3. I don’t have any real "specialities" but I enjoy trouble shooting and teaching. Thus far I’ve earned by MCITP Database Administrator 2008, MCTS Database Administrator 2005, and MCTS Database Developer 2008. I’m currently studying for my MCITP Database Developer 2008 and should start in on the 2012 exams next year. My blog is at www.sqlstudies.com.

Archives: September 2018

Data Types Word Search

Just for fun here is a word search with all of the data types available in SQL Server. Well, two exceptions. No datetime2 because there are no numbers in the word search, and sql_variant I had to remove the underscore. Last but not least, if it helps, there are 33… Read more

4 comments, 1,714 reads

Posted in SQLStudies on 26 September 2018

Escaping strings

No, I’m not talking about that nightmare everyone has where a bunch of strings are chasing you across a loom.

Not everyone has that nightmare? Just me? Really? Um .. well .. You know, let’s just forget I said anything.

Escaping strings is an important concept when working with computers.… Read more

0 comments, 779 reads

Posted in SQLStudies on 24 September 2018

You can’t DELETE TOP (x) with an ORDER BY

Did you know you can’t do this?

DELETE TOP (10)
FROM SalesOrderDetail
ORDER BY SalesOrderID DESC;

Msg 156, Level 15, State 1, Line 8
Incorrect syntax near the keyword ‘ORDER’.

I didn’t. Until I tried it anyway. Turns out, it says so right in the limitations section of BOL.… Read more

8 comments, 3,045 reads

Posted in SQLStudies on 19 September 2018

How do I grant permissions to view users and their permissions?

tl;dr; VIEW DEFINITION

Every now and again you’ll have a user that needs to be able to see what permissions other users have. Not change them, just look at them. In the cases I’ve seen it’s usually a manager or something similar reviewing the database permissions. Or maybe someone doing… Read more

1 comments, 123 reads

Posted in SQLStudies on 17 September 2018

Using Table Valued Parameters with sp_executesql

Recently I did a presentation on dynamic SQL. In the presentation I pointed out the similarity of using sp_executesql to creating a stored procedure to do the same task. After the session I was asked: If that’s the case, can I pass a TVP (table valued parameter) into sp_executesql? Read more

3 comments, 2,202 reads

Posted in SQLStudies on 13 September 2018

What happens in a trigger stays in the transaction: T-SQL Tuesday #106

Anything that happens in a trigger happens within the same transaction of the command that called it.

Part of me feels like this should be pretty obvious but it’s also one of those things that’s so obvious that it becomes easy to miss.

Let me explain:

If you run an… Read more

0 comments, 145 reads

Posted in SQLStudies on 11 September 2018

I/O vs Logical I/O

tl;dr; While the difference is very important 90% of the time you won’t care and should just add the two numbers together.

I/O and Logical I/O are two pieces of information you will see all over the place.

Read more

0 comments, 2,414 reads

Posted in SQLStudies on 5 September 2018

SQL Homework – September 2018 – Backup and Restore continued.

In the very first SQL Homework post you were asked to take a backup. In fact it asked you to both take a backup and restore it. Because, I’ll be honest with you, if you can’t restore a backup then you might as well not have taken it. That said,… Read more

0 comments, 735 reads

Posted in SQLStudies on 3 September 2018