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.
| Author |
Topic |
|
PeterT
Starting Member
2 Posts |
Posted - 2004-11-19 : 18:16:54
|
declare @tablename varchar(32), @count intset @tablename = 'authors'exec ('DECLARE crsr_Counts CURSOR FOR SELECT COUNT (*) FROM [pubs].[dbo].'+@tablename+'')open crsr_Countsfetch next from crsr_Counts into@countIF @@FETCH_STATUS = 0 -- fetch successprint @countCLOSE crsr_CountsDEALLOCATE crsr_Counts |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-11-19 : 18:43:29
|
nice cursor.... totaly useless but nice...what on earth are you trying to do with that?????edit:what's wrong with:declare @tablename varchar(32),set @tablename = 'authors'exec ('SELECT COUNT (*)FROM [pubs].[dbo].'+@tablename)Go with the flow & have fun! Else fight the flow |
 |
|
|
|
|
|