RichardParry
IS-IT--Management
Hi All,
Quick thank you for the excellent support I have been receiving on here the last few days.
I have another question though, I have developed a pretty monsterous T-SQL query in View mode, however I need to declare some variables based on SELECT (integers, so I can use their values in a couple of places throughout the query), however I have tried to declare the variable as per usual (if I were doing it in a Store Proc), but it doesn't like that in a View, so I transplated the contents into a SP, but as soon as I declare a variable it says no data was returned when I run thwe query (it returns data per normal if I remove the variable declerations).
Any ideas how I can go about declaring a variable, either in a View or a Stored Proc, but also getting the data results to the screen as per a View mode?
Thanx!!! Richard
Quick thank you for the excellent support I have been receiving on here the last few days.
I have another question though, I have developed a pretty monsterous T-SQL query in View mode, however I need to declare some variables based on SELECT (integers, so I can use their values in a couple of places throughout the query), however I have tried to declare the variable as per usual (if I were doing it in a Store Proc), but it doesn't like that in a View, so I transplated the contents into a SP, but as soon as I declare a variable it says no data was returned when I run thwe query (it returns data per normal if I remove the variable declerations).
Any ideas how I can go about declaring a variable, either in a View or a Stored Proc, but also getting the data results to the screen as per a View mode?
Thanx!!! Richard