14/01/2015 by Nitesh

How To INSERT Values Explicitly in Identity Column in SQL

Friends, In this post, we will see how can we insert explicit values in an Identity column in a table in SQL Server. Normally, the data in IDENTITY column should not be entered manually, but there are certain circumstances where you want to insert custom data in the IDENTITY column. If you try entering data…

Continue Reading »

01/01/2015 by Nitesh

Solution: The server principal is not able to access the database under the current security context in SQL Server

Friends, Yesterday I backed up a SQL database and restored it on a different server. A user was associated with the database on the original server and after I restored it on the new server, the same user was unable to use the database. Trying to use the database gave the error – “The server…

Continue Reading »

30/12/2014 by Nitesh

Generate SQL Script to Manage Session State in Custom SQL Database

Friends, ASP.Net provides 3 different ways to store sessions. They are – InProc Session Mode StateServer Session Mode SQL Server Session Mode In case you are interested to read further about sessions, you can read this excellent article by Abhijit Jana. In this post, we will see some specific details about SQL Server Session Mode….

Continue Reading »

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 »

1 2