sql server - Programmatically create stored procedure -


i have meta table , creating stored procedures using t-sql string concatenation.

declare @sql varchar(max) = 'select '; select @sql += ... meta -- select clause select @sql += ... meta -- clause .... 

it's hard maintain when stored procedures complex.

is better to

declare @sql xml = (select ... meta xml, auto); -- apply xslt transformation 

how xslt in sql server 2008? clr function way? other solution these kind of meta programming in t-sql?

i think xquery should enough purpose.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -