AllExperts > Experts 
Search      

Database Programming

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Database Programming Answers
Question Library

Ask a question about Database Programming
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Ivan Maskovic
Expertise
I can answer questions regarding Relational Model of data, SQL, data modelling and databases.

Experience
I have been developer of data driven applications since 1989.

Education/Credentials
I have master degree in informatics.

Awards and Honors
Microsoft Certified Professional - SQL Server 2000

 
   

You are here:  Experts > Industry > Data Management > Database Programming > sql - create table

Topic: Database Programming



Expert: Ivan Maskovic
Date: 5/25/2007
Subject: sql - create table

Question
hi Ivan,

I'am currently using terradata and sql to access our dataware house, I'am new to both.

I'm currently having issues with the size of some of my result sets and would like to have the database automatically load the results into a table(not a volatile table) so I can then reference these result on other query

I know how to create a table and manually input record but I would like to have my script automatically load the results into the new table.

Can you provide some assistance on how to tell sql to input results directly to another table.

Regards
Sean

Answer
Hi Sean,

First I should tell I have no experience with terradata.
But if I understand your issue right, a SELECT INTO Clause would help you, when using MS SQL Server.

Example:
Your result is obtained using this SELECT:
SELECT COL1,COL2
FROM TABLE1
WHERE COL1 > 1234

If you want your result to automatically load into new table (named MyTable2) , you should write:
SELECT COL1,COL2
FROM TABLE1
WHERE COL1 > 1234
INTO MyTable2

Hope this helps.
Regards,
Ivan  

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.