Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rename a Field
Message
 
 
À
04/08/2006 19:41:58
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01143132
Message ID:
01143135
Vues:
12
>How can i test if a field exist in SQL SERVER Table and then rename it and change de field with, programaticaly.
IF EXISTS(SELECT * FROM MyDB.INFORMATION_SCHEMA.COLUMNS
		WHERE table_name = 'MyTable' 
			and column_name = 'MyColumnName')
  EXECUTE sp_rename N'dbo.MyDB.MyColumnName', N'NewColumnName', 'COLUMN'
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform