0

How do I change the .NET framework of MS SQL Server 2012?
I have a SSIS package that has a script that cannot target .NET 4.0 due to using WebUtility.UrlEncode().

Will upgrading to 4.5 on the Server interfere with other stored procedures that are currently running (and targeting 4.0)?

enter image description here

I tried setting the target of the Script Task to 4.0 but WebUtility.UrlEncode isnt available for 4.0.

billinkc
  • 59,250
  • 9
  • 102
  • 159
Lulu
  • 1
  • you can't as it is a compilation activity, why not update it to something more actual – nbk Feb 06 '23 at 21:08
  • Why do you want to install 2012? SQL Server 2012 is completely unsupported, and the only version of SQL Server that SSMS 2012 supported that SSMS 19 doesn't is SQL Server 2005; are you really using a version that old? – Thom A Feb 06 '23 at 21:37
  • You probably don't want to use [WebUtility.UrlEncode()](https://learn.microsoft.com/en-us/dotnet/api/system.net.webutility.urlencode) anywhere at all, anyway, because it's not compliant with [RFC 2396 2.4.1. Escaped Encoding](https://www.ietf.org/rfc/rfc2396.txt). Space characters are supposed to be encoded as `%20` but it chooses instead to encode them as `+`. – AlwaysLearning Feb 06 '23 at 21:55
  • SQL Server 2012 is already installed. Its an old app the company I work for still uses. Its running a bunch of stored procedures that need to be running on its daily cycles and I'm hesitant of making any large changes that would disrupt that environment. I'm new the environment as well so I don't have much knowledge of SQL Server and the .NET Framework. – Lulu Feb 06 '23 at 22:01

1 Answers1

0

Two things at play here.

The first is the target setting for the SSIS Script Task/Component. You can change that up/down as the item requires.

enter image description here

That's a development setting by the way. When you deploy to the server, would need to ensure that server itself has an equivalent runtime on it.

enter image description here

Now, things get "weird" because for the 4.0 runtime framework, which we both have, there are developer versions within that version, from a Command Prompt if you typed

C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe you'd see what version there. For example, I see

Microsoft (R) Visual C# Compiler version 4.8.4084.0 for C# 5

How do I find the .NET version?

billinkc
  • 59,250
  • 9
  • 102
  • 159
  • I probably butchered the terminology there but hopefully gives you a solid shove in the right direction – billinkc Feb 06 '23 at 21:55
  • >reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\full" /v version HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\full version REG_SZ 4.7.03062 Is what I get when I run the command prompt. Its odd because this exact same stored procedure WAS working a few days ago using the exact same Script but now isnt working under the stored sql jobs. – Lulu Feb 07 '23 at 13:32