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 @ 3:58 PM
Points: 1,297, Visits: 1,657
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: Today @ 12:12 AM
Points: 13,283, Visits: 10,157
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
UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Sunday, June 29, 2014 11:26 PM
Points: 1,481, Visits: 1,960
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: Thursday, July 10, 2014 1:48 AM
Points: 2,359, Visits: 730
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
UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: Sunday, June 29, 2014 11:26 PM
Points: 1,481, Visits: 1,960
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


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 7:50 AM
Points: 3,859, Visits: 5,001
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: Friday, June 27, 2014 12:08 AM
Points: 860, Visits: 807
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


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, June 30, 2014 9:28 AM
Points: 379, Visits: 232
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