Connecting Tech Pros Worldwide Help | Site Map

sequence in MS SQL

  #1  
Old November 30th, 2008, 06:58 PM
Newbie
 
Join Date: Nov 2008
Posts: 14
Im using MS SQL Server as my database in a java application. I want to have something like sequence(of Oracle) in MS SQL. But I left with nothing.

Is there any way to have a variable in MS SQL which is incremented automatically like a sequence(of Oracle)
OR
should I go for a procedure for this purpose?
  #2  
Old December 2nd, 2008, 03:13 AM
ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,914
Provided Answers: 1

re: sequence in MS SQL


Quote:
Originally Posted by tiijnar View Post
Im using MS SQL Server as my database in a java application. I want to have something like sequence(of Oracle) in MS SQL. But I left with nothing.

Is there any way to have a variable in MS SQL which is incremented automatically like a sequence(of Oracle)
OR
should I go for a procedure for this purpose?
Variable, you might need to manually increment it inside your loop.

Column, yes. Consider IDENTITY property of an numeric column.

-- CK
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS SQL Problem sibusiso answers 2 August 13th, 2008 01:15 PM
MS SQL Server 2000: automatically rows inter changed in database InnoSol answers 7 February 13th, 2008 02:58 PM
Oracle Sequence/Link 2 MS SQL SERVER 2005 ruediger.michels@feltengmbh.de answers 14 December 5th, 2006 04:25 PM
ms sql equivalent of this oracle Jeff Kish answers 6 February 7th, 2006 06:35 AM