November 1, 2018 at 11:12 am
Dear All,
Kindly assist
DECLARE @query NVARCHAR(MAX);
SET @query = N'DECLARE @specsAndModel TABLE ( specName VARCHAR(50))'
SET @Query = @Query + N' INSERT INTO @specsAndModel VALUES('' 1 + 1''); SELECT specName FROM @specsAndModel'
EXEC (@query);
The code above returns '1 + 1' and I want it to return 2 instead.
Thanks.
November 1, 2018 at 11:17 am
This?
DECLARE @query NVARCHAR(MAX);
SET @query = N'DECLARE @specsAndModel TABLE ( specName VARCHAR(50))';
SET @query += N' INSERT INTO @specsAndModel(specName) select 1 + 1; SELECT specName FROM @specsAndModel';
EXEC (@query);
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
November 1, 2018 at 11:23 am
Olalekan Adewale - Thursday, November 1, 2018 11:12 AMDear All,Kindly assist
DECLARE @query NVARCHAR(MAX);
SET @query = N'DECLARE @specsAndModel TABLE ( specName VARCHAR(50))'
SET @Query = @Query + N' INSERT INTO @specsAndModel VALUES('' 1 + 1''); SELECT specName FROM @specsAndModel'
EXEC (@query);The code above returns '1 + 1' and I want it to return 2 instead.
Thanks.
DECLARE @query NVARCHAR(MAX);
SET @query = N'DECLARE @specsAndModel TABLE ( specName VARCHAR(50))'
SET @Query = @Query + N' INSERT INTO @specsAndModel VALUES( 1 + 1); SELECT specName FROM @specsAndModel'
EXEC (@query);
November 1, 2018 at 2:20 pm
Thanks, am very greatfful.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply