|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 7/30/2009 7:25:08 AM
Posts: 9,
Visits: 30
|
|
I need to create a temporary table using as source a portion of another table from my TeraData DataBase.
The temporary table must have the same definition of the source table.
I know what the syntaxe would be like in SQLServer:
"Select top 10 * into TempTable from SourceTable"
But when I try this in TeraData I get the error message:
Syntaxe error: INTO clause is not allowed.
Can anybody help me to solve this problem or find another way to do the trick?
Thanks in advance.
Rodrigo.
|
|
|
|
|
Forum Member
      
Group: Forum Members
Last Login: 10/22/2009 10:24:19 AM
Posts: 39,
Visits: 213
|
|
Try INSERT INTO TempTable SELECT TOP 10 * FROM SourceTable if TempTable is created beforehand.
Try CREATE TABLE AS... syntax if not.
HTH
Cheers.
Carlos.
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 7/30/2009 7:25:08 AM
Posts: 9,
Visits: 30
|
|
Never mind answering, guys, I have already found out how to do what I need.
Just to register here the solution I came up with (and hopefully help anyone who eventualy stumbles in this issue):
"CREATE TABLE tempTable AS (select top 10 * FROM sourceTable) WITH data;
Note: The version 12 of TeraData does not support this construction for sourceTables containing Identity Columns =/ I hope they fix that for newer versions...
Regards.
Rodrigo.
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 7/30/2009 7:25:08 AM
Posts: 9,
Visits: 30
|
|
Hehehe that is just what I did, Carlos!
Thanks, anyway.
;)
Rodrigo.
|
|
|
|