I am having an issue with renaming columns. My code is as follows:
I am getting an error message as follows:Code:Using m_cnInterval Using m_CMDInterval = New SqlCommand() m_CMDInterval.Connection = m_cnInterval m_CMDInterval.CommandText = "EXEC sp_rename '[" & strClassColumnName(intClassArrayPosition) & "]', '[" & strRenameClassColumn(intClassArrayPosition) & "]', 'COLUMN'" m_CMDInterval.CommandType = CommandType.Text m_CMDInterval.ExecuteNonQuery() End Using End Using
"Either the parameter @objname is ambiguous or the claimed @objtype (column) is wrong"
I think this error is related to the way I am using my single quotes and brackets. Is there another syntax when using variables for column names?
Thanks


Reply With Quote
