October 24, 2006 at 7:44 am
Hello,
You can do it like this
Decare @yourtable table
(colname datatype,
colname2 datatype)
insert into @yourtable select col1, col2 from yoursecondtable where condition
select * from @yourtable
Hope this helps.
Thanks
Lucky
October 24, 2006 at 8:01 am
Thanks but itisnt that i was looking for
well but i found like to solve my problem look
DECLARE @iCount int
DECLARE @table sysname
DECLARE @SQLString nvarchar(100)
DECLARE @ParmDefinition
nvarchar(100)
SET @table = 'sysobjects'
SET @SQLString = N'SELECT @C = COUNT(*) FROM '+ @table SET
@ParmDefinition = N'@c int OUTPUT'
EXECUTE sp_executesql @SQLString, @ParmDefinition,@c = @iCount OUTPUT
SELECT @iCount AS [Count]
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply