C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




insert statement


Posted Date: 04 Jul 2008      Total Responses: 2

Posted By: Ramesh Narayan       Member Level: Gold     Points: 1



In a table test 3 columns contains i need to insert for only 2 columns using the below query method am unable to insert how can i insert for particular column

Table contains 3 columns:

These query not working:-
insert test(name1,fname)
select name1,fname from test

These query working:-
insert test(name1,fname,lname)
select name1,fname,lname from test






Responses

Author: Shivshanker Cheral    04 Jul 2008Member Level: DiamondRating:     Points: 4

the lname field may have constraint not null
check if it there then you need to insert compulsory the third field also.

Other wise it will insert into 2 fields or even 1 field also but othe fields should not have the constraint not NULL

Thanks
Shivshanker cheral



Author: Ashok    04 Jul 2008Member Level: GoldRating:     Points: 1

Use this query....
INSERT INTO test(name1,fname)VALUES('ABC','XYZ')
SELECT name1,fname FROM test



Post Reply
You must Sign In to post a response.
Next : Send SMS using VB .NET
Previous : insert statement
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use