Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
HiI want to store exec() output into a variable how it will be.declare @Tablename varchar(30)select @Tablename ='USR012'declare @SQLQuery1 varchar(100),@sqlquery2 integerselect @SQLQuery1='select count(*) from'+' '+@Tablenameselect @sqlquery2=exec(@SQLQuery1)Ranjeet Kumar Singh