Archives of the TeradataForum
Message Posted: Thu, 03 Sep 2009 @ 13:16:36 GMT
Subj: | | Re: Create table and insert data from MS SQL Server |
|
From: | | Mohommod.Khan |
Since you are able to create the connection you will need to write an SP and within that do the following:
1. Create the desired table
2. Then open a Cursor - to fill data by selecting from your Teradat link some thing like this:
DECLARE tmpCursor cursor for
SELECT fields FROM OPENQUERY(TERADATA_CON,
'SELECT TFields from Tera_Tables
WHERE <>
');
3. Now Do the insert some thing like this:
OPEN tmpCursor
FETCH next from tmpCursor into @SomeField1, @someField2
WHILE (@@fetch_status = 0)
begin
-- Do insert and SQL table
end;
CLOSE tmpCursor
Hope you got the idea. Easy right?
|