动态SQL语句的insert into语法?

动态SQL语句的insert into语法


潇潇雨雨
浏览 1887回答 5
5回答

牛魔王的故事

exec sp_executesql N'insert into A (col1,col2,col3,col4 ) values (@a,@b,@c,newid()) ',N' @a int ,@b varchar(80) ,@c int,@d varchar(80)',0,'测试',0

元芳怎么了

INSERT INTO employee (emp_no, fname, lname, officeno) ;VALUES (3022, "John", "Smith", 2101)emp_no, fname, lname, officeno 是 employee 表的字段名,3022, "John", "Smith", 2101 是对应字段的值。

临摹微笑

insert into 表名(字段名1,字段名2...)values(值1,值2...)insert into 表名(字段名1,字段名2...)select 字段名1,字段名2... from 表2
打开App,查看更多内容
随时随地看视频慕课网APP