Creating the EmployeeDb sample SQL database

The following download files provides scripts for creating the EmployeeDb sample databases for use with SQL Server. The Scripts have created from the Microsoft SQL Server Management Studio. The EmployeeDb is using in the various examples, tutorials and projects on the Authorcode. Continue reading “Creating the EmployeeDb sample SQL database”

Truncate all tables in SQL Database from single command

Today i need to blank all the tables in the SQL database. Till now I was using the truncate table command with the for loop in the code because i need to blank few tables. But now i need to blank whole database so i decided to use the sp_MSForEachTable system stored procedure like as: Continue reading “Truncate all tables in SQL Database from single command”

Using Aliases in SQL Server

You can use some alias for table in the select query for better readability of the query, Aliases of the table are very useful when you are using complex query with multiple lines. Aliases of the tables in the Sql server are also called as a correlation name or range variable. Continue reading “Using Aliases in SQL Server”