create(alter) view abc as
select
l.id as lId,
cast(l.password as int) as password, 字符串 ---> int
cast(l.age as int) as ageInt, 字符串 ---> int
convert(nvarchar(255),p.id) as idString, int ---> 字符串
convert(nvarchar(255),p.weight) as weightString, int ---> 字符串
convert (nvarchar(255) , p.price) as priceString int ---> 字符串
from dbo.login as l , dbo.product as p
;
重点关注cast 和 convert 关键字的用法。
sp_help
下方这些为转载信息:
1、ALTER viewtest1
----------------------------------------------------------------------------------------------------------