Posted by pankaj_wolfhunter on 12/08/05 05:23
Thanx for the reply. Sorry for that ASE thing.
But one thing. in my application we have a need to truncate the SQL
Servers table before loading data into it. I dont want to drop the
constraints.
One thing which we did was getting all the user defined tables with
child tables first and then the parent tables. So that we easily
truncate the child table and then the parent table. but i think the
list did not got generated properly. we used the following command:
SELECT o.name
FROM sysobjects o
WHERE o.type='U'
ORDER BY case WHEN exists ( SELECT *
FROM sysforeignkeys f
WHERE o.id = f.fkeyid )
THEN 1
ELSE 0
end, o.name
go
But i think some tables which are coming on top of the list are still
referencing some coming after.
We just want to truncate all the user defined tables without constraint
checking.
Is there any way?
TIA
[Back to original message]
|