Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #871

Re: I have a issue with "Rename" command

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: I have a issue with "Rename" command
Date Thu, 15 Dec 2011 09:16:04 +0000 (UTC)
Organization Erland Sommarskog
Lines 22
Message-ID <Xns9FBC68739F930Yazorman@127.0.0.1> (permalink)
References <36ee0d8a-803c-455e-ab58-5b1d1fcb6a17@k5g2000pra.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Injection-Date Thu, 15 Dec 2011 09:16:04 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="G7+Jz22XqYCG8C6rb1H3YA"; logging-data="14401"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+AjnC6LK0iVSjtCP5TM2xm"
User-Agent Xnews/2005.10.03 Mime-proxy/1.4.c.4 (Win32)
Cancel-Lock sha1:/FNrBjrAxX2gBjeyD03m6bq9znU=
Xref x330-a1.tempe.blueboxinc.net comp.databases.ms-sqlserver:871

Show key headers only | View raw


chaitra jagirdar (chaitra.jagirdar7@gmail.com) writes:
> i have a table customers with columns :name,age,contact_no
> 
> 1. i want to rename the table cutomers to nokia_customers
> 2.i want to rename the column name to customer_name
> 
> 
> i know i have to use rename command but is alter command necessarily
> be used before using rename command.

EXEC sp_rename 'customers', 'nokia_customers'
EXEC sp_rename 'customers.name', 'customer_name', 'COLUMN' 



-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

I have a issue with "Rename" command chaitra jagirdar <chaitra.jagirdar7@gmail.com> - 2011-12-14 21:38 -0800
  Re: I have a issue with "Rename" command Erland Sommarskog <esquel@sommarskog.se> - 2011-12-15 09:16 +0000
  Re: I have a issue with "Rename" command "Bob Barrows" <reb01501@NOyahooSPAM.com> - 2011-12-15 08:23 -0500
    Re: I have a issue with "Rename" command jsfromynr <jatinder.1975@gmail.com> - 2011-12-21 04:47 -0800

csiph-web