April 10, 2015 at 3:51 am
Hi,
I am getting error in my below sql statement
Declare @sqlquery varchar(max)
Set @sqlquery='INSERT INTO dbo.Staging_Temp_1 fnGetFirstOcurrences(col001, '¯',@Columns),LoadDate FROM dbo.Staging_Temp'
Select @sqlquery
error:-
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '¯'.
plz suggeste me the correct syntax
regards,
Vipin jha
April 10, 2015 at 3:55 am
vipin_jha123 (4/10/2015)
Hi,I am getting error in my below sql statement
Declare @sqlquery varchar(max)
Set @sqlquery='INSERT INTO dbo.Staging_Temp_1 fnGetFirstOcurrences(col001, '¯',@Columns),LoadDate FROM dbo.Staging_Temp'
Select @sqlquery
error:-
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '¯'.
plz suggeste me the correct syntax
regards,
Vipin jha
Single quotation marks (apostrophes) must be escaped within the string
😎
Declare @sqlquery varchar(max)
Set @sqlquery='INSERT INTO dbo.Staging_Temp_1 fnGetFirstOcurrences(col001, ''¯'',@Columns),LoadDate FROM dbo.Staging_Temp'
Select @sqlquery
April 10, 2015 at 3:58 am
Hi,
I want below Output from above command
insert into staging_temp_1
select dbo.fnGetFirstOcurrences(col001, '¯',@Columns),LoadDate from staging_temp
April 10, 2015 at 4:04 am
vipin_jha123 (4/10/2015)
Hi,I want below Output from above command
insert into staging_temp_1
select dbo.fnGetFirstOcurrences(col001, '¯',@Columns),LoadDate from staging_temp
Escaping the quotation marks produces the correct output
😎
INSERT INTO dbo.Staging_Temp_1 fnGetFirstOcurrences(col001, '¯',@Columns),LoadDate FROM dbo.Staging_Temp
April 10, 2015 at 8:45 am
You're missing the SELECT.
And BTW, I suggest to remove the scalar function if possible. We can help you build a faster option.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply