| Author |
Topic |
|
mitasid
Yak Posting Veteran
51 Posts |
Posted - 2006-06-07 : 21:38:57
|
| i am trying to insert an auot number field in my table which has got about million rows but sql 2005 is giving me na error "cant insert"i need to index my table so that the query runs faster when i perform joins on two of such huge tables..i tryid inserting the identity key the way it was mentioned in the forum but sql doesnt let me do that??pls help |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-06-07 : 21:47:47
|
| which post?did you 'set identity_insert tablename ON'?--------------------keeping it simple... |
 |
|
|
mitasid
Yak Posting Veteran
51 Posts |
Posted - 2006-06-07 : 21:51:56
|
| i guess i did not do that..i just set identity specification to "yes" how do i do that?? |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-06-07 : 22:11:21
|
before you start inserting data with the identity valuesissue: set identity_insert tablename oni don't understand your question , sorry--------------------keeping it simple... |
 |
|
|
mitasid
Yak Posting Veteran
51 Posts |
Posted - 2006-06-07 : 22:13:40
|
| my question is how do i set identity_insert tablename on?? where is this option??pls explainthanks |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-06-07 : 22:28:18
|
| open query analyzer or ssms then new query,type that commandyour querytype the command but set it to offrun the query--------------------keeping it simple... |
 |
|
|
mitasid
Yak Posting Veteran
51 Posts |
Posted - 2006-06-07 : 23:11:41
|
| thanks for your help jen.but i still cant understand wat u mean..i am having trouble inserting an auto number field in my table i..i am soing it in the design mode of the table.. icant find the option you suggested me...i am really sorry if i am troubling you ..ut can u explain me in detail about that option(identity_insert)?????? |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-06-07 : 23:41:27
|
| ok... let's start over again...set the identity specification you mentioned in your post to NO, instead of yes (click on NO for isIdentity)--------------------keeping it simple... |
 |
|
|
mitasid
Yak Posting Veteran
51 Posts |
Posted - 2006-06-07 : 23:54:41
|
| ok did that..sql has accepted that but in the new column,all the values are null.....there is no numbers in it!! |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-06-08 : 01:39:36
|
| it's just like a switch, once you're done with inserting the values you can turn it back onunless you'll be doing this as part of your business policy, theni suggest you create a constraint on that column, generate your own identity values and not make it an identity columnit's really the concept that you should be learning--------------------keeping it simple... |
 |
|
|
|