Generate Storeprocedure Dynamically

SqlConnection conn; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { } } protected void btnConnect_Click(object sender, EventArgs e) { if (txtUserID.Text == “” && txtPassword.Text == “”) { conn = new SqlConnection(); string strConn = “Data Source=” + txtSQLName.Text + “; Initial Catalog=” + txtDBName.Text + “; Integrated Security=True”; conn.ConnectionString = strConn; conn.Open(); …

Check IsIdentity true or false

Find SQL Table Cloumn name, data type,  column size select column_name, data_type, character_maximum_length char from information_schema.columns where table_name=’tblCountry’ Find IsIdentity true columns SELECT * from information_schema.columns where columnproperty(object_id(table_name),column_name, ‘IsIdentity’)=1 and table_name=’personal’ Find IsIdentity False Columns SELECT * from information_schema.columns where columnproperty(object_id(table_name),column_name, ‘IsIdentity’)=0 and table_name=’personal’

Find Database, Tables, Procedure Names in SQL Server

Find all database names in sql server select name from sys.databases Find all tables names in sql server for perticular database select Table_name from information_schema.tables Find all procedure names in sql server for perticular database select name from sys.procedures where object_definition(object_id) not like ‘%sp%’ SELECT name FROM sys.objects WHERE type = ‘P’