General information
Forum:
Microsoft SQL Server
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.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only