Category Archives: Sql Server 2008

How to get only the date from datetime

I have listed below two solutions for extracting a date from a datetime : Continue reading How to get only the date from datetime

How to delete column that has a foreign key in MsSql

Scenario :  Delete a column that has a foreign key. Continue reading How to delete column that has a foreign key in MsSql

How to create a foreign key in MsSql

Scenario : We have two tables 1 Customers 2 Sales

I have to make sure that all the client id's that are inserted in the Sales table exists in the Client table Continue reading How to create a foreign key in MsSql

How to concatenate a list of names fast and easy in Sql Server

Scenario : We have a table that contains all the employees of our company and we want to take all their names and concatenate them separated by comma. Continue reading How to concatenate a list of names fast and easy in Sql Server

How to perfom fast record count in Sql Server T-Sql

Scenario :  You have a table that has a lot of rows and you want to know the total number of rows. Continue reading How to perfom fast record count in Sql Server T-Sql