Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
EXECUTE COMMAND PROBLEM
Message
De
15/01/2001 18:05:59
Greg Coopman
Gc Systems Corporation
Hollywood, Floride, États-Unis
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
EXECUTE COMMAND PROBLEM
Divers
Thread ID:
00463985
Message ID:
00463985
Vues:
55
I wrote the following code and cannot get it to run:

DECLARE @RequestID UNIQUEIDENTIFIER,
@TempTableName VARCHAR(36),
@Cmd NVARCHAR(200)

SET @RequestID = NEWID()
SET @CMD = N'SELECT [TypeIDField], [DataValue] FROM RequestProperty_tbl re LEFT OUTER JOIN ' + @TempTableName + ' AS t ' + 'ON t.[ID] = re.[TypeIDField] WHERE re.[RequestID] = ' + @RequestID

EXECUTE SP_EXECUTESQL @CMD

--Server: Msg 403, Level 16, State 1, Line 7
--Invalid operator for data type. Operator equals add, type equals nvarchar.


How can I format it with the @RequestID UniqueIdentifier to run correctly?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform