Here i am using Sql select statement using dynamic column name,without hard code the caption name.
Example:
Here Pass the year name dynamically..
declare @Squery nvarchar(4000)
set @Squery='select countryName '+ 'hi' +
convert(varchar,year(getdate())) +' from Country'
EXEC SP_EXECUTESQL @Squery
Include View..
declare @Squery nvarchar(4000)
set @Squery='Create view tt as select dbname '+ 'hi' +
convert(varchar,year(getdate())) +' from accountyears'
EXEC SP_EXECUTESQL @Squery
0 Comments