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





No comments: