Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
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.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement