[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

10/27/2009 at 12:43PM PDT, ID: 24848568 | Points: 500
[x]
Attachment Details

INSERT and SELECT in SQL SERVER 2005

Asked by Rajan881 in Unix Setup, SQL Server 2005

Please see the below SQL statement

INSERT INTO table_name
select * form view_object

Case 1:
example table_name has a, b,c as the field names.
View_object has d,e,f as the field names.
The datatypes matches with each field (example a datatype = d datatype, b datatype = e datatype, f datatype = c datatype)

If I execute the above query what will happen ?

Case 2:
example table_name has a, b,c as the field names.
View_object has d,e,f as the field names.
In this case the fields are not having matching datatypes.

When I execute the query what will happen ?

Case 3:
example table_name has a, b,c,d as the field names.
View_object has d,e,f as the field names.
The datatypes matches with each field (example a datatype = d datatype, b datatype = e datatype, f datatype = c datatype)

If I execute the above query what will happen ?

Case 4:
example table_name has a, b,c as the field names.
View_object has a,b,c,e as the field names.
If I execute the above query what will happen ?






[+][-]10/27/09 12:49 PM, ID: 25676619

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/28/09 10:49 PM, ID: 25690966

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_3_20080625