Simplest way to execute SQL script

Hi all,

I have a .sql script that I want my DS job to execute on a SQL Server database on another server. What is the simplest way of doing this? I’ve tried the following:

sql(‘Target’, ‘D:\Scripts\VIEWS.sql’);

…but this doesn’t execute the contents of the script.

Thanks in advance!


amme (BOB member since 2014-05-16)

Either you call a script via the command line, where as the script can be independ be started from BODS. If cannot run it as a normal user, why would BODS run it?

Or you run the contents of the script in a sql() function.

But using a sql() function and then use the contents of a file, I have not seen that before.


Johannes Vink :netherlands: (BOB member since 2012-03-20)

You could try using the sqlcmd functionality, and fire it from BODS using exec().

for example:


H. Westerhof :netherlands: (BOB member since 2010-03-26)

Try using exec command in BODS.


googli (BOB member since 2009-10-22)

I assume you don’t need any columns to be returned for further processing in BODS. In case i would prefer making a Stored Procedure and calling it as a function from BODS.


BODSDW (BOB member since 2011-01-19)