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
Is a license needed for a standby server if it's used for SQL Server replication? Get that answer and a comparison of SQL Server log shipping to ... 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
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.