In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces what is the method for sql server to obtain the new record identification column value, the content is very detailed, interested friends can refer to, I hope it can be helpful to you.
For newly added records, there are two ways to get the value of the automatic identity column for the new record:
1. Using the OUTPUT keyword INSERT INTO table_name (column1,column2,column3) OUTPUT INSERTED.ID in INSERT-- returns the value of the auto-growing identity column VALUES (',',')-- ADO.NET calls int r = command.ExecuteScalar ()
two。 Use the global variable @ @ IDENTITY global variable INSERT INTO table_name (column1,column2,column3) VALUES (',',') SELECT @ @ IDENTITY AS ID
-- ADO.NET call (two statements are executed together) int r = command.ExecuteScalar ()
This is the end of what sql server uses to get the new record identification column value. I hope the above content can be helpful to everyone and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 303
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.