Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP Macro substitution in T-SQL
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00979670
Message ID:
00979671
Vues:
12
See EXECUTE() statement an sp_executesql system stored procedure in BOL.
DECLARE @cond varchar(4000), @sql varchar(4000)
SET @Cond = ' name like ''%John%'' '
SET @sql = 'SELECT * FROM customers where ' + @Cond
EXECUTE (@sql)
Check also How to return a value from dynamicaly executed T-SQL code FAQ #8130

>Which is the equivalent in T-SQL SQL Server to the "&" symbol, VFP macro substitution?.
>
>E.g., I need to do this VFP's example in T-SQL.
>
>
>lcCond = " name like '%John%' "
>SELECT * FROM customers where &lccond
>
>
>or
>
>
>lcCond = " invoicenumber > 1056 "
>SELECT * FROM invoices where &lccond
>
>
>
>How it would be in T-SQL ?
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform