当前位置: 代码迷 >> SQL >> 一个sql用法 您可能不知道哦
  详细解决方案

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

热度:32   发布时间:2016-05-05 14:00:20.0
一个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插入了一条数据 同时也返回了你刚刚插入的那条数据

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

  相关解决方案