Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 30th, 2004, 06:54 AM
Registered User
 
Join Date: Oct 2004
Location: Athens, , Greece.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default BULK INSERT PROBLEM

I have a problem using the BULK INSERT statement in a script.
The script looks like
  BULK INSERT xxxx from 'C:\TMP\yyyy.txt'
    with (FieldTerminator = ' ') ...

My problem is that the ASCII file have to be placed on the server
folder c:\tmp.
I would like to run the script from the network (from a Workstation)
placing the ascii file in a folder not in server.
Is it possible ?


Reply With Quote
  #2 (permalink)  
Old December 30th, 2004, 10:44 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

Do you mean before you place the file in the c:\temp it must exists?

and if it does not exists create it?

Jaime E. Maccou
Reply With Quote
  #3 (permalink)  
Old December 30th, 2004, 11:12 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

you can simple create a batch file that copies files from your workstation to the server folders

Code:
rem copy files from your work station
copy \\<your workstationname>\c$\folder\\yyyy.txt \
keep in mind that the account you use must have permission to read/write to the server folder.

you can also use xp_cmdshell

Code:
USE master
EXEC xp_cmdshell 'copy c:\tmp\yyyy.txt \\server\folder\', 
   NO_OUTPUT
Jaime E. Maccou
Reply With Quote
  #4 (permalink)  
Old January 3rd, 2005, 09:18 AM
Registered User
 
Join Date: Jan 2005
Location: Pune, Maharashtra, India.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to greenash Send a message via Yahoo to greenash
Default

A simple suggestion.
You can share the TMP folder on the Server and use the UNC path in the script as '\\ServerName\TMP\yyyy.txt'
Hope this helps.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 3 - Bulk Insert Example Problem. AP BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 4 February 5th, 2009 04:50 PM
Bulk Insert Problem starnet SQL Server 2005 5 April 17th, 2007 08:34 AM
hi problem on bulk insert command karthikc85 SQL Server ASP 1 November 8th, 2006 04:22 AM
Bulk Insert Problem pseudo SQL Server 2000 2 October 4th, 2006 06:48 AM
Problem with Bulk Insert starnet SQL Server 2000 1 September 13th, 2006 08:29 AM



All times are GMT -4. The time now is 05:54 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.