Posted by pankaj_wolfhunter on 12/07/05 14:30
Greetings,
I want to bulk load data into user defined SQL Server
tables. For this i want to disable all the constraints on all the user
defined tables.
I got solution in one of the thread and did the following:
declare @tablename varchar(30)
declare c1 cursor for select name from sysobjects where type = 'U'
open c1
fetch next from c1 into @tablename
while ( @@fetch_status <> -1 )
begin
exec ( 'alter table ' + @tablename + ' check constraint all ')
fetch next from c1 into @tablename
end
deallocate c1
go
Now when i try to truncate one of the tables (say titles) it gives me
the following error:
Cannot truncate table 'titles' because it is being referenced by a
FOREIGN KEY constraint.
Can anyone show me the right path? I am working on ASE 12.5
TIA
Navigation:
[Reply to this message]
|