06/10/2014 by Nitesh

SQL Script To List All Tables Present In a Database

Friends, In this small post, we will see 2 different ways of retrieving all the tables from a specific database. It is a very simple script to get all tables from a database. We can do it using 2 ways. They are as below – Using INFORMATION_SCHEMA.TABLES table Using sys.Tables table The below script lists…

Continue Reading »

24/07/2014 by Nitesh

SQL Script to Create Country Table And Populate With All Country Names

Friends, In almost all application we use Country field in the database to store the Country of a user/entity. For this, we either use a text box where user enters the country name or provide user with a drop down list of all countries. to create the dropdown, it is advised to store country names…

Continue Reading »

12/05/2014 by Nitesh

How To do Case Sensitive String Match in SQL Server

Friends, While working on a SP today, I noticed that SQL Server does a case-insensitive string match in a query. Hence in scenarios where passwords are to be validated, using a query as “WHERE Password =@Password” will give valid results if the user enter password as “admin” or “ADMIN” eventhough when the password is set…

Continue Reading »

03/09/2013 by Nitesh

Solution: Error: 26 – Error Locating Server/Instance Specified

Friends, This is a very common problem that we face while working with SQL (be it any version of SQL) and we always spend some time to figure out the exact issue. Every time we need to look int where should we start looking for the problem. This post lists the basic issues that can…

Continue Reading »

1 2