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.
| Author |
Topic |
|
drbeat
Starting Member
2 Posts |
Posted - 2005-02-09 : 20:36:28
|
| I am using bcp to bulk insert data into a table. If I run my bcp command from the command line, it works fine.However, if I save the command as a batch file and execute it from Windows, it doesn't work. If I execute the command from an ASP.NET page using the System.Diagnostics.Process class, it doesn't work. The behavior is consistent on both my web and database servers.My guess is that the command line runs bcp under the local system account, and that the batch file or ASP.NET method is using a windows account and that there is a permission discrepancy between the two. Does anyone know where I should look? My ultimate goal is to have the bulk copy take place as part of a scheduled batch file, or initiated from an ASP.NET page on an admin web site.Any insight would be appreciated!--Gregory Sandovalgsandoval@human-computing.com |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2005-02-09 : 22:31:47
|
| I run batch files from t-sql. Create the file then run them. It's handy in that you can keep the commands in a table or stored proc without having to maintain external files.See an examplehttp://www.mindsdoor.net/FTP/s_ftp_GetDir.htmlThis will run under the sql server service account is scheduled as sysadmin.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
drbeat
Starting Member
2 Posts |
Posted - 2005-02-14 : 12:26:10
|
| Thanks nr - yes running it from within SQL Server seems to work using the BULK INSERT command.I am really surprised that I can't seem to get the file to work from an ASP.NET page using the System.Diagnostics.Process class and BCP, but don't have time to dig into that further.Thanks,Greg |
 |
|
|
|
|
|