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 »

14/02/2014 by Nitesh

How to Add User to SQL Server Database using Scripts

While development, we normally use SQL Server Management Studio for various operations. However, when the code goes in production, Management studio is not found and we need to Execute SQL Queries using sqlcmd tool. Very often, we use a separate user account to access the database used by our program. This post will explain you…

Continue Reading »

05/10/2013 by Nitesh

How to Count Work Days Between 2 Dates in SQL Server

Friends, This is a real quick post to explain how you can calculate the number of work days between 2 dates in SQL Server. This post considers the Workdays from Monday to Friday. In case you want the workdays from Monday to Saturday, read on. So, lets us write a function that will display the…

Continue Reading »

1 2 3 4