ASPState Database Creation Script and SQLServer 2019 - Image Data Type is Deprecated

Morgan, Tony (morganaj) 1 Reputation point
2021-10-06T14:58:08.377+00:00

Our DBA ran a SQL Server 2019 Upgrade analysis against our current SQL 2016 server, which contains our ASPState database. The results showed that Image data type is deprecated. Is there an updated version of InstallSQLState.sql that creates the ASPState db and does not use the image data type?

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,253 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,703 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Erland Sommarskog 100.9K Reputation points MVP
    2021-10-06T21:37:17.703+00:00

    Isn't ASP just as old as the image data type? The image data type has been deprecated since SQL 2005, but I guess they had stopped developing ASP by then.


  2. MehaffieShawn-4963 0 Reputation points
    2024-01-04T02:28:34.53+00:00

    It is not ASP the language it is the ASPState database that is a database MS supports for storing cached data. So they provide the scripst to create the database and setup permissions. So he cannot simply change the field to not be image, since that could break a whole lot of stuff in the SPROCS, etc. If MS is still making it an image field I would keep it and expect that at some point MS will provide an updated version of InstallSQLState.sql script once it is finally unsupported. It would be better for MS to provided an update script as soon as it was deprecated, but if they don't and the database works on 2019 with the script they did provide, then just go with it and use it.


  3. Jingyang Li 5,891 Reputation points
    2024-01-04T03:12:52.8966667+00:00

    You can find this MS sample for updated version of the script. (But you may still need a little fix to remove the image type left over inside the code).

    https://github.com/microsoft/sql-server-samples/blob/master/samples/applications/aspnet-session-state/aspstate_sql2016_no_retry.sql

    0 comments No comments

  4. Bruce (SqlWork.com) 55,686 Reputation points
    2024-01-04T20:32:53.7333333+00:00

    aspstate is part of the aspnet 4.* framework. This framework is mature and only receiving security fixes. the old scripts are in the C:\Windows\Microsoft.NET\Framework64\v4.0.30319 folder.

    you can safely change image to varbinary(max) in the table definition. this is the only change required to the scripts.

    if you want to change the schema it is better to do it outside the utility. you can use the above script, or as I have done, create a visual database project from a generated database. you can then edit, and have a deployment package.

    you might also want to change to the new async state provider

    https://www.nuget.org/packages/Microsoft.AspNet.SessionState.SqlSessionStateProviderAsync/

    0 comments No comments