Home > SQL Development > Converting a view into a table.

Converting a view into a table.



<i><b>Originally posted by : Padmaja Tallavajhala (coolpersona@hotmail.com)</b></i><br />I want to know how to create a table from a view. I currently use SQL Server 7.0 and I have a view. But I want to know how to convert this into a table so that I can copy this table to an access database.<br /><br />Hope to hear soon from somebody.<br />Regards,<br />Padmaja.<br />

    
Guest


<i><b>Originally posted by : Graham Masters (graham_masters@yahoo.com)</b></i><br />If this is a one time or infrequent event then simply create a staging table using a SELECT 匢NTO statement. Thus if your view is called X then type in ISQL or Query Analyzer:<br /><br />SELECT * INTO TEMP from X<br /><br />This statement will both create the table TEMP and copy the rows from X.<br /><br />TEMP is now the table you can save to Access. After saving remember to:<br /><br /> DROP TABLE TEMP<br /><br /><br /><br /><br />------------<br />Padmaja Tallavajhala at 6/11/2001 4:35:01 PM<br /><br />I want to know how to create a table from a view. I currently use SQL Server 7.0 and I have a view. But I want to know how to convert this into a table so that I can copy this table to an access database.<br /><br />Hope to hear soon from somebody.<br />Regards,<br />Padmaja.<br />

Was this answer helpful ? Yes No   
Guest


<i><b>Originally posted by : Padmaja Tallavajhala (coolpersona@hotmail.com)</b></i><br />Hi Graham,<br /><br />Thanks for the suggestion. I actually tried your approach and it worked. But I tried with a slight variation.<br /><br />SELECT select_list<br />[INTO new_table_]<br />FROM table_source<br />[WHERE search_condition]<br />[GROUP BY group_by_expression]<br />[HAVING search_condition]<br />[ORDER BY order_expression [ASC | DESC] ]<br /><br />I mentioned all the column names from the view name instead of selecting * as I wanted only selected information to show to in the new table.<br /><br />Regards,<br />Padmaja.<br /><br /><br />------------<br />Graham Masters at 6/11/2001 5:10:27 PM<br /><br />If this is a one time or infrequent event then simply create a staging table using a SELECT 匢NTO statement. Thus if your view is called X then type in ISQL or Query Analyzer:<br /><br />SELECT * INTO TEMP from X<br /><br />This statement will both create the table TEMP and copy the rows from X.<br /><br />TEMP is now the table you can save to Access. After saving remember to:<br /><br /> DROP TABLE TEMP<br /><br /><br /><br /><br />------------<br />Padmaja Tallavajhala at 6/11/2001 4:35:01 PM<br /><br />I want to know how to create a table from a view. I currently use SQL Server 7.0 and I have a view. But I want to know how to convert this into a table so that I can copy this table to an access database.<br /><br />Hope to hear soon from somebody.<br />Regards,<br />Padmaja.<br />

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved