Issue: i have a procedure (simplified), created by .NET application:
create procedure #SaveData
@InValue varchar(128)
as
begin
insert into Production.TargetTable (PREFIX_Value) select @InValue
end
Problem is, the database uses SQL_SLOVAK_CP1250_CI_AS collation. TempDB uses default SQL_Latin1_General_CP1_CI_AS collation.
Problem simplified:
-- this doesnt work, returns RTC
create procedure #SaveData
@InValue varchar(128)
as
begin
select @InValue
end
-- this doesnt work, returns RTC
create procedure #SaveData
@InValue varchar(128)
as
begin
select @InValue collate SQL_SLOVAK_CP1250_CI_AS
end
-- this does work, returns ŘŤČ
create procedure SaveData
@InValue varchar(128)
as
begin
select @InValue
end
Which causes that instead for instead of test string ŘŤČ, RTC is saved. When i remove the # from the Procedure name and dont create it as a temp procedure, everything works.
Now, one fix found to work, is to change the param type from varchar to nvarchar. But this would be a lot of work (many different procedures). Is there any global approach that could work?
Thank you and have a nice day