February 15, 2006 at 5:21 am
i have sql sever 2000.
i have a database.
this database has a table.
this table has a column...called "id".
Now, i want this "id" to be auto-incremented by 1 as soon as new records comes and inserts.
how do i set this ?
how can i set that field to be autoincremented ?
i dont want to use any query to do that ...is there any graphical way to d it ?
February 15, 2006 at 5:29 am
make that column an identity column.
Enterprise manager\yourserver\yourdatabase\tables\yourtable rightclick and edit.
Select the column and add the identity property.
Litle remark. When you enable the identity, you're nolonger alowed to use that column in INSERT statements.
There is a workaround, but that is not intended for normal usage, because it shuts off the identity-stuff.
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
February 16, 2006 at 2:19 am
>Enterprise manager\yourserver\yourdatabase\tables\yourtable rightclick and >edit.
there is no edit option. do you mean to go to "design view" ?
>Select the column and add the identity property.
>Litle remark. When you enable the identity
i could not enable the identity property.
confused.
please tell me in simple steps.
the steps you provided does not match in my SQL server 2000 .
February 16, 2006 at 2:47 am
hi,
whats the proper steps (graphical) to make a table column auto incremented ?
DB SQL Server 2000
February 16, 2006 at 4:38 am
Indeed it says "Design Table" (There is no identity-property on views ! )
Then select the column you want to autoincrement.
In the column property-pane (bottom of window) you'll see you'll have to say "identity" yes and then put the seed and increment values.
Then save the changes.
(You might want to check the script, just to see what sqlserver will be doing)
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply