Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rebuild relationships
Message
De
19/09/2005 00:42:47
Joel Hokanson
Services Integration Group
Bellaire, Texas, États-Unis
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Divers
Thread ID:
01037208
Message ID:
01050785
Vues:
23
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
Fil
Voir

Click here to load this message in the networking platform