parametrize server and database name in t-sql -


is possible paramterize sql server name , database name when changed dont have change 1 line ?

thanks help

your question isn't clear - i'm interpreting this: like:

select (list of fields)  @database.dbo.@tablename (clause) 

or - right?

no, cannot - @ least not in standard sql - you'd have use dynamic sql (string sql command variable, , execute that).

if think going there - must read erland sommarskog's excellent the curse , blessings of dynamic sql , think again if want use it.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -