Answer Posted / mohammadali.info
*SELECT...INTO essentially combines CREATE TABLE and SELECT in a single statement. The AS clause can be used to change the column labels and thus control the column names in the new table. The other commands in the figure show the new table's structure and contents.
-SELECT firstname, lastname, city, state
INTO newfriend
FROM friend;
-SELECT...INTO tablename can also be written as CREATE TABLE tablename AS SELECT.... The preceding query can then be rewritten as
CREATE TABLE newfriend AS SELECT firstname, lastname, city, state FROM friend.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Suggest a method of joining two tables.
What is always encrypted?
What is 'write-ahead log' in sql server 2000 ?
What are the filtered indexes?
Can we delete data from a view?
Suppose i have a table that contains 5 columns like col1,col2...colm5.I want to import only two column through BCP utility.How to do same through BCP in sybase.
How to create new tables with "create table" statements in ms sql server?
What are the five major components of a dbms?
What is not null constraint?
How to create user defined functions with parameters?
Differentiate between a primary key and a unique key.
Help!!!!!!!!!!!! My database has gone offline, it is highlighted as 'Suspect'. Foolishly, i haven't got a recent back up. Is there a way of quickly restoring the database? Thank you
How can I check that whether automatic statistic update is enabled or not?
List down some advantages of sql stored procedure?
Can I save my report as html, excel or word? : sql server management studio