Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating stored procedure through VFP code
Message
 
 
À
14/01/2003 12:39:47
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
00741525
Message ID:
00745008
Vues:
23
Hi!

It's strange because mine similar function works ok. When you're using Enterprise Manager or Query Analiser to see result, you require to refresh the list of SP to see new stored procedure.

Also, if you're trying to call SP in the same batch where creating it, you could not - you require to call new SP in separate batch. Query Analizer separates batches by using "GO". Unfortunately, you cannot use this in SQLEXEC() - just use 2 SQLEXEC() calls.

HTH.

>I have a VFP application that creates SQL Server databases and tables on the fly. I would also like to be able to create a stored procedure in the created database (this database is usually not the default database).
>
>I created a table in SQL that contains the stored procedure name and stored procedure code
>
>
>lcSql='Create proc '+ALLTRIM(sqltable.csp_name)+" "
>lcscript=ALLTRIM(sqltable.CSP_SCRIPT)
>lcscript=STRTRAN(lcscript,'lcdatabase',gccurrentjob)
>lcsql=lcsql+lcscript
>
>lnSQLResult = SQLEXEC(gnConnectHandle,lcsql)
>
>SQL acts like the command was successful but the stored procedure is not created.
>
>
>Any suggestions??
>
>Thanks.
>
>Joyce
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform