Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating triggers and Stored Proc
Message
 
 
À
28/03/2009 21:31:14
Hong Yew
People Quest
Malaisie
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01392020
Message ID:
01392021
Vues:
56
>Hi all
>
>May I know how I can update trigger and Stored Proc programmatically from a VFP application without using SQL Management studio?
>
>Your advice much appreciated.
>
>Best Regards

You can create a script (ALTER PROCEDURE or ALTER TRIGGER) and then run it from VFP using SMO, for example.

From the suggestion by George Tasker

George Tasker:


oSQL = CREATEOBJECT('SQLDMO.SQLServer')
oSQL.Connect(< server name >, < user name >, < password >)
oDatabase = oSQL.DataBases(< Database name >)
lccmnd = FILETOSTR(< SQL Script file >)
oDatabase.ExecuteImmediate(lccmnd)

Additionally there are ExecuteWithResults and ExecuteWithResultsAndMessages (two of them)methods
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform