Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Assigning or Changing a Schema name

Author  Topic 

programmer89
Starting Member

4 Posts

Posted - 2008-03-03 : 18:11:42
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

38200 Posts

Posted - 2008-03-03 : 18:14:57
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

4 Posts

Posted - 2008-03-03 : 18:32:27
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

4 Posts

Posted - 2008-03-04 : 19:14:59
anyone ??

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

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2008-03-04 : 19:25:43
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

30421 Posts

Posted - 2008-03-04 : 19:26:57
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

4 Posts

Posted - 2008-03-05 : 18:52:52
Got it to work !

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

- Advertisement -