SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns
WHERE TABLE_NAME = 'Address'
You can rename a column using the following example:
EXECUTE sp_rename N'dbo.aaa.NewColumnName', N'NewColumnName2', 'COLUMN'
You can execute it from VB.NET, as well, by using the SqlCommand object and setting the CommandText property to the SQL code you want to execute. For a similar example, look at this expert answer on restoring SQL Server databases in VB.NET.
Dig Deeper on SQL-Transact SQL (T-SQL)
Related Q&A from Roman Rehak
There are a few things you can do to tune SQL Server for improved reporting performance. Here are some generic and Reporting Services-specific ...continue reading
Learn about working with image files in SQL Server, including advice on using queries to locate them, in this expert answer.continue reading
Discover the best solutions for encrypting, decrypting and restoring a database in SQL Server 2005.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.