Can you confirm the ways I can apply the scripts generated?

spireitespireite Posts: 25
edited October 4, 2004 6:02PM in SQL Toolkit Previous Versions
As I understand it, the scripts generated by the Toolkit can only be applied through....

OSQL
Query Analyzer
SQL-DMO

Is there anything I've overlooked? The reason I ask is that I may be asked if I can let an enduser apply the script. Obviously, installing any of the above on an endusers machine may be an issue for customer administrators. Is there anyway I can leverage ADO for this?
Everytime I ty, the GO command of course is incompatible for ADO.

Or is it a case of using .NET to achieve this without resorting to OSQL.QA/DMO?

Cheers for your help - its really appreciated!

Comments

  • Rather than generating one big script with GO statements between batches you could use the ExecutionBlock.GetBatch(i).Content method to retrieve the individual batches, save them to disk as separate files, and then run those files separately. Alternatively, you could output the batches in one big file but rather than separate them by GO (which is what the toolkit does), separate them by something like:

    --THIS IS THE END OF A BATCH
    GO

    When you want to run the script on the client you could parse the script and then split it whenever you see that comment.

    Another possibility would be to generate the script on the client rather than the server by using the toolkit and then using the Utils class to execute the SQL.

    Yet another option would be to use SQL Packager to generate a .exe file with all the SQL statements in it.
    - Neil Davidson
    Red Gate Software Ltd
  • Now you mention int, I did think about parsing and splitting on the GO, but didn't really pursue it that much due to time constraints at the time and not trusting to how reliable it may be do that. I may have to consider it though.

    The Packager would have been great at , but it came out a little too late in our timeline to be implemented. Maybe considered for the future though.
This discussion has been closed.