>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