Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remove constraint from VFP app
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01639883
Message ID:
01639885
Vues:
63
>Hi,
>
>The SQL Database has a constraint that I see (in SSMS) in Keys and Indexes. I need to remove this contraint and replace it with another.
>
>For example,
>Constraint name IX_CATEGORY_UNIQUE is as follows:
>
>ALTER TABLE [dbo].[MyTable] ADD  CONSTRAINT [IX_CATEGORY_UNIQUE] UNIQUE NONCLUSTERED 
>(
>	[CATEGORY] ASC
>)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = 
>OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
>GO
>
>
>I want to find it an replace with [SITE_NO],[CATEGORY]
>
>The first step is to find and drop it. What is the SQL Select to exececute from VFP?
>
>TIA
TEXT TO lcSQL NOSHOW
     ALTER TABLE [dbo].[MyTable] DROP CONSTRAINT [IX_CATEGORY_UNIQUE]
ENTEXT
IF SQLEXECT(sqlHandler, lcSQL)  < 0
   AERROR(laError)
   MessageBox(laError[1,2])
   RETURN
ENDIF

TEXT TO lcSQL NOSHOW
ALTER TABLE [dbo].[MyTable] ADD  CONSTRAINT [IX_CATEGORY_UNIQUE] UNIQUE NONCLUSTERED 
(
	[SITE_NO],[CATEGORY]
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = 
OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
ENDTEXT
IF SQLEXECT(sqlHandler, lcSQL)  < 0
   AERROR(laError)
   MessageBox(laError[1,2])
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform