It looks like you're new here. Sign in or register to get started.
How does Navision execute Stored Procedure in Navision SQL DB?
Automation variables: autSQLServer 'Microsoft SQLDMO Object Library'.SQLServer autDatabases 'Microsoft SQLDMO Object Library'.Databases autDB 'Microsoft SQLDMO Object Library'.Database autStoredProcedures 'Microsoft SQLDMO Object Library'.StoredProcedures autSP 'Microsoft SQLDMO Object Library'.StoredProcedure res 'Microsoft SQLDMO Object Library'.QueryResults the code you could use: CREATE(autSQLServer); autSQLServer.Connect(servername, username, password); //get databases autDatabases:=autSQLServer.Databases; //get first db (master) autDB:=autDatabases.ItemByID(1); //get stored procedures list autStoredProcedures:=autDB.StoredProcedures; //find the dt_verstamp006 stored procedure i:=1; WHILE autStoredProcedures.Item(i).Name <> 'dt_verstamp006' DO i:=i+1; autSP:=autStoredProcedures.Item(i); res:=autDB.ExecuteWithResults(autSP.Name); MESSAGE(res.GetColumnString(1,1)); autSQLServer.DisConnect; autSQLServer.Close; CLEARALL;
Comments
I I understand correctly, you want to execute an sp from an SQL Server.
I will write a quick example of connecting, getting an sp from a db, executing and displaying some data:
Arhontis
https://forum.mibuso.com/search
This is great, buddy!
Thanks, I think you are very good on these.. (you write quickly) :!:
I'll try and let you know the result...