?????????????£?
CREATE TABLE TestTable
(
id int identity??
CreatedDate datetime
)
????SQL2005????????е?????????е???????£?
????insert into TestTable (CreatedDate)  output  inserted.id  values (getdate())
????SQL2000????????е?????????е???????£?
????insert into TestTable (CreatedDate)  values (getdate())
????select @@IDENTITY
??????C#?????ExecuteScalar()??????????е???е??(??????id):
????object val = cmd.ExecuteScalar();