SQLServer 2008 新增 += 简写语法

SQLServer 2008 新增 += 简写语法,第1张

概述CREATE TABLE StateList(StateId int, StateName char(2)) GO -- Declare variable and assign a value in a single statement DECLARE @Id int = 5 -- Insert multiple rows in a single statement with IDs 5,



CREATE table StateList(StateID int,Statename char(2)) GO -- Declare variable and assign a value in a single statement DECLARE @ID int = 5 -- Insert multiple rows in a single statement with IDs 5,6,and 7 INSERT INTO StateList VALUES(@ID,'WA'),(@ID + 1,'FL'),(@ID + 2,'NY') -- Use compound assignment operator to increment ID values to 6,7,and 8 UPDATE StateList SET StateID += 1 -- VIEw the results SELECT * FROM StateList插入后StateID	Statename5	WA6	FL7	NY更新后StateID	Statename6	WA7	FL8	NY
总结

以上是内存溢出为你收集整理的SQLServer 2008 新增 += 简写语法全部内容,希望文章能够帮你解决SQLServer 2008 新增 += 简写语法所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/1175354.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-02
下一篇 2022-06-02

发表评论

登录后才能评论

评论列表(0条)

保存