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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 runing a set of result select on a sp_ ...............

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 int
exec ('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
go

and i try to

create proc spg_the_names
declare @names varchar(100)
@names = select name from tables
exec spg_insert_no @names
select * from no_columns
go and its just want work
thak'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 like

select rows from sysindexes where indid in (0,1) and id = object_id(@tablename)

so maybe

insert no_columns
select object_id(@tablename), getdate(), rows
from sysindexes
where indid in (0,1)
and id = object_id(@tablename)

Are you just trying to get the number of rows in tables?
if so see
www.nigelrivett.com
Get number of rows in tables

direct link
http://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.
Go to Top of Page
   

- Advertisement -