SS64 Discussion Forum

You are not logged in.

#1 2007-11-14 15:58:47

elwayisgod
New Shoes
Registered: 2007-11-14
Posts: 4

SQL Server 2000 - OSQL.exe help

Hi,

I have a osql.exe command that runs:
OSQL.exe -U sqltest -P p@ssword1 -S resiss131.res.newmont.com\HYPERIONDEV -n -Q "BACKUP DATABASE CORPGA TO DISK = '\\resiss108\D$\EssbaseBackup\Daily\SQL\CORPGA.dat_bak'" >> %ess_bkup_log_file% 2>&1


Question is I can't get it to run with Active Directory account I can only use a native account.  How can I use an AD account?


Thanks,

Sam

Offline

#2 2007-11-14 17:41:31

elwayisgod
New Shoes
Registered: 2007-11-14
Posts: 4

Re: SQL Server 2000 - OSQL.exe help

I got it.  Use -E switch and remove the -P and -U completely...  smile

Offline

#3 2007-12-20 05:32:55

shail_boy
Just Registered
Registered: 2007-12-20
Posts: 1

Re: SQL Server 2000 - OSQL.exe help

I am using below statement to capture the outpu of the script in a text file.
osql -q "exec mp_gen_restore_script" -d msdb -n -h-1 -S SQLCRT02 -w 500 -E -o d:\Reports\job_logs\Restore\%computername%_Restore_200712200423.log
The option -w 500 does not seem to work coz the generated output file splits the output line into 2 after approximately 340 characters. I tried to use -w500 (without space) also but no luck?  sad

Offline

Board footer

Powered by FluxBB