第9章 TransactSQL程序设计.docVIP

  • 8
  • 0
  • 约 11页
  • 2017-01-02 发布于重庆
  • 举报
第9章 transact-sql程序设计 exec sp_addtype test_add,varchar(10),not null declare @int_var int select @int_var =12 /*给@int_var赋值*/ select @int_var /*将@int_var的值输出到屏幕上*/ 在一条语句中可以同时对几个变量进行赋值,例如, declare @lastname char(8),@firstname char(8),@birthdate datetime select @lastname=smith,@firstname=david,@birthdate=1985-2-20 select @lastname,@firstname,@birthdate 【例9-1】 使用select语句从customer表中检索出顾客编号为c0002的行,再将顾客的名字赋给变量@customer。 declare @customer varchar(40),@curdate datetime select @customer=customer_name,@curdate=getdate() from customer where customer_id=c0002 【例9-2】 将sell_order表中的transpor

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档