Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 OSQL command or BCP not running

Author  Topic 

shiyam198
Yak Posting Veteran

94 Posts

Posted - 2008-08-18 : 13:11:15
Hi,

I have the following script (setup.bat) that I run on SQL server 2005. But it is not doing any thing. They normally run some SQL scripts and load Data with BCP.

It is working in other servers (They run SQL server 2005 too). Is there any other setup on my server i might be overlooking.

Thanks, Shiyam




@echo off
@echo off > Setup.log

@echo Create tables
osql.exe -n -r -U"sa" -P"<Password>" -d ClientProd -i 0100_TS.sql >>..\Setup.log 2>>&1

@echo Install required base data
osql.exe -n -r -U"sa" -P"<Password>" -d ClientProd -i 0200_security.sql >>..\Setup.log 2>>&1

@echo Install registry
osql.exe -n -r -U"sa" -P"<Password>" -d ClientProd -i deleteregistry.sql >>..\Setup.log 2>>&1
osql.exe -n -r -U"sa" -P"<Password>" -d ClientProd -i 0410_registry_type_data.sql >>..\Setup.log 2>>&1
bcp databaseProd.dbo.ts_registry_node in "regnode.txt" -c -C"RAW" -U"sa" -P"<Password>" -t"|||" -r"|||\n" >>..\Setup.log 2>>&1
bcp databaseProd.dbo.ts_registry_value in "regvalue.txt" -c -C"RAW" -U"sa" -P"<Password>" -t"|||" -r"|||\n" >>..\Setup.log 2>>&1

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-08-18 : 13:47:01
Are there errors?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

shiyam198
Yak Posting Veteran

94 Posts

Posted - 2008-08-22 : 15:50:02
No. setup.log file is empty. I have a feeling something wrong with the User ID. but i checked the

1. usermappings
User ID has DB owner and public

2. Server roles
DB creater
Public
Server admin.

Any thing missing here /

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-08-22 : 16:54:03
Have you tried running each bcp command in a cmd window, without sending the output to Setup.log?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -