473,396 Members | 1,707 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,396 software developers and data experts.

problems width select line

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 ? rstIdentity("IdentityId").value : -1;
rstIdentity.Close();
return iIdentity;
}

Jul 19 '05 #1
3 1977
An explanation of what @@IDENTITY is can be found here.
http://www.aspfaq.com/show.asp?id=2174

Ray at work

"Christopher Brandsdal" <ch***********@c2i.net> wrote in AN HTML message
news:%2****************@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 ? rstIdentity("IdentityId").value
: -1;
rstIdentity.Close();
return iIdentity;
}
Jul 19 '05 #2
You guy's are amazing!!!
Is there anything you DON'T know?

Best thank's from Norway!;)
Christopher Brandsdal
"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> skrev i melding
news:uR**************@TK2MSFTNGP12.phx.gbl...
@@IDENTITY is a SQL Server variable representing the last inserted IDENTITY value for this connection's session (that's a SQL Server session, not an ASP 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 @@IDENTITY, 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" <ch***********@c2i.net> wrote in message
news:#i**************@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 ? rstIdentity("IdentityId").value : -1;
rstIdentity.Close();
return iIdentity;
}

Jul 19 '05 #3
There are lots of things I don't know. There is only one thing that Aaron
doesn't know though - euphemismic conversation. :P

Ray at work

"Christopher Brandsdal" <ch***********@c2i.net> wrote in message
news:Ov**************@TK2MSFTNGP12.phx.gbl...
You guy's are amazing!!!
Is there anything you DON'T know?

Best thank's from Norway!;)
Christopher Brandsdal
"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> skrev i melding
news:uR**************@TK2MSFTNGP12.phx.gbl...
@@IDENTITY is a SQL Server variable representing the last inserted

IDENTITY
value for this

Jul 19 '05 #4

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

Similar topics

4
by: Eric | last post by:
Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works fine, however, when the checkbox is only field...
0
by: Michael Fork | last post by:
Note: I pasted the code the attachments as plain text after the message (I wasn't able to post it with an attachment...) Attached are the XSL and XML files that I am having problems with. I am...
6
by: Sjaakie | last post by:
Hi there, I'm trying to get this working with Firefox. Can you point out what's wrong? No problems with IE, Firefox doens't fill selMonth... TIA >>> the script... >>> <select name="selDay"...
3
by: Ali Sahin | last post by:
Hi there, I'd like to transform a XML-File to PDF. The XML-File ist build like followed: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <?xml-stylesheet type="text/xsl"...
2
by: tshad | last post by:
I have a page that has been displaying some weird behavior. I have 2 radio buttons that work fine until I press the link button with an item selected in my link box (if an item is not selected,...
10
by: ste | last post by:
Hi there, I'm trying to query a MySQL database (containing image data) and to output the results in a HTML table of 3 columns wide (and however many rows it takes) in order to create a basic...
2
by: cbjewelz | last post by:
Hey all. So I'm having problems with cross browser alignments. I'm looking at Safari and Mozilla Firefox. I develop in Safari and so it looks perfect there however in Firefox my vertical...
2
by: starfi3ld | last post by:
I got a few errors with this script Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/starfi3ld/domains/starfi3ld.com/public_html/newreleases.php on line...
3
by: KimberlyM | last post by:
This has been driving me crazy. I hope someone can help. The site displays perfectly in FF but all div's do not show in IE. Please help me find the problem! Thanks! Here is my css. ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.