SET NOCOUNT ON

INSERT INTO tableUsers (blah)
VALUES (moreblah)

SELECT InsertedID = Scope_Identity()

SET NOCOUNT OFF


HTH

On 4/18/05, Stuart Kidd <[EMAIL PROTECTED]> wrote:
> 
> 
> Hi guys,
> 
> I am inserting to a few tables at once (ms-sql, cf7.0).
> 
> One table will insert into the tableUsers and then I will insert into 
> tableQuestions. In tableQuestions i will want to put the contents of the 
> userID which i just inserted into tableUsers.
> 
> Can anyone tell me how I can get the exact userID which I just inserted so I 
> can put into my tableQuestions table?
> 
> I know of MaxID (or something like that) but i am worried that in some cases 
> there may be more than one person accessing the DB and I may grab the 
> incorrect information.
> 
> Any ideas would be appreciated. Thanks,
> 
> Saturday
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:203178
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to