473,218 Members | 1,475 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,218 software developers and data experts.

Oracle Sequence/Link 2 MS SQL SERVER 2005

hi,

1. is there a statement in ms sql, what creates a sequence? cant find
anything in web :-(
-oracle: CREATE SEQUENCE XYZ INCREMENT BY 1 START WITH 1 NOCYCLE
CACHE 20;
-ms sql: ???

2. hwo do i create a link to another ms-sql database

thx a lot need help, urgend :-)

Nov 30 '06 #1
14 6365
2. hwo do i create a link to another ms-sql database
From one MS SQL to another MS SQL server? Or database?
--
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Nov 30 '06 #2
1. is there a statement in ms sql, what creates a sequence? cant find
anything in web :-(
-oracle: CREATE SEQUENCE XYZ INCREMENT BY 1 START WITH 1 NOCYCLE
CACHE 20;
-ms sql: ???
Microsoft SQL Server doesn't have sequences. It does have some sort
of auto-increment integer thingy for columns, check out "identity" in the
documentation.
--
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Nov 30 '06 #3
thx Martijn

Nov 30 '06 #4

Martijn Tonies schrieb:
2. hwo do i create a link to another ms-sql database

From one MS SQL to another MS SQL server? Or database?
--
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
the link is between two ms-sql servers

Nov 30 '06 #5
ru**************@feltengmbh.de wrote:
hi,

1. is there a statement in ms sql, what creates a sequence? cant find
anything in web :-(
-oracle: CREATE SEQUENCE XYZ INCREMENT BY 1 START WITH 1 NOCYCLE
CACHE 20;
-ms sql: ???

2. hwo do i create a link to another ms-sql database

thx a lot need help, urgend :-)
The only other databases that have abilities similar to those of
an Oracle SEQUENCE are DB2 and Informix (only the most recent release).
--
Daniel A. Morgan
University of Washington
da******@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Nov 30 '06 #6
the link is between two ms-sql servers
Set up a "Linked Server", check the documentation for that. It's really
easy to do :)
--
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Nov 30 '06 #7
1. is there a statement in ms sql, what creates a sequence? cant find
anything in web :-(
-oracle: CREATE SEQUENCE XYZ INCREMENT BY 1 START WITH 1 NOCYCLE
CACHE 20;
-ms sql: ???

2. hwo do i create a link to another ms-sql database

thx a lot need help, urgend :-)

The only other databases that have abilities similar to those of
an Oracle SEQUENCE are DB2 and Informix (only the most recent release).
And InterBase, Firebird, PostgreSQL, Mimer, ThinkSQL and probably some
others that
I don't know about :-)
btw, SEQUENCE is in the SQL 2003 standard.
--
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
Nov 30 '06 #8
The only other databases that have abilities similar to those of
an Oracle SEQUENCE are DB2 and Informix (only the most recent release).
What about ROWNUMBER() in SQL Server 2005 and PARTITION??

--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"DA Morgan" <da******@psoug.orgwrote in message
news:11***************@bubbleator.drizzle.com...
ru**************@feltengmbh.de wrote:
>hi,

1. is there a statement in ms sql, what creates a sequence? cant find
anything in web :-(
-oracle: CREATE SEQUENCE XYZ INCREMENT BY 1 START WITH 1 NOCYCLE
CACHE 20;
-ms sql: ???

2. hwo do i create a link to another ms-sql database

thx a lot need help, urgend :-)

The only other databases that have abilities similar to those of
an Oracle SEQUENCE are DB2 and Informix (only the most recent release).
--
Daniel A. Morgan
University of Washington
da******@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org

Dec 1 '06 #9
Tony Rogerson wrote:
>The only other databases that have abilities similar to those of
an Oracle SEQUENCE are DB2 and Informix (only the most recent release).

What about ROWNUMBER() in SQL Server 2005 and PARTITION??
Totally different capabilities.

A sequence is not tied to a table: It is an independent object.

One can use a sequence to number count by any increment positive or
negative, assign the values to one table or to multiple tables, and
to repeatedly cycle through a fixed set of numbers (min to max and
back to min), and much more.

Maybe in SQL Server 2009?
--
Daniel A. Morgan
University of Washington
da******@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Dec 1 '06 #10
Oh - you mean SQL Server 2007? Remember Mark Souza committed themselves to a
2 year release cycle....

If I sat down and worked it out then what we have now in terms of CTE's,
table structures, triggers I could do it - sadly, no time [at mo].

--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"DA Morgan" <da******@psoug.orgwrote in message
news:11***************@bubbleator.drizzle.com...
Tony Rogerson wrote:
>>The only other databases that have abilities similar to those of
an Oracle SEQUENCE are DB2 and Informix (only the most recent release).

What about ROWNUMBER() in SQL Server 2005 and PARTITION??

Totally different capabilities.

A sequence is not tied to a table: It is an independent object.

One can use a sequence to number count by any increment positive or
negative, assign the values to one table or to multiple tables, and
to repeatedly cycle through a fixed set of numbers (min to max and
back to min), and much more.

Maybe in SQL Server 2009?
--
Daniel A. Morgan
University of Washington
da******@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org

Dec 2 '06 #11
Ruediger,

How is the sequence used in the app?
While it is true that sequences are divorced from tables teh majority of
usages that I know of is for one of two purposes:
* Generate unique value across the database. If that's the case I would
look at GUID.
* Generate an abstract primary key for a specific table (or many tables,
but without actual requirement for x-database uniqueness).
In that case IDENTITY columns are the way to go.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

WAIUG Conference
http://www.iiug.org/waiug/present/Fo...Forum2006.html
Dec 2 '06 #12
Tony Rogerson (to**********@sqlserverfaq.com) writes:
Oh - you mean SQL Server 2007? Remember Mark Souza committed themselves
to a 2 year release cycle....
Mark Souza? You are probably thinking of Paul Flessner.
If I sat down and worked it out then what we have now in terms of CTE's,
table structures, triggers I could do it - sadly, no time [at mo].
Itzik Ben-Gan has come up with an idea where you us an table with a single
identity column. You have a stored procedure that either starts a
transaction, or if a transaction is already in progress, it issues a
SAVE TRANSACTION. The procedure then inserts a row into the table and
retrieves the identity value with scope_identity(). Finally it rolls
back the transaction, either entirely or to the savepoint. Thus, table
is always empty, but it still produces a growing sequence. Since the table
is locked for only short duration, the concurrency is good.

A fairly convoluted solution, and likely to be less efficient than what
they have on Oracle.

Then again, in many cases a plain IDENTITY column will do.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Dec 3 '06 #13
Erland Sommarskog wrote:
Itzik Ben-Gan has come up with an idea where you us an table with a single
identity column. You have a stored procedure that either starts a
transaction, or if a transaction is already in progress, it issues a
SAVE TRANSACTION. The procedure then inserts a row into the table and
retrieves the identity value with scope_identity(). Finally it rolls
back the transaction, either entirely or to the savepoint. Thus, table
is always empty, but it still produces a growing sequence. Since the table
is locked for only short duration, the concurrency is good.

A fairly convoluted solution, and likely to be less efficient than what
they have on Oracle.
Itzik's article is here:
http://www.sqlmag.com/Article/Articl...ver_48165.html

It does overcome some of the disadvantages of an IDENTITY column and
I've used variations of it very successfully. I am looking forward to
the day when we get an engine-level implementation of sequences and I
never have to use an IDENTITY column again.

--
David Portas, SQL Server MVP

Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.

SQL Server Books Online:
http://msdn2.microsoft.com/library/m...S,SQL.90).aspx
--

Dec 3 '06 #14
Good stuff.

Nope - it was Mark Souza at TechEd / IT Forum last year; there is a press
release somewhere.

--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"Erland Sommarskog" <es****@sommarskog.sewrote in message
news:Xn**********************@127.0.0.1...
Tony Rogerson (to**********@sqlserverfaq.com) writes:
>Oh - you mean SQL Server 2007? Remember Mark Souza committed themselves
to a 2 year release cycle....

Mark Souza? You are probably thinking of Paul Flessner.
>If I sat down and worked it out then what we have now in terms of CTE's,
table structures, triggers I could do it - sadly, no time [at mo].

Itzik Ben-Gan has come up with an idea where you us an table with a single
identity column. You have a stored procedure that either starts a
transaction, or if a transaction is already in progress, it issues a
SAVE TRANSACTION. The procedure then inserts a row into the table and
retrieves the identity value with scope_identity(). Finally it rolls
back the transaction, either entirely or to the savepoint. Thus, table
is always empty, but it still produces a growing sequence. Since the table
is locked for only short duration, the concurrency is good.

A fairly convoluted solution, and likely to be less efficient than what
they have on Oracle.

Then again, in many cases a plain IDENTITY column will do.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx

Dec 5 '06 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Uma | last post by:
Hi.. here is my question.. these are my Oracle scripts . I want the similar concepts in DB2 connect system/manager /********************************************/ /* Create the two roles...
1
by: Mike Landis | last post by:
Hello, Has anyone a small tool or somekind of document which could help me to convert Oracle SQL scripts to SQL Server? Scripts are not very Oracle specified. Thanks, Below is a Script...
28
by: prunoki | last post by:
Hello, I am an SQL server newbie. Our company has a massive application written in PL/SQL. I need to port parts of it to SQL Server. - Which SQL server version should I choose, to have a...
8
by: berj | last post by:
How difficult is this? I'm having a tough time getting a simple select to work. I am using MS Access 2002 and Windows XP. What do I have to do to make a simple select statement like this...
4
by: dhcomcast | last post by:
We're starting to use Oracle for the back-end instead of a separate Access .mdb file for the data and everything as gone surprisingly well so far. We are learning Oracle as we go; Yikes! But we...
2
by: egoldthwait | last post by:
I need to convert a 17mb access 2000 db to Oracle and house it in a Citrix farm. The issue: we have never converted an Access Db to Oracle but can probably use Oracle's Workbench to assist with...
3
by: Chris | last post by:
I need to link some data from SQL Server 2005 with Oracle 10 data. One way is to link Oracle server to SQL Server and use ROWSOURCE for retrieving data. What other ways for joing data from...
1
by: Magnus Flisberg | last post by:
Best programmer, My mission is to execute a sql statement in vb.net and retrive the data into a file. I have managed to detect som issues with my code: queryString = "SELECT ...." ...
5
by: dreadnought8 | last post by:
I've worked with mdbs, and with SQL Server to a lesser extent, with Access as a front end, on commercial-strength systems for quite a while, starting with A97. The last 8 months or so, I've been...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.