Not that I know of, unless you use an external identity table for your
identities, as some folks like to do.  Of course, you could do the
insert leaving the path blank, and then immediately do an update using
the newly created id.

By the way, @@identity is not safe, you should use scope_identity()
instead.  In some cases, @@identity will return the wrong identity
value.

On 3/19/07, Mik Muller <[EMAIL PROTECTED]> wrote:
> For years I've been using SELECT @@IDENTITY AS ID in my code to get the 
> record ID for a newly inserted record. And now I'm wondering... would this, 
> or something similar, work inside an insert statement?
>
> I'm working on some insert code right now and one of the fields is a notes 
> field that I'm storing some HTML, including (possibly) a path to an image 
> that would be based on the record ID, ie; /path/to/###/record/image.jpg
>
> I know it's a bit redundant, and that I could make an image field in the 
> table and automate the appearance of the image through code, but I was 
> wondering if there was anything in the SQL insert statement that would be 
> aware of the impending unique ID that I could use.
>
> Mik
>
>
>
>
> --------
> Michael Muller
> Admin, MontagueMA.net Website
> work (413) 863-0030
> cell (413) 320-5336
> skype: michaelBmuller
> http://www.MontagueMA.net
>
> Eschew Obfuscation
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. 
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273014
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to