• mw112009 (9/28/2016)


    A picture pf the text ( a portion of it ) is attached ( I can not give you the entire file due to security reasons )

    As for getting the definition of the view I use the following SQL stmt

    select [definition] AS from sys.sql_modules where name = 'XXXXXXXXXX';

    Also when you get the definition directly from SSMS ( See attached picture, ssis2.PNG ) it does show proper formatting.

    Question: Why is it that only a few views are getting effected ?

    I don't know how or why that would happen. I have never seen that from looking at view definitions like that.

    A side note, I noticed that you have nested views. That means you have views that are calling other views. This is horrible from a performance standpoint. It makes so much sense from a logical perspective but the optimizer gets totally confused and generates incredibly bad execution plans. Here is a great explanation of this. https://www.simple-talk.com/sql/performance/the-seven-sins-against-tsql-performance/[/url] (You have to scroll down about half way to find this section).

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/