Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Executing sp_rename from an application
Message
De
16/10/2014 11:46:26
John Baird
Coatesville, Pennsylvanie, États-Unis
 
 
À
16/10/2014 11:42:40
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2012
Application:
Web
Divers
Thread ID:
01609538
Message ID:
01609539
Vues:
42
>In my application, the connection string specifies the database. So, when I do database management, I do not have to specify the database.
>
>However, when I have to do this:
>
>
>EXEC sp_rename 'ReportApplication.Size', 'SizeTest', 'COLUMN'
>
>
>...as this is calling a SQL Server procedure, do I have to prefix the first parameter with the database name?
>
>I am using sp_rename here as it seems SQL Server does not support ALTER COLUMN. If there is a way to do it, let me know.



Alter Table 'mytable' AlterColumn.'mycolumn' INT NOT NULL (or whatever). If the column is used in a constraint, you may have to drop the constraint first, then recreate it...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform