September 20, 2010 at 8:05 am
Hello,
I am trying to create the sysproperties view from SQL Server versions gone by in my SQL Server Standard 2008 instance. I have a program I am trying to upgrade, but I can't test the upgrade without installing the current version we are on. The version we are on uses information in the sysproperties view from the model database during the install. Our vendor for this software gave us both an .exe file to create the needed view and a t-sql script, neither of which have been successful.
This is what I used to try and find the view after each thing I tried.
SELECT * FROM sysobjects WHERE name = 'sysproperties'
The file was called SQLServerPreconfig.exe. The script is below.
Thanks in advance for any guidance.
/**********************************************************************************************************
This will create the sysproperties view to allow the installer to run against SQL Server 2005.
**********************************************************************************************************/
IF SERVERPROPERTY('ProductVersion') > '9' -- Run the code if version is SQL 2005
BEGIN
USE model;
IF NOT EXISTS (SELECT * FROM sysobjects WHERE name = 'sysproperties' AND xtype = 'v')
EXEC ('
CREATE VIEW sysproperties
AS
/* This is a temporary fix. */
SELECT
CASE WHEN Class = 1 THEN 3 ELSE NULL END as [Type],
major_id as [id],
minor_id,
Name,
Value
FROM sys.extended_properties
')
END
September 20, 2010 at 11:59 am
Ok, apparently, the version number is a character field, meaning the greater than part included in the if statement was not comparing 9 to 10, but to 1, so it was aborting before it even tried to create the view.
I have the view now.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply