sql server如何使用数据库 [英] sql server how to use database

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

问题描述

先生/女士,我已将数据库附加到sql服务器,它在对象资源管理器中向我显示了这样的

sir/madam, I have attache my database to sql server it shows me in Object Explorer like this

GHARKUL.MDF


但是当我键入要使用数据库的查询时.


But when i type the Query to use database.

USE GHARKUL.MDF;

它给了我错误

无法在sysdatabases中找到数据库"GHARKUL"的条目.找不到使用该名称的条目.确保正确输入名称.


如果我不正确,如何在sql server 2008中获取数据库以及如何通过查询使用它?

谢谢您

it gives me error

Could not locate entry in sysdatabases for database ''GHARKUL''. No entry found with that name. Make sure that the name is entered correctly.


If i am not correct how to get my database in sql server 2008 and how to use it through query?

Thanking You

推荐答案

您可以通过使用数据库的名称而不是路径来使用数据库(大概来自您的示例):
You can use the database by using it''s name not the path (presumably from your example) :
use GHARKUL;


重命名F:\ WEBLOGIN \ APP_DATA \ GHARKUL. MDF转换为GHARKUL.MDF
然后用作

rename F:\WEBLOGIN\APP_DATA\GHARKUL.MDF to GHARKUL.MDF
and then use as

Use GHARKUL



否则分享您的错误消息



otherwise share your error message


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

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