Is this possible? Let me elaborate.
I need to automate the execution of a bunch of sql script files (*.sql) placed by my users in a certain folder. One way I can do this is by using some kind of a script to loop thru the files in that folder and for each *.sql file found, launch a 'sqlcmd'
command to execute the current script file using the -i option, ie,
sqlcmd -S <server> -i <the current sql file in the loop>
I tried doing this, but ran into a liitle bit of difficulty with the particular scripting language (JAVA). I was going to research this a bit more, but I also wanted to consider something that doesn't involve another script.
So I was thinking about doing this using a stored procedure, but then I was wondering, how would I run a sql script file from sql server? The only way I can think of is still using sqlcmd, but then to use that within a stored procedure, I would need to turn
Although I can do that, that invloves getting other people involved so I was wondering if there is way to do this without turning on xp_cmdshell.
View Complete Post