显示标签为“osql”的博文。显示所有博文
显示标签为“osql”的博文。显示所有博文

2012年3月20日星期二

Any way to pass command line variables to osql

I want to pass a command line values into an osql run stored procedure.
The commandline values should be are the values to put into the insert stored procedure that writes them to a table.
Is it possible to do this.if ur parameter is positioned 2nd then add this code in your command file.

<varname> is some variable name that you want to use to trap the parameter. lets say empid for instance

SET empid=%2

after this, the place where u wud be calling ur stored procedure use this syntax.

osql -S servername -l 60 -n -E -d dbname
-Q"EXEC sp123 @.Var1 = '%empid%'"

2012年2月16日星期四

Any DOS utility for MDX?

Hi,

Is there any DOS utility can run MDX query ( like sqlcmd and osql for TSQL.)?

We need schedule a MDX query for creating a local cube file.

Appreciate any help on this.

The ASCMD utility, provided as one of the SSAS samples, can be used for this kind of thing. Here's a link on how to use it:

http://msdn2.microsoft.com/en-us/library/ms365187.aspx

Samples can be downloaded at:

http://msdn2.microsoft.com/en-us/library/ms365187.aspx

Please note, you will need to compile the utility per the instructions provided.

Good luck,
Bryan

|||Hi Bryan,

Thank you so much for the answer, I am going to try that.

Appreciated your help.