Is it possible to change the datatype of a column in a view?

后端 未结 2 1516
独厮守ぢ
独厮守ぢ 2021-01-01 17:19

Usually I run a script like this:

ALTER TABLE [TABLE]
ALTER COLUMN [Column] NVARCHAR(40);

The result is that the field in the table gets c

2条回答
  •  感情败类
    2021-01-01 17:40

    Sure

    CREATE VIEW AView
    AS
    SELECT CAST(title AS char(50))
    FROM titles
    

    So check out CAST and also CONVERT on the msdn pages for full info

提交回复
热议问题