473,545 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Import Text File on remote server

Hi there,

When importing a text file using SQL Server, how do I specify the path
to a file on the same remote server that SQL Server is running on? I
tried //c:/filename but that doesn't seem to work.

Also, once the import is working, how do I write a DTS package to
first delete all rows in a table, then repopulate with the text file,
or is it easier to drop the table, re-create it and then repopulate?
The table will contain approximately 30,000 records.

thanks for your help,
K
Jul 20 '05 #1
4 8462
Exactly how are you importing the file? If this is a DTS Bulk Insert task
or T-SQL BULK INSERT statement, you can specify 'c:/filename' to import a
file that is on the same machine as the SQL Server.

In the case of a DTS Transformation, the path is relative to the machine one
which the DTS package executes. The path is the same as above if the DTS
package is run on the SQL Server.

You can truncate the table in your DTS package with an Execute SQL task that
executes TRUNCATE TABLE. Specify the task a workflow predecessor so that it
runs before your import.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"Kevin Forbes" <ke*********@ya hoo.com> wrote in message
news:25******** *************** ***@posting.goo gle.com...
Hi there,

When importing a text file using SQL Server, how do I specify the path
to a file on the same remote server that SQL Server is running on? I
tried //c:/filename but that doesn't seem to work.

Also, once the import is working, how do I write a DTS package to
first delete all rows in a table, then repopulate with the text file,
or is it easier to drop the table, re-create it and then repopulate?
The table will contain approximately 30,000 records.

thanks for your help,
K

Jul 20 '05 #2
Kevin,
There are some great lessons on importing and DTS packages on our site
at www.TechnicalVideos.net. Also covers creating data imports, stored
procedures and temporary tables.

Best regards,
Chuck Conover
www.TechnicalVideos.net

"Kevin Forbes" <ke*********@ya hoo.com> wrote in message
news:25******** *************** ***@posting.goo gle.com...
Hi there,

When importing a text file using SQL Server, how do I specify the path
to a file on the same remote server that SQL Server is running on? I
tried //c:/filename but that doesn't seem to work.

Also, once the import is working, how do I write a DTS package to
first delete all rows in a table, then repopulate with the text file,
or is it easier to drop the table, re-create it and then repopulate?
The table will contain approximately 30,000 records.

thanks for your help,
K

Jul 20 '05 #3
Hi

As well as looking through Books online the following web site
http://www.sqldts.com/
is well worth a look.

You can use the TRUNCATE TABLE statement see books online:

mk:@MSITStore:C :\Program%20Fil es\Microsoft%20 SQL%20Server\80 \Tools\Books\ts q
lref.chm::/ts_ta-tz_2hk5.htm

from a Execute SQL Task

mk:@MSITStore:C :\Program%20Fil es\Microsoft%20 SQL%20Server\80 \Tools\Books\dt s
sql.chm::/dts_elemtsk2_3e 0b.htm

The input file specification will be local to the server it is being
executed on, therefore c:\filename should be ok.
John

"Kevin Forbes" <ke*********@ya hoo.com> wrote in message
news:25******** *************** ***@posting.goo gle.com...
Hi there,

When importing a text file using SQL Server, how do I specify the path
to a file on the same remote server that SQL Server is running on? I
tried //c:/filename but that doesn't seem to work.

Also, once the import is working, how do I write a DTS package to
first delete all rows in a table, then repopulate with the text file,
or is it easier to drop the table, re-create it and then repopulate?
The table will contain approximately 30,000 records.

thanks for your help,
K

Jul 20 '05 #4
Thanks for your help,

I was just using the import data wizard and then saving it as a DTS
package, I don't know much about DTS programming but will give your
suggestions a try.

thank you,
K

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
9271
by: jj | last post by:
It's taking forever to upload 400,000 records to the database through access/odbc, and I've tried phpMyAdmin's interface but it seems to timeout during import of a CSV file. Is there a better way to import 400,000+ records?
1
7537
by: Sven | last post by:
Hello, I am receiving a text file that is produced from a mainframe that is out of my control. I am attempting to find a (hopefully clean) way to import it into a SQL Server database in an automated fashion. I am not really concerned about how many tables it requires or what the schema looks like as long as the data remains related and...
1
5886
by: Chris | last post by:
Background: I am using a MS Access 2000 front end with SQL Server 8.0 back end. I have the requirement to import all text files (regardless of filename) from a given folder on the network into a table within SQL Server. This import needs to run continuously, as more text files will be saved in the folder by a separate system and they need...
0
1758
by: Don Grover | last post by:
I may not explain myself properly as I am a newby to xml & xsl so please allow for this. I am using HTTP Post to get a XML-RPC file from a remote server and need to convert it to a string suitable to import into mssql server. I have a vbscript that has a function where i have an xml file imported into a string that i need to apply a xsl...
4
12682
by: news | last post by:
Our production database in an exported textfil runs about 60 MB. Compressed that's about 9 MB. I'm trying to import the export into another machine running FC3 and mySQL 11.18, and it appears as though the file may be too big! When I try to do it via command line: mysql -u root --host=localhost printing < ./printing.txt It eventually...
1
3305
by: Trevor | last post by:
I posted this message last week but seem to be missing a few days posts. We currently run our web site in php and are now converting it to asp.net to match the rest of our business that is .net based. I have tried using the following code layout to open the file I require but get an illigal character exception when I try and open the file. ...
1
4011
by: David Berry | last post by:
Hi All. I'm looking for any help or sample code that can show me how to make a file import wizard in ASP.NET (VB preferred) like the one that MS Access uses. I'm working on a web site where the user has the ability to upload a file (.txt or .csv). The data in the file may be comma delaminated, tab delaminated, fixed width etc (we don't know). ...
2
5309
by: RdS | last post by:
Hello, I use sourcesafe and vb 2003 for my dev environment. on the sourcesafe server I also have sql2005 and reporting services installed. The web app references this sql server for db. When I compile the app on my local machine which is used for development I am able to lauch application with no problem. When I run my web app on my...
13
31369
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one outside of our domain, we get the error.. ** Client found response content type of 'text/html; charset=Windows-1252', but expected 'text/xml' **. We...
0
7473
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7406
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7813
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7431
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7761
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3457
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1888
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1020
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
709
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.