SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Assigning or Changing a Schema name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

programmer89
Starting Member

India
4 Posts

Posted - 03/03/2008 :  18:11:42  Show Profile  Send programmer89 a Yahoo! Message  Reply with Quote
Hello everyone. I wanted to learn to assign and change a schema names used in my table. I dont want a dbo. in my tables. I want to give a personal name like the adventureworks database has. (Such as sales.salesdetails, humanresources.employee and all)

> So how i do create a table with a schema name sales
and
> How do i change my for example dbo.employee to sales.employee ??

I tried
Create table sales.employee
{
statements
}

but it doesnt work...
Please reply ASAP

Thanks

into the world of programming now :)

tkizer
Almighty SQL Goddess

USA
35940 Posts

Posted - 03/03/2008 :  18:14:57  Show Profile  Visit tkizer's Homepage  Reply with Quote
Does the sales schema exist?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

programmer89
Starting Member

India
4 Posts

Posted - 03/03/2008 :  18:32:27  Show Profile  Send programmer89 a Yahoo! Message  Reply with Quote
I wrote a command

Create Schema sales

Thats it. And have the tables..

into the world of programming now :)
Go to Top of Page

programmer89
Starting Member

India
4 Posts

Posted - 03/04/2008 :  19:14:59  Show Profile  Send programmer89 a Yahoo! Message  Reply with Quote
anyone ??

into the world of programming now :)
Go to Top of Page

dataguru1971
Flowing Fount of Yak Knowledge

USA
1464 Posts

Posted - 03/04/2008 :  19:25:43  Show Profile  Send dataguru1971 an AOL message  Send dataguru1971 a Yahoo! Message  Reply with Quote
Did you assign the appropriate permissions etc per books online?

http://msdn2.microsoft.com/en-us/library/ms189462.aspx



Poor planning on your part does not constitute an emergency on my part.

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
29910 Posts

Posted - 03/04/2008 :  19:26:57  Show Profile  Visit SwePeso's Homepage  Reply with Quote
Reading Books Online says
quote:
The following example modifies the schema HumanResources by transferring the table Address from schema Person into the schema.
USE AdventureWorks;
GO
ALTER SCHEMA HumanResources TRANSFER Person.Address;
GO




E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

programmer89
Starting Member

India
4 Posts

Posted - 03/05/2008 :  18:52:52  Show Profile  Send programmer89 a Yahoo! Message  Reply with Quote
Got it to work !

into the world of programming now :)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000