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 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: 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 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