March 22, 2011 at 11:03 am
I have a large denormalised table which i have created a view of. The view only contains around 30 of the table 300 columns.
The table contains lots of null cells and I only want to view to show a row if one or more cells in the row contains data (i.e. is not null).
For performance am I better of adding to the view:
not columnA or not ColumnB or not ColumnC etc etc
or would it be better to write a new persisted computed column in the table with sometype of case statement checking for nulls in the rows that are used in the view?
Would appreciate any help you can offer on this one.
Many Thanks,
Oliver
March 22, 2011 at 12:30 pm
where columnA is not null or columnB is not null or ....
_______________________________________________________________
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/
March 23, 2011 at 3:05 am
thanks for the help
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply