Hi,
I'm fairly new to SQL Server and need some help with Views.
I need to find out whether you can alter a view dynamically. I need to add the word 'distinct' to the select clause if a value in a table is set to 1.
So if "Show links"=1 for a particular user then my view should have a select statement of..."SELECT DISTINCT [columns]...". But if the "Show links"=0 then it should read "SELECT [columns]...". This is also the same for the 'Where' clause in that I need to extend the current where clause depending on the value in the "Show Links" column.
Does anybody have any ideas?
Thanks in advance