Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Change in identity ex:- only even numbers

Author  Topic 

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-08-13 : 01:47:20
i want to create a table for example asdf in that the columns are qwe, zxc
i want the qwe column as identity and the numbers must be only even numbers and the other column zxc is a varcha(25) any help i think its simple but little bit confused

With Regards
Kashyap M

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-08-13 : 01:51:22
That seems silly to me, but you just need to set the identity increment to 2 instead of 1.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-08-13 : 01:53:40
tnks i got the result

With Regards
Kashyap M
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-08-13 : 02:09:32
You're welcome.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-08-13 : 10:12:02
quote:
Originally posted by tkizer

That seems silly to me, but you just need to set the identity increment to 2 instead of 1.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog



I'm thinking that just the example given is silly. Off the top of my head, I can think of one valid reason to set identities to even/odd -- peer to peer replication. until you add a 3rd node
Go to Top of Page

kashyap_sql
Posting Yak Master

174 Posts

Posted - 2010-08-14 : 01:38:23
hmm it was just an example what you say

With Regards
Kashyap M
Go to Top of Page
   

- Advertisement -