Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 03 Sep 2009 @ 13:16:36 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


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?



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023