Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating triggers and Stored Proc
Message
 
 
To
28/03/2009 21:31:14
Hong Yew
People Quest
Malaysia
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01392020
Message ID:
01392021
Views:
58
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform