Go to Top

Tag Archives

Tag Archives: query

Using IF and ELSE in MSSQL

This guide explains how to use IF and ELSE in MSSQL. IF and ELSE statements can be very usefull in MSSQL in alot of situations especially when you need to verify something prior to deleting or changing the record. It works in a very similar way to php. In PHP it is: In SQL you use it with the same structure in mind. For example: The above query selects a …Read More

Querying Multiple Tables in Multiple Databases MSSQL

Recently i had the task of querying multiple tables in multiple databases in Microsoft SQL Server. I thought i’d share it online for anyone else who may be looking at or struggling doing the same thing. Once you see the code it makes sense and is fairly straight forward but i will comment the code so you can see what does what etc. Lets say you have a database containing …Read More