Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: last_insert_id issue

by arkturuz (Curate)
on Aug 27, 2014 at 18:12 UTC ( #1098791=note: print w/ replies, xml ) Need Help??


in reply to Re^2: last_insert_id issue
in thread last_insert_id issue

I have never used SQL Server so far, but after a bit of googling I found the related query.

From stackoverflow.com:

SELECT SCOPE_IDENTITY();

From ASP docs:

SELECT CAST(scope_identity() AS int)

Hope this helps.

Update:

am using the SELECT statement with the filename and temp_date

I would suggest you use something more unique, like big random int or long string composed of random chars. temp_date might not be precise enough in a higher traffic environment.


Comment on Re^3: last_insert_id issue
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1098791]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2015-07-06 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (71 votes), past polls