Wednesday, June 29, 2022

find a table column in stored procedure in SQL Server

 SELECT  distinct OBJECT_NAME (id)

FROM syscomments

WHERE text LIKE '%GLMCU%'

GO

Tuesday, June 14, 2022

DROP INDEX SQL Server

 DROP INDEX SQL Server if exists


DROP INDEX IF EXISTS IDX_tbl_XXXData_RR ON tbl_XXXData_RR;


Monday, June 13, 2022

How to load Sql queries in SQL Server table

 Sometimes we need to load SQL code in a sql table and run that code in any application. you can load long SQL code using following:-

1. make your query in one line.

2.Open an excel and add a column name in excel, paste that query in a excel cell.

3. Load this excel in SQL server using sql import wizard.

4.  Create an insert statement to load in your main table with all the fields.

INSERT INTO table_sql(sqlname,sqldesc,date,user,sqlcode)

Select sqlname,sqldesc,date,user, Column01 sqlcode from YourUpoadedTable