try upgrading your mdac. also why aren't you delcare lastid and making your
statement

SELECT @lastid = @@identity

Anthony Petruzzi
Webmaster
954-321-4703
[EMAIL PROTECTED]
http://www.sheriff.org


-----Original Message-----
From: Rick Walters [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 11, 2002 3:02 PM
To: CF-Talk
Subject: SQL Server 2000 and @@Identity


Hi List,

I recently upgraded from SQLServer7 to 2k and the @@identity in the
code below now returns a null string.  Anyone know why this might be
happening?  

~~~~~~~~~~~~~~~~code block~~~~~~~~~~~~~~~~~~~~~~
<!--- insert user info --->
<cfquery name="insertPeople" datasource="#dsn#">
        set nocount on
        insert into people 
        (password, username)
        values
        ('something', 'testuser123456')
        SELECT lastid = @@identity
        set nocount off
</cfquery>

<!--- capture the peopleid from the previous query --->
<cfset thepeopleid=#insertPeople.lastid#>

<!--- insert associated user detail --->
<cfquery name="insertDetail" datasource="#dsn#">
        insert into people_detail
        (peopleid, firstname, lastname)
        values
        (#thepeopleid#, 'firstname', 'lastname')
</cfquery>
~~~~~~~~~~~~~~~~end code block~~~~~~~~~~~~~~~~~~~

Thanks for the help.

Good Fortune,
Richard Walters,
Webmaster, Davita Laboratory Services
[EMAIL PROTECTED]
(800) 604-5227 x 3525

DaVita Inc.

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to