Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Change table schema

 
   Database Forums (Home) -> Programming RSS
Next:  Find name of 1st table that fires trigger  
Author Message
Luigi

External


Since: Apr 18, 2006
Posts: 20



(Msg. 1) Posted: Wed Feb 20, 2008 7:37 am
Post subject: Change table schema
Archived from groups: microsoft>public>sqlserver>programming (more info?)

Hi all,
how can I change the schema of a single table?
(SS 2005).

Thanks a lot.

--
Luigi
http://blogs.dotnethell.it/ciupaz/

 >> Stay informed about: Change table schema 
Back to top
Login to vote
Aaron Bertrand [SQL Serve

External


Since: Jun 15, 2005
Posts: 632



(Msg. 2) Posted: Wed Feb 20, 2008 10:52 am
Post subject: Re: Change table schema [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You want to move a table from one schema to another? The following sample
takes table_name and changes the schema from some_other_schema to dbo.

ALTER SCHEMA dbo TRANSFER some_other_schema.table_name;






"Luigi" wrote in message

> Hi all,
> how can I change the schema of a single table?
> (SS 2005).
>
> Thanks a lot.
>
> --
> Luigi
> http://blogs.dotnethell.it/ciupaz/

 >> Stay informed about: Change table schema 
Back to top
Login to vote
Tibor Karaszi

External


Since: Jan 29, 2004
Posts: 891



(Msg. 3) Posted: Wed Feb 20, 2008 4:40 pm
Post subject: Re: Change table schema [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Can you explain what you mean by "change schema"? Do you mean things like add column, drop column
etc? If so, check out ALTER TABLE.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi


"Luigi" wrote in message

> Hi all,
> how can I change the schema of a single table?
> (SS 2005).
>
> Thanks a lot.
>
> --
> Luigi
> http://blogs.dotnethell.it/ciupaz/
 >> Stay informed about: Change table schema 
Back to top
Login to vote
Luigi

External


Since: Apr 18, 2006
Posts: 20



(Msg. 4) Posted: Wed Feb 20, 2008 4:40 pm
Post subject: Re: Change table schema [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Tibor Karaszi" wrote:

> Can you explain what you mean by "change schema"? Do you mean things like add column, drop column
> etc? If so, check out ALTER TABLE.

Sorry, no, I mean change the "owner" of the table, like

dbo.MyTable

to

Client.MyTable

Luigi
 >> Stay informed about: Change table schema 
Back to top
Login to vote
Uri Dimant

External


Since: Aug 24, 2003
Posts: 739



(Msg. 5) Posted: Wed Feb 20, 2008 5:55 pm
Post subject: Re: Change table schema [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Tibor
Finally people start mentioning the versuion they are using, so perhaps if
the OP mentined SQL Server 2005 he/she really means SCHEMA ? Smile)
Any way if you do mean SCHEMA

SELECT 'ALTER SCHEMA dbo TRANSFER ' + SCHEMA_NAME(schema_id) + '.' + name
FROM sys.tables
WHERE schema_id != SCHEMA_ID('dbo');




"Tibor Karaszi" wrote in
message
> Can you explain what you mean by "change schema"? Do you mean things like
> add column, drop column etc? If so, check out ALTER TABLE.
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
>
> "Luigi" wrote in message
>
>> Hi all,
>> how can I change the schema of a single table?
>> (SS 2005).
>>
>> Thanks a lot.
>>
>> --
>> Luigi
>> http://blogs.dotnethell.it/ciupaz/
>
>
 >> Stay informed about: Change table schema 
Back to top
Login to vote
Tibor Karaszi

External


Since: Jan 29, 2004
Posts: 891



(Msg. 6) Posted: Wed Feb 20, 2008 6:26 pm
Post subject: Re: Change table schema [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

My bad, Luigi. You did phrase the question correctly, it was I who should be quiet when I'm tired.
Uri and Aaron understood what you meant. Smile

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi


"Luigi" wrote in message

> "Tibor Karaszi" wrote:
>
>> Can you explain what you mean by "change schema"? Do you mean things like add column, drop column
>> etc? If so, check out ALTER TABLE.
>
> Sorry, no, I mean change the "owner" of the table, like
>
> dbo.MyTable
>
> to
>
> Client.MyTable
>
> Luigi
 >> Stay informed about: Change table schema 
Back to top
Login to vote
Luigi

External


Since: Apr 18, 2006
Posts: 20



(Msg. 7) Posted: Thu Feb 21, 2008 12:03 am
Post subject: Re: Change table schema [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Tibor Karaszi" wrote:

> My bad, Luigi. You did phrase the question correctly, it was I who should be quiet when I'm tired.
> Uri and Aaron understood what you meant. Smile
>
Yeah Tibor Wink
Thanks a lot you all.


--
Luigi
http://blogs.dotnethell.it/ciupaz/
 >> Stay informed about: Change table schema 
Back to top
Login to vote
satish kumar kankerwal

External


Since: Jul 22, 2010
Posts: 2



(Msg. 8) Posted: Thu Jul 22, 2010 5:37 am
Post subject: .net professional [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

greate



ciupazNoSpamGrazi wrote:

Re: Change table schema
21-Feb-08

"Tibor Karaszi" wrote:

Yeah Tibor Wink
Thanks a lot you all.


--
Luigi
http://blogs.dotnethell.it/ciupaz/

Previous Posts In This Thread:

On Wednesday, February 20, 2008 10:37 AM
ciupazNoSpamGrazi wrote:

Change table schema
Hi all,
how can I change the schema of a single table?
(SS 2005).

Thanks a lot.

--
Luigi
http://blogs.dotnethell.it/ciupaz/

On Wednesday, February 20, 2008 10:40 AM
Tibor Karaszi wrote:

Can you explain what you mean by "change schema"?
Can you explain what you mean by "change schema"? Do you mean things like add column, drop column
etc? If so, check out ALTER TABLE.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi


"Luigi" wrote in message


On Wednesday, February 20, 2008 10:52 AM
ciupazNoSpamGrazi wrote:

Re: Change table schema
"Tibor Karaszi" wrote:


Sorry, no, I mean change the "owner" of the table, like

dbo.MyTable

to

Client.MyTable

Luigi

On Wednesday, February 20, 2008 10:52 AM
Aaron Bertrand [SQL Server MVP] wrote:

You want to move a table from one schema to another?
You want to move a table from one schema to another? The following sample
takes table_name and changes the schema from some_other_schema to dbo.

ALTER SCHEMA dbo TRANSFER some_other_schema.table_name;






"Luigi" wrote in message


On Wednesday, February 20, 2008 10:55 AM
Uri Dimant wrote:

Hi TiborFinally people start mentioning the versuion they are using, so
Hi Tibor
Finally people start mentioning the versuion they are using, so perhaps if
the OP mentined SQL Server 2005 he/she really means SCHEMA ? Smile)
Any way if you do mean SCHEMA

SELECT 'ALTER SCHEMA dbo TRANSFER ' + SCHEMA_NAME(schema_id) + '.' + name
FROM sys.tables
WHERE schema_id != SCHEMA_ID('dbo');




"Tibor Karaszi" wrote in
message

On Wednesday, February 20, 2008 12:26 PM
Tibor Karaszi wrote:

My bad, Luigi.
My bad, Luigi. You did phrase the question correctly, it was I who should be quiet when I'm tired.
Uri and Aaron understood what you meant. :-)

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi


"Luigi" wrote in message


On Thursday, February 21, 2008 3:03 AM
ciupazNoSpamGrazi wrote:

Re: Change table schema
"Tibor Karaszi" wrote:

Yeah Tibor Wink
Thanks a lot you all.


--
Luigi
http://blogs.dotnethell.it/ciupaz/


Submitted via EggHeadCafe - Software Developer Portal of Choice
WPF Control?s Default Style or Template by Extending the WPF Designer in Visual Studio 2010
http://www.eggheadcafe.com/tutorials/aspnet/d1ad0a33-d815-4083-8e97-c2...d661095
 >> Stay informed about: Change table schema 
Back to top
Login to vote
satish kumar kankerwal

External


Since: Jul 22, 2010
Posts: 2



(Msg. 9) Posted: Thu Jul 22, 2010 5:39 am
Post subject: change table scema [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

right click table | modify | goes on property panel then set new schema value on schema row



ciupazNoSpamGrazi wrote:

Re: Change table schema
21-Feb-08

"Tibor Karaszi" wrote:

Yeah Tibor Wink
Thanks a lot you all.


--
Luigi
http://blogs.dotnethell.it/ciupaz/

Previous Posts In This Thread:

On Wednesday, February 20, 2008 10:37 AM
ciupazNoSpamGrazi wrote:

Change table schema
Hi all,
how can I change the schema of a single table?
(SS 2005).

Thanks a lot.

--
Luigi
http://blogs.dotnethell.it/ciupaz/

On Wednesday, February 20, 2008 10:40 AM
Tibor Karaszi wrote:

Can you explain what you mean by "change schema"?
Can you explain what you mean by "change schema"? Do you mean things like add column, drop column
etc? If so, check out ALTER TABLE.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi


"Luigi" wrote in message


On Wednesday, February 20, 2008 10:52 AM
ciupazNoSpamGrazi wrote:

Re: Change table schema
"Tibor Karaszi" wrote:


Sorry, no, I mean change the "owner" of the table, like

dbo.MyTable

to

Client.MyTable

Luigi

On Wednesday, February 20, 2008 10:52 AM
Aaron Bertrand [SQL Server MVP] wrote:

You want to move a table from one schema to another?
You want to move a table from one schema to another? The following sample
takes table_name and changes the schema from some_other_schema to dbo.

ALTER SCHEMA dbo TRANSFER some_other_schema.table_name;






"Luigi" wrote in message


On Wednesday, February 20, 2008 10:55 AM
Uri Dimant wrote:

Hi TiborFinally people start mentioning the versuion they are using, so
Hi Tibor
Finally people start mentioning the versuion they are using, so perhaps if
the OP mentined SQL Server 2005 he/she really means SCHEMA ? Smile)
Any way if you do mean SCHEMA

SELECT 'ALTER SCHEMA dbo TRANSFER ' + SCHEMA_NAME(schema_id) + '.' + name
FROM sys.tables
WHERE schema_id != SCHEMA_ID('dbo');




"Tibor Karaszi" wrote in
message

On Wednesday, February 20, 2008 12:26 PM
Tibor Karaszi wrote:

My bad, Luigi.
My bad, Luigi. You did phrase the question correctly, it was I who should be quiet when I'm tired.
Uri and Aaron understood what you meant. :-)

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi


"Luigi" wrote in message


On Thursday, February 21, 2008 3:03 AM
ciupazNoSpamGrazi wrote:

Re: Change table schema
"Tibor Karaszi" wrote:

Yeah Tibor Wink
Thanks a lot you all.


--
Luigi
http://blogs.dotnethell.it/ciupaz/

On Thursday, July 22, 2010 8:37 AM
satish kumar kankerwal wrote:

..net professional
greate


Submitted via EggHeadCafe - Software Developer Portal of Choice
Store ASP.NET Site Visitor Stats in MongoDb
http://www.eggheadcafe.com/tutorials/aspnet/3a73c6de-82a1-4690-a7aa-d0...58203f7
 >> Stay informed about: Change table schema 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
schema permission - In sql server 2005 I have a table named "Clients", CREATE TABLE Clients (serviceCenter varchar(25), CompanyName varchar (25), ... .... ..) "ServiceCenter" contains different values (ex: NY, VA, NJ, ... ...) is there a way I can ...

Schema XML on column - Hello I would like to know on the xml column if there is a schema associated. What query must i use ? Franck

DB schema documnetation. - Hi, I need to document SQL Server DB schema but the catch is that I also want to show the dependencies of different reports in SSRS on views and stored procedures. I know there are lots of product which can document DB or system tables can also be....

default schema not deployed dbo used instead - I am accessing a 2005 sql server on an xp sp2 box via a .net 1.1 application on iis 5. The web.config is set to use windows authentication via account impersonation. <identity impersonate="true" userName="impuser" password="...

Change Column Names - Hello, I have a table with 3 columns: "Title", "Description" and "Html" I want to select all records but renaming the columns to: "PostTitle", "PostDescription" and "PostHtml" How can I do th...
   Database Forums (Home) -> Programming All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]