var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: How to Execute
If we execute Query (Text Format), I’m getting Insert statements in result set
Right Now; I'm doing, Copy and Paste the result set in Query window and again running the query to insert into Table.
Is there any way, to execute it Dynamically(instead of copy & paste)
can Any one help with this.
Look into this query:
SET NOCOUNT ON
Drop Table ##Temp1
Create Table ##Temp1 ( X Varchar (22), Name Varchar (30), Z Varchar (30))
Insert into ##Temp1
select 'select count(*) from ' AS X, Name AS Y, 'Insert into ##1' AS Z
from sysobjects where xtype = 'u'
order by name
-- SELECT * FROM ##Temp1
Drop Table ##1
Create Table ##1(Table_Name Varchar(50), No_Of_Rows Int)
select Z + char(10) + 'Select '+ '"' + A.Name + '" ' + 'As Table_Name, ' +
'count(*) As No_of_Rows from '+ A.Name
from sysobjects A , ##Temp1 B
where A.Name = B.Name and xtype = 'U'
order by A.Name
Re: How to Execute
EXECUTE should execute your SQL statement
Make everything as simple as possible, but not simpler! - A. Einstein
DB Problems? DB Explorer
, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool