Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What technology for mass data extraction from SQL2k SP4 to files?

Status
Not open for further replies.

davidchardonnet

Programmer
Mar 21, 2001
167
0
0
FR
Hello,

I have to choose the right technology to make the data extraction from a SQL Server 2000 SP4 to text files.
We have lots of data and the goal is to make these files available for input in other databases, and we don't know what technology they use.

Thank you for your help

David
 
Every database has the ability to import ASCII files. When you install SQL Server, there is a command line utility that is also installed called BCP.exe. You can use this utility to extract data from your existing database in to flat ascii files.

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Here is an example of what George suggested.

Code:
DECLARE @sqlcmd VARCHAR(2000)
SET @sqlcmd = 'BCP myDatabase.dbo.myTable OUT \\myServername\E:\myTableasfile.data -SmyServername -T -b10000 -n'
EXEC master.dbo.xp_cmdshell @sqlcmd
GO

--BCP IN
DECLARE @sqlcmd VARCHAR(2000)
SET @sqlcmd = 'BCP myNewDatabase.dbo.myTable IN E:\myTableasfile.data -T -b10000 -n'
EXEC master.dbo.xp_cmdshell @sqlcmd
GO

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top