由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - USE statement in SQL 7
相关主题
请教zenny、Assailant等牛人:如何找出进行“Ful Scan”操作的SQL 语句(SQL Server)Quick way to learn database?
[转载] 申请Database版版主SQL database suspect status, Help!!!
seeking your cool idea在personal oracle 中如何config connection 到本地database?
[转载] 真的没有人懂 ORACLE pro*c阿? :((((Re: 菜鸟问题: 请问现在的数据库的远程管理能做到那些?是否可以完全取代
我这个数据库怎么办啊?how to do this Database operation as time
One question on SQL ServerASP高人们帮忙看看这几行 SQL codes的问题,谢乐!
请问DATABASE各位大侠How to create a new database under SQL 7.0 from remote host?
Question about T-SQLRe: How to create a new database under SQL 7.0 from remote host?
相关话题的讨论汇总
话题: use话题: declare话题: databases话题: sql
进入Database版参与讨论
1 (共1页)
g******o
发帖数: 4
1
Question:
Can I declare a variable to hold databases name and then use
the USE statement to switch between databases? Thanks.
I tried following approach but it won't work.
/*********************************
DECLARE @DatabaseName sysname
SET @DatabaseName = 'pubs'
USE @DatabaseName
*********************************/
Please help!
a*****a
发帖数: 438
2
I don't think it's possible but I may be wrong too..
Can you use sp_defaultdb? what's your scenario?

【在 g******o 的大作中提到】
: Question:
: Can I declare a variable to hold databases name and then use
: the USE statement to switch between databases? Thanks.
: I tried following approach but it won't work.
: /*********************************
: DECLARE @DatabaseName sysname
: SET @DatabaseName = 'pubs'
: USE @DatabaseName
: *********************************/
: Please help!

a****o
发帖数: 37
3
try
exec ('use ' + @dbname)

【在 g******o 的大作中提到】
: Question:
: Can I declare a variable to hold databases name and then use
: the USE statement to switch between databases? Thanks.
: I tried following approach but it won't work.
: /*********************************
: DECLARE @DatabaseName sysname
: SET @DatabaseName = 'pubs'
: USE @DatabaseName
: *********************************/
: Please help!

1 (共1页)
进入Database版参与讨论
相关主题
Re: How to create a new database under SQL 7.0 from remote host?我这个数据库怎么办啊?
[转载] 新手求教:DATABASE编程的入门One question on SQL Server
a simple question请问DATABASE各位大侠
Oracle每次一重启就不能用了...help please~Question about T-SQL
请教zenny、Assailant等牛人:如何找出进行“Ful Scan”操作的SQL 语句(SQL Server)Quick way to learn database?
[转载] 申请Database版版主SQL database suspect status, Help!!!
seeking your cool idea在personal oracle 中如何config connection 到本地database?
[转载] 真的没有人懂 ORACLE pro*c阿? :((((Re: 菜鸟问题: 请问现在的数据库的远程管理能做到那些?是否可以完全取代
相关话题的讨论汇总
话题: use话题: declare话题: databases话题: sql