Home All Groups Group Topic Archive Search About

SQL server does some strange things sometimes.

Author
22 Jul 2005 6:55 AM
Michael C
I can execute this statement and the view gets created. What suprised me was
the comment is also visible in enterprise manager. Once it gets the create
view statement does it go backwards and look for comments before hand also?

--example view called ABC
CREATE VIEW ABC AS
SELECT * FROM INFORMATION_SCHEMA.TABLES

Author
22 Jul 2005 8:59 AM
Razvan Socol
If you don't want the comment to be included in the view, use:

--example view called ABC
GO
CREATE VIEW ABC AS
SELECT * FROM INFORMATION_SCHEMA.TABLES

Razvan
Author
22 Jul 2005 6:12 PM
Hugo Kornelis
On Fri, 22 Jul 2005 16:55:21 +1000, Michael C wrote:

>I can execute this statement and the view gets created. What suprised me was
>the comment is also visible in enterprise manager. Once it gets the create
>view statement does it go backwards and look for comments before hand also?
>
>--example view called ABC
>CREATE VIEW ABC AS
>SELECT * FROM INFORMATION_SCHEMA.TABLES
>

Hi Michael,

No, it doesn't go back. The complete batch is saved when views or stored
procedures are created. This doesn't involve going back, it just
involves copying bytes from the statement batch's buffer to syscomments.

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)

AddThis Social Bookmark Button