Quantcast
Channel: Toad Data Point Forum - Recent Threads
Viewing all articles
Browse latest Browse all 2544

SQL Server Substitution Variables

$
0
0

I am trying to reproduce the substitution variables that work well for Oracle.  ie.

Select &fieldname as '&fieldname' from &tblName

Select lastname, 'lastname' from Employees

In SQL Server I would expect the following to work but it does not.  The colon only seems to work as a value not a column or table name

Select :fieldname as ':fieldname' from :tblName

Thanks for any direction you can provide

Retainiac


Viewing all articles
Browse latest Browse all 2544


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>