Connecting Tech Pros Worldwide Help | Site Map

sequence in MS SQL

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 30th, 2008, 05:58 PM
Newbie
 
Join Date: Nov 2008
Posts: 12
Default sequence in MS SQL

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?
Reply
  #2  
Old December 2nd, 2008, 02:13 AM
ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,799
Default

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
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.