|
INTERVIEW QUESTIONS
DATABASE
MS SQL SERVER
DETAILS
Question: How to set the current database in MS SQL Server?
Answer: Once you are connected to the SQL Server, you should select a database to work with and set it as the current database using the "USE" statement with this syntax:
USE database_name
The following tutorial example shows you how to set "YourDataBaseName" as the current database, and create a table in "YourDataBaseName":
USE YourDataBaseName GO Changed database context to 'YourDataBaseName'.
CREATE TABLE Links (Name NVARCHAR(32)) GO
SELECT name, type_desc, create_date FROM sys.tables GO name type_desc create_date Links USER_TABLE 2007-05-19 23:05:43.700
|
|
|
Category |
MS SQL Server Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 7175 users |
Added on |
9/22/2014 |
Views |
68038 |
Rate it! |
|
|
Question:
How to set the current database in MS SQL Server?
Answer:
Once you are connected to the SQL Server, you should select a database to work with and set it as the current database using the "USE" statement with this syntax:
USE database_name
The following tutorial example shows you how to set "YourDataBaseName" as the current database, and create a table in "YourDataBaseName":
USE YourDataBaseName GO Changed database context to 'YourDataBaseName'.
CREATE TABLE Links (Name NVARCHAR(32)) GO
SELECT name, type_desc, create_date FROM sys.tables GO name type_desc create_date Links USER_TABLE 2007-05-19 23:05:43.700 Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What is the simplest way to create a new database in MS SQL Server?
|
View Answer
|
|
What is a database in MS SQL Server?
|
View Answer
|
|
How to delete database objects with "DROP" statements in MS SQL Server?
|
View Answer
|
|
How to grant a permission in MS SQL Server using "GRANT EXECUTE" statements?
|
View Answer
|
|
How to create a view and a stored procedure in MS SQL Server using "CREATE VIEW/PROCEDURE" statements?
|
View Answer
|
|
How to create a user to access a database in MS SQL Server using "CREATE USER" statements?
|
View Answer
|
|
How to create a login account in MS SQL Server to access the database engine using "CREATE LOGIN" statements?
|
View Answer
|
|
How to read data in a table with "SELECT" statements?
|
View Answer
|
|
How to insert and update data into a table with "INSERT" and "UPDATE" statements?
|
View Answer
|
|
How to create new table with "CREATE TABLE" statements?
|
View Answer
|
|
How to create new databases with "CREATE DATABASE" statements?
|
View Answer
|
|
How to use Transact-SQL statements to access the database engine?
|
View Answer
|
|
How to run SQL Server 2005 Books Online on your local system?
|
View Answer
|
|
How to run Queries with SQL Server Management Studio Express?
|
View Answer
|
|
How to download and install SQL Server 2005 Books Online?
|
View Answer
|
|
How to download and install Microsoft SQL Server Management Studio Express?
|
View Answer
|
|
How to connect SQL Server Management Studio Express to SQL Server 2005 Express?
|
View Answer
|
|
How do you know if SQL Server is running on your local system?
|
View Answer
|
|
What is sqlservr.exe - Process - SQL Server (SQLEX?PRESS)?
|
View Answer
|
|
How to install SQL Server 2005 Express Edition?
|
View Answer
|