Category Archives: MS SQL Server

How to identify and delete duplicate records from sql table

Well I’m sure any SQL developer out there would have encountered a problem where the duplicate records in a table have to eliminated for some reasons.
I recently encountered a similar situation where I had to remove the duplicate user name from a table with just one simple query . Here is how I did it:
Here [...]

How to get Current DB name and user in MS SQL server?

Most of the time I forget the command to get the DB name and current user when working. So decided to make post about it no better way to find the info fast.
Here are the 2 commands that basically gets the info.

Select DB_name() ;
Select Current_user;

Here is a post that my friend wrote on How to [...]