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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to import data from Excel

Status
Not open for further replies.

milulove04

Programmer
Nov 26, 2007
3
Hi all,

I want to know how to import data from Excel file in Teradata.
Can you guide particular for me?

Thanks,
Anthony
 
If you only have Excel and no other tools then I would suggest creating an empty table in Teradata and using VBA to establish a connection from Excel to Teradata. You can then use VBA to load the data. Below is some information that you would need to manage the connection (it executes SQL stored in an excel cell, so you could use excel to generate a Insert state with your values), but I suggest going to the VBA forum for additional help.

[tt]
Dim cnnTeradata As ADODB.Connection
Dim rsTblDetails As ADODB.Recordset

'open connection to Teradata

Set cnnTeradata = CreateObject("ADODB.Connection")
cnnTeradata.Properties("Prompt") = 1
cnnTeradata.Open

Set cmdCommand = New ADODB.Command
Set cmdCommand.ActiveConnection = cnnTeradata
With cmdCommand
.CommandTimeout = 2000
.CommandText = Worksheets("SQL").Cells(1, 1)
.CommandType = adCmdText
.Execute
End With
cnnTeradata.Close
[/tt]
 
hey
we can also do it alternately i have done it in a project
first we load the file in acess database and create a file that is directly send to the teradata server by vb script running in background.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top