Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8572621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:03:45+00:00 2026-06-11T19:03:45+00:00

This is my table. Ticket(id int auto_increment,name varchar(50)); after inserting into this table i

  • 0

This is my table.

Ticket(id int auto_increment,name varchar(50));

after inserting into this table i want send id and name to mail..
how can i get the last Inserted value.

help to solve this…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:03:46+00:00Added an answer on June 11, 2026 at 7:03 pm

    Look into: Scope_identity

    SCOPE_IDENTITY()
    

    The table which is having Identity Property from that table we can get the last inserted record id will be like this

    SELECT SCOPE_IDENTITY()
    

    OR

    But this is not a safe technique:

    SELECT MAX(Id) FROM Ticket
    

    OR

    This is also not a safe technique:

    SELECT TOP 1 Id FROM Ticket ORDER BY Id DESC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

With this table: CREATE TABLE test_insert ( col1 INT, col2 VARCHAR(10), col3 DATE )
I have Table in which We can have Same ticket no.for multiple entries.i want
this table i want to create job_id dynamic Jobs Title text Job Description text
This table is used to store sessions (events): CREATE TABLE session ( id int(11)
In this table how would I use YQL/Xpath to get all data members of
I have started this support ticket project where users can create tickets and the
I have a table called ticket in which I want to swap two rows
This question suddenly popped into my head... I have a table that ties two
I've currently got a table as follows, Column Type time datetime ticket int(20) agentid
Got this: Table a ID RelatedBs 1 NULL 2 NULL Table b AID ID

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.