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 as
----------------------------------------------------------------------------------------------------------