Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ms-Sql2000....field check
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Ms-Sql2000....field check
Divers
Thread ID:
00661603
Message ID:
00661603
Vues:
67
At the Foxpro, it can controll with INDBC command which field be or not at a file.

Like : (FoxPro)

IF INDBC(_seek,"FIELD") = .F.
ALTER TABLE mal ADD COLUMN ("d" + ALLTRIM(STR(mary))) i NULL
ENDIF

At the Ms-Sql2000 Stored procedure I did a sample as follow. And I had trouble :

1- the row of "ALTER TABLE mal ADD @depo money null" it gives back syntax error for @depo
2- How can I get(handle) a field be or not at a file.

Note : I want to do this operations inside of the stored procedure.

Thanks

Sample code of SQL :

USE foxsql

DECLARE @depo nvarchar(9)
DECLARE depo_hrk CURSOR FOR
SELECT DISTINCT 'depo_' + cast(depo as nvarchar(4)) as depo FROM hrk ORDER BY depo

OPEN depo_hrk

FETCH NEXT FROM depo_hrk INTO @depo

WHILE @@fetch_status = 0
BEGIN

ALTER TABLE mal ADD @depo money null

FETCH NEXT FROM depo_hrk INTO @depo
END

CLOSE depo_hrk
deallocate depo_hrk
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform