?
Solved

SQL Import Record From A Text File

Posted on 2011-03-02
9
Medium Priority
?
195 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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

771 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