ALTER SCHEMA

In Adventure Works Sample database which is in SQL Server 2005 contains tables like
HumanResources.Employee
HumanResouces.Address
Person.Address
If we run the These tables without giving schema name we can not get the result.
For Eg:SELECT * FROM Employee--Here we wont get results because we are not giving schema name here.
If we write query then only we will get the result like
SELECT * FROM HumanResources.Employee--We can get result here.
Now i want to change the schema from HumanResources to dbo so that i can get the result without mentioning the Schema name before the table

ALTER SCHEMA dbo TRANSFER HumanResources.Employee

This statement changes Table from HumanResources.Employee to Employee. And we can get the result.

Comments

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Pre login Handshake or Connection Timeout Period

Transparent Data Encryption(TDE) with Master Key and Certificate in SQL Server