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 123»»»

Sequences III Expand / Collapse
Author
Message
Posted Monday, April 30, 2012 8:29 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 9:52 AM
Points: 1,251, Visits: 1,595
Comments posted to this topic are about the item Sequences III
Post #1292905
Posted Monday, April 30, 2012 8:30 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 10:25 AM
Points: 5,472, Visits: 23,549
Nice question - finally beginning to understand what a "Sequence", is and how it works ..........THANKS

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
Post #1292908
Posted Monday, April 30, 2012 10:51 PM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 7:51 AM
Points: 4,246, Visits: 3,328
Thanks for a really easy one!

(I wish I came up with it...)
Post #1292933
Posted Tuesday, May 01, 2012 1:50 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: Tuesday, April 15, 2014 8:03 AM
Points: 824, Visits: 319
I think this question indicates that using default values with a new item like CREATE SEQUENCE isn't a great idea. I, for one, will be defining everything (AS, START WITH, INCREMENT BY, MINVALUE, MAXVALUE, CYCLE, CACHE) if I get round to using sequences in SQLServer. I know it might look wordy and take up a few more lines but for the sake of clarity, and potential help in solving problems, I would think it worth it.
Post #1292967
Posted Tuesday, May 01, 2012 3:09 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: 2 days ago @ 12:16 AM
Points: 8,289, Visits: 8,742
Nice question. Easy if one recognises the decimal representation of 2**31.

Tom
Post #1292994
Posted Tuesday, May 01, 2012 5:37 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 8:44 AM
Points: 1,629, Visits: 2,038
Argh! Blew right past the CYCLE/NO CYCLE option explanation in BOL, looking for behavior when min value exceeded. SHould have had that first cup of green tea.

Thanks for the question! I've really enjoyed these questions on CREATE SEQUENCE. I look forward to using it when my company moves to 2012 ....

.... in 2021!




Please don't go. The drones need you. They look up to you.
Connect to me on LinkedIn
Post #1293043
Posted Tuesday, May 01, 2012 5:38 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, April 11, 2014 1:38 AM
Points: 1,144, Visits: 1,050
I like these sequence questions, despite the fact I keep getting them wrong
Post #1293044
Posted Tuesday, May 01, 2012 5:49 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 2:00 AM
Points: 1,659, Visits: 6,006
Does anyone have any suggestions for possible uses for sequences? Once upon a time I'd have used them for populating primary keys instead of using identities (ie the way I used to in Oracle). But now that we have the Output clause to easily read back the generated values there doesn't seem much advantage in using a sequence instead.
Post #1293051
Posted Tuesday, May 01, 2012 5:56 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: Tuesday, April 15, 2014 8:03 AM
Points: 824, Visits: 319
Toreador (5/1/2012)
Does anyone have any suggestions for possible uses for sequences? Once upon a time I'd have used them for populating primary keys instead of using identities (ie the way I used to in Oracle). But now that we have the Output clause to easily read back the generated values there doesn't seem much advantage in using a sequence instead.


Our software has to run on Oracle and SQLServer. At the moment, the modules that use sequences are Oracle only but if we port those modules to SQLServer we would use sequence there, too, so as to keep the code as similar as possible.
Post #1293056
Posted Tuesday, May 01, 2012 7:59 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: Monday, March 10, 2014 6:02 PM
Points: 3,764, Visits: 1,051
Thanks for another SEQUENCEs question, I think I now understand how they work.

I agree with Marlon that defaults should not be used in sequences, as it is harder to debug when there is a problem.

"El" Jerry


"El" Jerry.

"A watt of Ottawa" - Gerardo Galvan
Post #1293168
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse