February 8, 2005 at 9:21 am
We get requests to run update SQL on our prod SQL Svrs all the time. My boss wants me out of the prod fix business. So, how can I run say an update script via a .bat file that our scheduling software can execute ? It needs to call Query analyzer and I can't figure out how to do this.... Any help would be appreciated...
February 8, 2005 at 9:57 am
Check Books Online for the OSQL command prompt utility.
Steve
February 9, 2005 at 7:34 am
We do this all the time by way of vbscript (using environmental variables for things like the server.database.login.password) and even using variables for the proc name, file name being processed (if importing), file path for import or export, etc. We create 3 directories on an application server running Zeke or Team Agent (more reliable and much more functionality than SQL scheduler). One directory holds the batch file and any supporting files (like ini's), another holds import and/or export files and the last holds the results of each batch execution. The vbscript can use either BCP and directly execute procs OR it can execute DTS packages (whatever is more appropriate for what you're doing).
Another good option is to add functionality to GUI's that allow a restricted user role (like Admin) to perform data manipulation that you are regularly asked to do.
As an application developer, I have NO access to the production databases I support, but can handle 99% of the requests I get by adding application functionality OR by creating very dynamic batch files (we actually call them something else now because a DBA was kind enough to break them up into cartridges so they are even more scalable and easier to maintain/change). Our team supports 12 client-server (SQL) applications with over 15,000 end users and we make less than 10 ad-hoc data requests to our DBA each year.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply