If anyone can help me, please email me.
Thanks,
Arnold
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
aw...@truelink.com wrote in article <6erh3t$l5m$1...@nnrp1.dejanews.com>...
Guy Levin
Workgroup Consultants
select name from sysobjects where type="U"
go
>What I need to do is within a loop, call checkident on all the tables in a
>database. I was wondering if there is a way of getting the names of each and
>every table in a database through Transact-SQL.
>
>If anyone can help me, please email me.
>
>Thanks,
>Arnold
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/ Now offering spam-free web-based newsreading
Every database has a table called sysobjects,user defined tables have
a type = 'U' - here is a script to create an SP that updates stats on
all tables:
CREATE PROCEDURE reservations_update_statistics
as
declare listtables cursor
for select name from sysobjects where type = 'U' for read only
declare @name varchar(40)
open listtables
f
etch
next from listtables into @name
while @@fetch_status = 0
begin
EXECUTE ("UPDATE STATISTICS " + @name)
fetch next from listtables into @name
end
deallocate listtables