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, Contributor
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
Discover the best solutions for encrypting, decrypting and restoring a database in SQL Server 2005.continue reading
Learn why using a SQL Server stored procedures vs. a trigger can be a preferred method to retrieve data notification from a database field.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.