Reply to Thread

Post a reply to the thread: how do i get error details from running a sql script?

Your Message

Click here to log in

What's the name of our main installation product (in uppercase letters), directly followed by the current year?

 

You may choose an icon for your message from this list

Additional Options

  • Will turn www.example.com into [URL]http://www.example.com[/URL].

Topic Review (Newest First)

  • 08-12-2010, 12:58 AM
    mcchuckle

    Re: how do i get error details from running a sql script?

    hi frederich,

    thanks for your post.

    i believe i am already doing this but i only get back a 0 or a 1 for success or failure. if an error has occurred, there is no useful information to feed back to the user to tell him/her which particular part of the sql execution failed. ideally i would like to know if there is a mechanism by which the sql error code and the sql error text can be put into SetupBuilder variables and displayed to the user to show why the install failed. i would imagine that this requires native support for execution of tsql commands. i have seen other posts to this forum that indicate execution of tsql commands is on the drawing board. is it likely to be included in SetupBuilder any time soon?

    (http://www.lindersoft.com/forums/sho...&highlight=sql)

    thanks

    rob
  • 06-10-2010, 12:19 AM
    linder

    Re: how do i get error details from running a sql script?

    Rob,

    If you are using the "Run Command Line" function, then %_SB_ERRORCODE% holds the return value of the CreateProcess Windows API (if it succeeded) or the value of GetLastError (if available) if it failed.

    I would suggest to use the "Run Program" function -- this allows you to retrieve the ExitCode of the executed application (if it returns any code).

    Does this help?

    Friedrich
  • 06-09-2010, 09:17 PM
    mcchuckle

    how do i get error details from running a sql script?

    hi there,

    i am using the 'run command line' function to run osql.exe which executes a sql script on a sql server. i then look at %_SB_ERRORCODE% to confirm it ran ok.

    it seems to me that %_SB_ERRORCODE% only produces a 1 or 0 for an osql execution. this makes installation troubleshooting a bit difficult because an error could occur in numerous places and it would be useful to let the user know exactly what type of error occurred. eg it could be a problem with a foreign key violation in the database, or it could be that the user does not have permissions on the sql server.

    i found some previous forum posts that advise that native sql execution is on the cards for SetupBuilder some time in the future. has this been progressed? if not, is there a way of getting the precise error details for an osql execution?

    thanks

    rob

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •