You guy's are amazing!!!
Is there anything you DON'T know?
Best thank's from Norway!;)
Christopher Brandsdal
"Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> skrev i melding
news:uRQQ#I7TDHA.2128@TK2MSFTNGP12.phx.gbl...[color=blue]
> @@IDENTITY is a SQL Server variable representing the last inserted[/color]
IDENTITY[color=blue]
> value for this connection's session (that's a SQL Server session, not an[/color]
ASP[color=blue]
> session).
>
> In this case, the GetLastIdentity() function would be of very little use
> unless it is called directly after a barebones INSERT statement.
>
> If you're using SQL Server 2000, SCOPE_IDENTITY() is safer than[/color]
@@IDENTITY,[color=blue]
> since the latter is vulnerable to chained inserts (e.g. a trigger on the
> object table that, in turn, inserts into another table with an IDENTITY
> column).
>
>
http://www.aspfaq.com/2174
>
>
>
>
> "Christopher Brandsdal" <christopherwb@c2i.net> wrote in message
> news:#iSrsE7TDHA.3188@tk2msftngp13.phx.gbl...
> Hi!
>
> I am having some problems width a little script i downloaded...
>
> I'm not able to figure out what he SELECT line does!
> What does the @@identity mean?
> Is this maby a javascript? :)
>
>
>
> function GetLastIdentity(ADOConnection)
> {
> var rstIdentity = Server.CreateObject("ADODB.Recordset");
> rstIdentity.Open("SELECT @@identity AS IdentityId", ADOConnection);
> var iIdentity = rstIdentity.EOF == false ?[/color]
rstIdentity("IdentityId").value[color=blue]
> : -1;
> rstIdentity.Close();
> return iIdentity;
> }
>
>[/color]