Reply to Disabling Constraint for Bulk Loading

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация