Microsoft
Software
Hardware
Network
Question : Need to Raname a field using SQL statement
We are having problems with a FIELD name using VB and therefore we need to rename it... We have tried many SQL statements we found out in the internet but were unsuccessful...
These are some options we have tried:
ALTER TABLE Presupuestos_detalle ALTER COLUMN [pvp_descto-pre-det] RENAME pvp_descto_det_pre
Incorrect systax near pvp_descto_det_pre
ALTER TABLE Presupuestos_detalle RENAME [pvp_descto-pre-det] TO pvp_descto_det_pre
Incorrect syntax near pvp_descto-det-pre
ALTER TABLE Presupuestos_detalle RENAME COLUMN [pvp_descto-pre-det] TO pvp_descto_det_pre
Incorrect syntax near keyword 'COLUMN'
We cannot use the SQL Server to rename it... It must be done in our VB programme using a SQL statement, but we run out of options... Any other option? Thank U very much
Answer : Need to Raname a field using SQL statement
try the following
sp_rename 'Pedidos_cli_detalle.[pvp_
descto-det
-ped]' , 'pvp_descto_det_ped', 'COLUMN'
Rao
Random Solutions
dynamic sql CASE statements
how can i change stagewidth and stageheight with as3
Excel chart question - multiple charts
Reverse HLOOKUP / find the first "0" from right to left in a row
Array formula to sum the product of two columns
Setting up Exchange Server 2003, Cisco Pix 501, DNS MX Record
Javascript Reset function
How to read city from Active Directory and use as parameter to startup exe
Microsoft, NTFS Permissions, Windows 2003 R2, PowerShell, recursive search for folder, not file, ACLs on 200,000 folders
Generic Host Process for Win32 Services Problem (not virus)