Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

@@PROCID in SQL 6.0

0 views
Skip to first unread message

Maxim G.Velichko

unread,
Jul 8, 1996, 3:00:00 AM7/8/96
to

I've found a problem in passing parameters to a proc:
if I select @@PROCID into local var and then pass it to proc,
called procedure gets @@PROCID of called one, if I pass
@@PROCID to proc, it gets @@PROCID of itself! I tested it
on Microsoft SQL Server 6.0, Microsoft SQL Server 6.5,
Sybase 10.0:

create procedure Test1
@name int
as
select @name, object_name( @name )
go

create procedure Test2
as
declare @id int
select @id = @@PROCID
execute Test1 @id
execute Test1 @@PROCID
go

Test2
go

drop procedure Test1
drop procedure Test2
go

Here are results:

1040006736 Test2
1024006679 Test1

Is Sybase right here?

--------------------------------------------------------
Maxim G.Velichko, Depository dep., Diasoft Co.
E-mail: mailto:veli...@diasoft.ru
Chat: velichko.diasoft.ru
WWW: http://velichko.diasoft.ru/
Tel.: (095)215-9715, 215-9717, 215-9617, 215-9584,
215-5468, 215-9848
Fax: (095)286-0573
3A.3, Olminskogo, Moscow, 129085, Russia
--------------------------------------------------------


0 new messages