SQL Views - no variables?

前端 未结 8 1916
北荒
北荒 2020-12-04 17:31

Is it possible to declare a variable within a View? For example:

Declare @SomeVar varchar(8) = \'something\'

gives me the syntax error:

8条回答
  •  广开言路
    2020-12-04 17:52

    What I do is create a view that performs the same select as the table variable and link that view into the second view. So a view can select from another view. This achieves the same result

提交回复
热议问题