Really quick post regarding sp_help and tables in Schemas (not in dbo). Usually when doing a sp_help, you can do something resembling the following : However, if you try to do the same with a table with a Schema (SomeSchema.TableName) you will get an error “Incorrect syntax near ‘.’”. To […]

Continus reading  

If you haven’t realized it by now, you cannot do a LIKE without any magic on a XML column. If you do, you will get the following error : Argument data type xml is invalid for argument 1 of like function If you need to do a LIKE on a […]

Continus reading  

A really quick post for you all today over the differences between Where and Having in SQL. This has been a question in a lot of interviews, but no one seems to know why and when to use each of these clauses. Where The where clause is used to filter […]

Continus reading  

The Issue I ran into a strange issue with an ASP.NET site (MVC2 – 4.0 Framework) where when executing a stored proc, SqlDataAdapter.Fill(DataTable) will not return any rows some of the time, but SQL Server Management Studio will almost immediately return results. The full method calling the stored procedure is […]

Continus reading  

I ran into an issue where I needed to see the last few queries ran on SQL Server (Currently using SQL Server 2005). There were quite a few suggestions out there, but one I found on Stack Overflow seemed to be formated the best and didn’t require me messing with […]

Continus reading  

Need to do nested Case statements in SQL? Use the following syntax. This should result in ‘a1b1 – yar’ This took me a little time to work out the syntax, but pretty simple once I understood case statements a little better. For some more info on case statements, you can go to […]

Continus reading  

Ever find yourself taking precious time and backing up all your databases, only to forget and be behind? I am currently working on some Alpha-PreAlpha software whose database structure changes with time like any other application. To solve the issue with remembering to back up however, I decided to automate […]

Continus reading  

There has been a few times where I needed to compose a script to update a customer’s database, and I’ve had to use probably the most popular of the SQL ALTER TABLE syntax: Add, Modify, Rename, and Drop. To help save for my own notes and to possibly give some help, […]

Continus reading  

When right clicking a table in SQL Server Management Studio, you have an array of options. Probably the two that I use most however is the “Select Top 1000 Rows” and the “Edit Top 200 Rows”. However, sometimes you want to look at a little more than that. I know […]

Continus reading  

If you ever seen the above check mark, you are probably wondering what the heck is going on. First off it’s not checked or checked, some in between state where it’s just filled with a blue square. Second off you even, most likely, have a variable bound to it, and yet […]

Continus reading  

If you wanted to get rid of all the data in a table, then you could you either of the three. However there are certain situations which using a different one of these is the best route to go.

Continus reading  

I go back and forth with different versions of SQL which at times will require different syntax. I started using primarily SQL Server 2008 R2 so I needed an update on some certain functions. To help me remember and to save you some time, here they are. Adding Multiple Colums […]

Continus reading  
%d bloggers like this: