如何设置SQL数据库? [英] How to set an SQL database active?

查看:98
本文介绍了如何设置SQL数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





谁能告诉我如何设置SQL数据库?我正在运行SQL Server 2012 Express Edition。我的目标是当我在查询编辑器中执行命令时,它会自动将我指向的数据库作为活动目标。



谢谢,

Hi,

Can anyone tell me how can I set an SQL database active? I'm running SQL Server 2012 Express Edition. My objective here is that when I execute a command in the query editor, it will automatically target the database I pointed as active.

Thanks,

推荐答案

1。工具栏上有一个下拉组合,允许您选择要应用命令的数据库。



2.在SQL中......



1. There is a drop-down combo on the toolbar allowing you to select the database to which commands apply.

2. In SQL...

USE db_name
GO

-- Now using db_name as default database.
select * from table_in_db_name


这篇关于如何设置SQL数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆