But how do i make this work? All i want to be able to do is declare a list of columns at the start and then use those columns in multiple queries heres my code
create procedure craigtest
(
@postcode varchar(10)=NULL,
@town varchar(30)=NULL
)
as
declare @columns varchar(300)
SET @columns='paid, unqueid, initials, firstname'
select @columns from ifa where town= @town and postcode like @postcode