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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-05-30 : 08:30:37
|
| gallush writes "i have my sp_ Create Procedure spg_insert_no @TableName VarChar(100)AS--ok so this tabel declareion is importent and the insert at last want work with out the declareion Create Table #tempauth(size int)declare @antal intexec ('declare @antal int select @antal = count(*) from ' + @TableName + ' as size insert into #tempauth values(@antal)')select id =( select id from tables where name = @TableName ), getdate()as date into #tempauth1 --than i just trow the rest in to anther #temp table insert into no_columns select * from #tempauth1, #tempauth --and at last that main insert goand i try tocreate proc spg_the_names declare @names varchar(100) @names = select name from tables exec spg_insert_no @names select * from no_columnsgo and its just want workthak's ahead gallush" |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2002-05-30 : 11:00:05
|
| to get the number of rows in the table something likeselect rows from sysindexes where indid in (0,1) and id = object_id(@tablename)so maybeinsert no_columns select object_id(@tablename), getdate(), rowsfrom sysindexeswhere indid in (0,1) and id = object_id(@tablename)Are you just trying to get the number of rows in tables?if so seewww.nigelrivett.comGet number of rows in tablesdirect linkhttp://home.btclick.com/NIGELRIVETT/sp_GetRowsForAllTables.html==========================================Cursors are useful if you don't know sql.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|