`

一个sql用法 你可能不知道哦

    博客分类:
  • SQL
SQL 
阅读更多

create table userInfo(

   uid int identity primary key,

   uname varchar(20) not null

)

 

insert into userInfo output inserted.uid,inserted.uname values('I am jacklai')

 

你执行这条语句时候  让数据库表userInfo插入了一条数据 同时也返回了你刚刚插入的那条数据

如的项目中要返回刚刚插入的信息,这样就可以了!

分享到:
评论
发表评论

文章已被作者锁定,不允许评论。

相关推荐

Global site tag (gtag.js) - Google Analytics