Oscar Nsarhaza
Oscar Nsarhaza

Reputation: 36

How to put comment in a view sqlsever

How can I write comments in a view? In a normal query I can write them using this as example :

--comment here
select * from table_x where x
/*or an other comment here */
and colum_x like '%xx%'

Upvotes: 0

Views: 632

Answers (1)

shree.pat18
shree.pat18

Reputation: 21757

Yes, you can add comments to views just like you add them to normal queries. For example, this works:

create view vw_test as

--First set
select 1 k, 'a' v
union
--Second set
select 2 k, 'b' v

Upvotes: 1

Related Questions