Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Table name in SQL Parameters
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00795824
Message ID:
00795857
Vues:
14
I thought to use that solution, and it seems to be the only solution, but We are limited by 8000 char in the @SQLStr variable, and my store proc is a big one... :-(

So I have to revise my code to have a smaller procedure.

>You've to build and run dynamic sql using EXECUTE command or sp_executesql system sproc.
Declare @Myparam as Varchar(50), @SqlStr varchar (512)
>
>Set @MyParam = 'TableName'
>
>SET @SqlStr = 'Select * from A_Table as T1 Left join ' + ;
>		@MyParam + ' as T2 on T2.Id=T1.Id'
>
>EXECUTE (@SqlStr)
>
>>How can I pass a table name as a parameter in SQL Server 2000 stored procedure?
>>
>>For exemple:
>>
>>Declare @Myparam as Varchar(50)
>>
>>Set @MyParam = 'TableName'
>>
>>Select * from A_Table as T1
>>Left join @MyParam as T2 on T2.Id=T1.Id
>>
>>
>>This sample does not work, but It represent what I'd like to do
>>
>>Thanks
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform