INSERT INTO knowledge (title,contents) VALUES ('dsfsf','fsefs') SELECT @@IDENTITY AS id
或
INSERT INTO knowledge (title,contents) VALUES ('dsfsf','fsefs') SELECT CAST(scope_identity() AS int)
2种方法