Using Facet variables in ExecuteSQL


hi,

i'm trying use executesql in new policy conditions fail if use facet variables.

even simple example this, fails :

executesql('numeric','select @@name')

already tried sample database facet , login facet.

the error message same : must declare variable @@name. seems doesn't reconize @@name facet variable.

so, question : how can use facet variable executesql in policy conditions ?

thank !


dennes - se resolveu, classifique mensagem, por favor - [http://www.bufaloinfo.com.br] novo dvd segurança no asp.net : http://www.bufaloinfo.com.br/learingseriessegurancaaspnet2.asp

hi,

i found solution!

it seems executsql not understand facet variables, can concatenate strings achieve result. 

here small sample (not real query pbm, example) :

executesql('string', concatenate(concatenate('select ''', @name), ''''))

cheers,


dennes - se resolveu, classifique mensagem, por favor - [http://www.bufaloinfo.com.br] novo dvd segurança no asp.net : http://www.bufaloinfo.com.br/learingseriessegurancaaspnet2.asp



SQL Server  >  SQL Server Manageability



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........