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

From Erland Sommarskog <esquel@sommarskog.se>
Newsgroups comp.databases.ms-sqlserver
Subject Re: I have a issue with "Rename" command
Date 2011-12-15 09:16 +0000
Organization Erland Sommarskog
Message-ID <Xns9FBC68739F930Yazorman@127.0.0.1> (permalink)
References <36ee0d8a-803c-455e-ab58-5b1d1fcb6a17@k5g2000pra.googlegroups.com>

Show all headers | 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