SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Sequences II


Sequences II

Author
Message
Thomas Abraham
Thomas Abraham
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3841 Visits: 2256
Excellent question. On a new feature, minimum code to make your point, clear cut answer, and several issues demonstrated at once. Bravo! (and Thanks!)

I think if you give it some thought, this feature behaves as you would design it. The defaults seem the way I would hope they would - for a pleasant change.

Please don't go. The drones need you. They look up to you.
Connect to me on LinkedIn
bitbucket-25253
bitbucket-25253
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15883 Visits: 25280
I am some what confused and perplexed for when I run
(in Denalli CTP3)

SELECT name, start_value FROM sys.sequences;

the return values are:
name start_value
SSC_ROCKS 2147483647

and that start value is a POSITIVE VALUE.

If everything seems to be going well, you have obviously overlooked something.

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
Thomas Abraham
Thomas Abraham
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3841 Visits: 2256
bitbucket-25253 (4/24/2012)
I am some what confused and perplexed for when I run
(in Denalli CTP3)

SELECT name, start_value FROM sys.sequences;

the return values are:
name start_value
SSC_ROCKS 2147483647

and that start value is a POSITIVE VALUE.


MAX for INT is 214748647, which it uses as start value because INCREMENT BY -1 indicates the sequence should be DESCENDING.

Please don't go. The drones need you. They look up to you.
Connect to me on LinkedIn
Toreador
Toreador
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3845 Visits: 8125
Thomas Abraham (4/24/2012)
this feature behaves as you would design it.


Which is the reason I guessed wrong ;-)
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)

Group: General Forum Members
Points: 63066 Visits: 13298
sqlmunkee (4/24/2012)
So, the key bit here is that SQL will *decide* whether the sequence is ascending or descending based on the INCREMENT BY argument.


That only seems logical to me.
If the INCREMENT BY is negative, the sequence will automatically be a descending one, as you will always "take a step back".


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Thomas Abraham
Thomas Abraham
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3841 Visits: 2256
Toreador (4/24/2012)
Thomas Abraham (4/24/2012)
this feature behaves as you would design it.


Which is the reason I guessed wrong ;-)


Ah yes, a SQL Server veteran. Burned by experience, conditioned to expect the unexpected.

Please don't go. The drones need you. They look up to you.
Connect to me on LinkedIn
jalvarocrespo
jalvarocrespo
SSC-Enthusiastic
SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)

Group: General Forum Members
Points: 146 Visits: 88
damn it! MISTAKE with the cycle/no cycle argument not related with the start value!

I didn't know that the start value for the sequence is the maximum for a ascending sequence. Let's learning. w00t
jalvarocrespo
jalvarocrespo
SSC-Enthusiastic
SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)SSC-Enthusiastic (146 reputation)

Group: General Forum Members
Points: 146 Visits: 88
damn it! MISTAKE with the cycle/no cycle argument not related with the start value!

I didn't know that the start value for the sequence is the maximum for a ascending sequence. Let's learning. w00t
bitbucket-25253
bitbucket-25253
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15883 Visits: 25280
OK no longer confused or perplexed -

If everything seems to be going well, you have obviously overlooked something.

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
Thomas Abraham
Thomas Abraham
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3841 Visits: 2256
Removed as issue is moot now that Ron is back in our space-time continuum.

Please don't go. The drones need you. They look up to you.
Connect to me on LinkedIn
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search