Solved

import a text file into SQL using VBS / powershell

Posted on 2011-02-23
5
1,124 Views
Last Modified: 2012-05-11
could somebody post a sample script of how to import text files into a sql table.
0
Comment
Question by:CaptainGiblets
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 37

Expert Comment

by:Neil Russell
ID: 34962227
What SQL server?
Mysql, mssql2005,2008, access?
0
 
LVL 6

Author Comment

by:CaptainGiblets
ID: 34962238
2008
0
 
LVL 37

Accepted Solution

by:
Neil Russell earned 500 total points
ID: 34962255
Why not just use SQL's BULK INSERT ?

BULK
INSERT TABLENAME
FROM 'c:\csvfile.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
0
 
LVL 6

Author Comment

by:CaptainGiblets
ID: 34962312
i only have the express version and i am running a ps file that exports all the event logs to my servers to a folder, so there will be around 30 different files to import daily after the ps file has ran.
0
 
LVL 37

Expert Comment

by:Neil Russell
ID: 34962319
Or register for a free account here IF you dont already have one and read this....

http://www.sqlservercentral.com/articles/powershell/65196/
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question