How to Get the last identity value used
Answers were Sorted based on User's Feedback
Answer / guest
the last identity value used in an insert can be retrieved
with the @@identity function.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / chandramohan
scope_identity() would be the currect answer. To avoid potential problems professionals suggests this method since it returns the recently added value.
| Is This Answer Correct ? | 1 Yes | 1 No |
How to enter binary string literals in ms sql server?
What is the server name for sql management studio?
How can you transfer data from a text file to a database table? Or how can you export data from a table to a comma delimited (csv) file? Or how can you import data from ms access to a table in a database? Or how can you export data from a table to an excel file?
How to disconnect from a sql server using mssql_close()?
hi to all teachers,... Friends who write in the query mode Full text Search in Sql Server have experience Who make(Convert) this Stored Procedure as a normal Full text Search, which contains and .. Is used, into Advance of the tips I have thanked all friends perfection. Email : rezaafandi@yahoo.com Create PROCEDURE Sp_student @fname varchar(50), @lname varchar(50), @tel varchar(50), @code varchar(50), @adr varchar(50), @search_operation varchar(50), @totalRowCount bigint output AS begin if @search_operation = 'and' begin SELECT f3,f4,f5,f6,f7 FROM tb_student WHERE( f5 like '%' + @fname + '%' and f4 like '%' + @lname + '%' and f6 like '%' + @tel + '%' and f7 like '%' + @code + '%' and f3 like '%' + @adr +'%' ) select @totalRowCount = @@rowcount end
What is sql injection? How to protect against sql injection attack?
How to select all columns of all rows from a table with a select statement in ms sql server?
How to change the system date and time from SQL Plus Terminal ?
Do you know what is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure?
What can be used instead of trigger?
What are the steps you should follow to start sql server in single-user mode?
What are cursors stored procedures and triggers?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)