Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
JVP, flexibility of databases
Message
 
À
21/11/2003 15:40:10
Dorin Vasilescu
ALL Trans Romania
Arad, Roumanie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00851534
Message ID:
00852466
Vues:
28
>Hi
>
>All these @ are really needed at the begining of variables?

I'm not Rodman, but I can answer the question as it pertains to T-SQL in SQL Server. Yep, they are. Additionally, @@ is used to identify global variables (system functions).

>
>>Walter,
>> This problem is actually easy to solve in SQL Server 2000. SQL Server 2000 now has UDF's which can be recursive.
>>
>>Here's a UDF from www.foxforum.com that retrieves a message's depth (how low in the tree is the message)
>>
>>
>>
>>ALTER function forum_get_message_depth
>>(@messageid as int, @intCurrentDepth as int)
>>Returns int
>>as
>>
>>BEGIN
>>
>>DECLARE @intParentID INT
>>SELECT @intParentID = parentid
>> FROM messages where messageid = @messageid
>>
>>DECLARE @intRetVal INT
>>SET @intRetVal = 0
>>
>>SET @intCurrentDepth = @intCurrentDepth + 1
>>
>>If @intParentID = 0
>> SET @intRetVal = @intCurrentDepth
>>Else
>> BEGIN
>> SET @intRetVal = dbo.forum_get_message_depth(@intParentID, @intCurrentDepth)
>> END
>>
>>Return @intRetVal
>>END
>>
>>Rodman
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform