Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
How to insert my values to identity and non identity field using single query
anjumathi kumar
Jun 24 2011 6:19 AM
2.4k
Reply
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 passingIinserting) integer for an identity and non identity fields?
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
How to do sum of column when there is 1million records
How to insert my values to identity and non identity field using single query