In SQL server is there any way to get the 'use database' command to accept a variable

前端 未结 4 759
醉酒成梦
醉酒成梦 2020-12-17 22:37

I would like to write a \'generic\' script to operate on a number of databases. The \'use databasename\' commands will be distributed in the body of the script. I would rath

4条回答
  •  离开以前
    2020-12-17 23:00

    I think your presumption’s right; I had the same problem yesterday. I solved it by putting the commands into a single string. Why don’t you like that solution?

提交回复
热议问题