TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
anjumathi kumar
NA
54
64.2k
How to insert my values to identity and non identity field using single query
Jun 24 2011 6:19 AM
use regimen SET IDENTITY_INSERT data ON insert into data (firstname,lastname,quantity,rollno) values ('yLMdxMRqUuwCWQMzfXeqhdymQDOaiBKSvYLUBigGHLfYHKwof','hEezSvnAnUYRgsKDhYeSXWQxJwXz','858437.74','98834') SET IDENTITY_INSERT data OFF
Hi this is my problem:
Here am randomly inserting strings and integer to the fields in the column.
like that while am inseting integer if the integer field is Identity(auto increment)]mean this query works perfect
but the fiels is not an identity(auto increment) mean it not work i got error not able to perform set opertation nu...so i want to insert integer for both Identity and non identity fields how to do that?
if i wantto insert identity field want to perform set operation on and off
non identity field no need to perform set operation
how to use both work in single query?how to modify my query?
anybody say the correct query for dynamically passing(inserting) integer for an identity and non identity fields?
Reply
Answers (
4
)
How to insert my values to identity and non identity field using single query
Select distinct