Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with Alter Table syntax
Message
De
02/12/2004 15:27:00
 
 
À
02/12/2004 15:12:27
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00966491
Message ID:
00966494
Vues:
7
This message has been marked as a message which has helped to the initial question of the thread.
Try
lcInsertStr = "ALTER TABLE " + lcTableName + " ADD CONSTRAINT Table_PK PRIMARY KEY (Studnt_Id_)"
HTH

>I am trying to put a primary key into a table. Later I will be trying to set up relationships between the tables. For now I just want the primary keys in the tables. I have a hard time reading the help file on Alter Table.
>I am using SPT from VFP 6 SP5. And the data is checked at the main database before my program even trys to put it into SQL Server 2000.
>lcTableName = the name of the table in the database
>studnt_id_ is a actual field in the table.
>
>Here is the code that I am doing now:
>
>   lcInsertStr = [ALTER TABLE ] + lcTableName + [ ALTER COLUMN studnt_id_ PRIMARY KEY]
>
>
>The error I get is incorrect syntax near 'PRIMARY'.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform