Hi,
with this following small code, I have the problem of having a string apostrophe in my SQL Statement,aswell as the usual apostrophe for the string @str. I tried using speech marks in my SQL statement, but for some reason it sees my desired string to be filled in the columns as a column name.
CREATE procedure dbo.proc_102003
as
declare @str as varchar(5000)
begin
set @str ='INSERT INTO PBR_Tab_Premium_TT ( cls_date, rec_type )
SELECT 'XDE' AS cls_date
, 'UPR' AS rec_type'
exec(@str)
end
GO
Can anyone tell me how to solve this problem?
Thanks in advance ,
Kingsley