Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rebuild relationships
Message
 
 
To
19/09/2005 00:42:47
Joel Hokanson
Services Integration Group
Bellaire, Texas, United States
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
01037208
Message ID:
01050967
Views:
20
What is actual error is returned when TRUNCATE TABLE is run?

>Yes, I thought it would work from SQLEXEC but I am not having any success.
>
>
>hsql=SQLSTRINGCONNECT('dsn=ABC_NEW;uid=sa;pwd=xray')
>returns a positive connection number
>
>xEXEC= 'EXEC sp_MSforeachtable @command1="ALTER TABLE ? NOCHECK CONSTRAINT ALL"'
>xxx=SQLEXEC(hsql,xEXEC)
>? xxx
>
>Works well and has a return XXX value of +1
>So NOCHECK is being activated as expected
>
>
>
>
>STORE UPPER(ALLTRIM(kill_tables.table)) TO m.table
>xaction="TRUNCATE TABLE "+m.table
>? xaction
>xx=SQLEXEC(hsql,xaction)
>? xx
>Always return -1 because of constraints defined in other user tables
>
>It seems that the nocheck on constraints just lasts for the one command that turns it off, but the
>constraints are BACK ON for next commaand.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform