Microsoft
Software
Hardware
Network
Question : Import data from ODBC source into SQL-Server via T-SQL
Dear Experts,
I have a ODBC-Source named 'FOO' installed (System-DNS), and it's working fine. Now I need to read in all rows from table 'KODATEN' from that ODBC source and put them into an existing table of same structure in the SQL-Server (ODBC-driver and SQL-Server reside on the same machine).
And, most importantly, it should be done via a T-SQL statement or something else that can be used inside a stored procedure. Solutions along the lines of "click on some wizard in the administration tool" won't be of much help, I'm afraid.
Is there a way to specify the ODBC source in the FROM clause of a SELECT statement?
To further illustrate my needs: I already succeeded in importing data from a CSV-file into SQL-Server by
BULK INSERT fcp..NTCS FROM 'D:\foo.csv'
WITH (
DATAFILETYPE = 'char',
FIELDTERMINATOR = ';',
ROWTERMINATOR = '\n',
)
Now I need to do the very same thing except reading from ODBC rather than from a CSV-file.
I guess the answer will be rather simple for the experts but it's all the more urgent.
Eagerly looking forward to your support,
woolf
Answer : Import data from ODBC source into SQL-Server via T-SQL
In BULK INSERT statement you need to specify the full path of the data file that contains data to copy into the specified table or view. BULK INSERT can copy data from a disk (including network, floppy disk, hard disk, and so on).
data_file must specify a valid path from the server on which SQL Server is running. If data_file is a remote file, specify the Universal Naming Convention (UNC) name.
http://msdn.microsoft.com/
library/de
fault.asp?
url=/libra
ry/
en-us/t
sqlref/ts_
ba-bz_4fec
.asp
I think you should create a linked server to your ODBC Source and then use BULK INSERT
or
Set up a DTS package and then execute it via T-SQL
Random Solutions
Forgot my original windows vista license key
Setting up Exchange Server 2003, Cisco Pix 501, DNS MX Record
SQL - SELECT x number of characters from a field
javascript buton click
Microsoft, NTFS Permissions, Windows 2003 R2, PowerShell, recursive search for folder, not file, ACLs on 200,000 folders
IE7 on WinXP Cookies Fail
smtp;550 5.7.1 Unable to relay for
Network PC user unable to install applications on own PC without being logged in as Administrator
I need to export Outlook 2000/02 contact list /calendar into Exchange 2000 for use via OWA, is this possible?
IFrame handling and hyperlinking