07/10/2014 by Nitesh

SQL Script To List All Columns of a Table in SQL Server

Friends, In my last post, I explained how can you list all tables from a specific table in a database. In this post, we will see different ways of retrieving all columns from a specific table in a database. It is a very simple script to get all columns for a table from a database….

Continue Reading »

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 »

05/10/2014 by Nitesh

Solution: SSDT – Error SQL70001 This statement is not recognized in this context

Friends, In this post we will see how can we resolve a very common error while working with SQL Server Data Tools in Visual Studio. The error statement is – “Error SQL70001: This statement is not recognized in this context“. This error occurs in Visual Studio whenever we try to execute some SQL statements which are…

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 »

1 2 3 4