Solved

SQL Import Record From A Text File

Posted on 2011-03-02
9
194 Views
Last Modified: 2012-05-11
I extracted a record from the DEV Dbase.  I need to import into the QA Dbase.  How do I import the record from a text file?

0
Comment
Question by:CipherIS
[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
9 Comments
 
LVL 41

Expert Comment

by:Sharath
ID: 35021691
Bulk insert the data from text file.
BULK INSERT your_table FROM 'C:\TxtFile.txt' WITH (FIELDTERMINATOR = ' |',,ROWTERMINATOR =' |\n')

Open in new window

http://msdn.microsoft.com/en-us/library/ms188365.aspx
0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 35021746

Or you can use the import wizard,
In SSMS, right click on the database you want to import data into, select All Tasks-> Import Data and follow the wizard
0
 
LVL 41

Expert Comment

by:Sharath
ID: 35021788
Do you have Dev and QA databases on same server or different servers?
0
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
LVL 1

Author Comment

by:CipherIS
ID: 35021821
1.  Don't have permission to use Bulk Insert.
2.  Dbases are on Diff Servers.
3.  Data in one column has comma's in it so SSIS is not working well.
0
 
LVL 40

Expert Comment

by:lcohan
ID: 35022124
If is a csv type file you could use : Q306397 HOWTO: Use Excel with SQL Server Linked Servers and Distributed Queries

http://support.microsoft.com/kb/306397
0
 
LVL 41

Expert Comment

by:Sharath
ID: 35022501
You can try any of these options - http://www.mssqltips.com/tip.asp?tip=1207
0
 
LVL 4

Expert Comment

by:samijsr
ID: 35025500
If you have permission to Run Ad Hoc Query then Save your Text file in Excel format and
Insert trhtough Sq=elect statement, make sure that number of columns are same and datatype matched.

Insert Into Table1
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
   'Excel 8.0;Database=c:\book1.xls', Sheet1$)

Ususally Ad HOC Query is Off so set Surface Area configuration to 1 and then Run the above Query
0
 
LVL 1

Accepted Solution

by:
CipherIS earned 0 total points
ID: 35180547
The resolution was to write a SQL BCP script
0
 
LVL 1

Author Closing Comment

by:CipherIS
ID: 35221133
Figured it out
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 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