Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

Sequences II Expand / Collapse
Author
Message
Posted Monday, April 23, 2012 8:27 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 8:27 PM
Points: 1,421, Visits: 1,807
Comments posted to this topic are about the item Sequences II
Post #1288626
Posted Monday, April 23, 2012 8:28 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Sunday, April 27, 2014 7:45 PM
Points: 1,589, Visits: 253
Guess I need to learn more about the new features in 2012. Good question.

http://brittcluff.blogspot.com/
Post #1288627
Posted Monday, April 23, 2012 11:15 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 7:27 AM
Points: 13,902, Visits: 11,815
Nice question, thanks.



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

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1288645
Posted Monday, April 23, 2012 11:20 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 2:25 AM
Points: 1,512, Visits: 1,985
Now i cant test this. But is that answer really accurate. Reading the link... it doesnt sound so.

Since its an int the values defaults become
MinValue : -2,147,483,648
MaxValue : 2,147,483,647

Startvalue will be MinValue (since its not given).

So add -1 to -2,147,483,648 and it should loop... but only if option is CYCLE and the default is NO CYCLE... so shouldnt it give an error instead?

/T
Post #1288647
Posted Tuesday, April 24, 2012 12:51 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, January 7, 2015 11:24 PM
Points: 2,558, Visits: 774
tommyh (4/23/2012)
Startvalue will be MinValue (since its not given).

Check reference again. Start value is different whether sequence is ascending or descending.
Post #1288675
Posted Tuesday, April 24, 2012 12:56 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 2:25 AM
Points: 1,512, Visits: 1,985
dawryn (4/24/2012)
tommyh (4/23/2012)
Startvalue will be MinValue (since its not given).

Check reference again. Start value is different whether sequence is ascending or descending.


You are so right.

/T
Post #1288678
Posted Tuesday, April 24, 2012 1:56 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 2:39 AM
Points: 4,243, Visits: 5,618
good question, thanks

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1288702
Posted Tuesday, April 24, 2012 3:35 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, December 25, 2014 2:38 AM
Points: 860, Visits: 813
I fell into the same trap as tommyh... I should have looked it up.


-- Stephen Cook
Post #1288750
Posted Tuesday, April 24, 2012 4:04 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, August 27, 2013 4:28 AM
Points: 1,248, Visits: 779
Stephen E. Cook (4/24/2012)
I fell into the same trap as tommyh... I should have looked it up.


Me too... trapped, hook, line and sinker... doh!


_____________________________________________________________________
"The difficult tasks we do immediately, the impossible takes a little longer"
Post #1288764
Posted Tuesday, April 24, 2012 4:20 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, January 20, 2015 7:48 AM
Points: 430, Visits: 269
So, the key bit here is that SQL will *decide* whether the sequence is ascending or descending based on the INCREMENT BY argument. That's a bit misleading if your just starting out with sequences and SQL 2012 (like me) Good question !




sqlmunkee
Bringing joy and happiness via SQL Server since 1998
Post #1288770
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse