Closed JordanMarr closed 3 years ago
Thanks for reporting, I need bit of your help to sort this out...
Basically this is the query we are using, with the IsComputed
as added (line 5):
SELECT c.COLUMN_NAME,c.DATA_TYPE, c.character_maximum_length, c.numeric_precision, c.is_nullable
,CASE WHEN pk.COLUMN_NAME IS NOT NULL THEN 'PRIMARY KEY' ELSE '' END AS KeyType
,COLUMNPROPERTY(OBJECT_ID(c.TABLE_SCHEMA + '.' + c.TABLE_NAME), c.COLUMN_NAME, 'IsIdentity') AS IsIdentity,
case when COLUMN_DEFAULT is not null then 1 else 0 end as HasDefault,
COLUMNPROPERTY(OBJECT_ID(c.TABLE_SCHEMA+'.'+c.TABLE_NAME), c.COLUMN_NAME, 'IsComputed') AS IsComputed
FROM INFORMATION_SCHEMA.COLUMNS c
LEFT JOIN (
SELECT ku.TABLE_CATALOG,ku.TABLE_SCHEMA,ku.TABLE_NAME,ku.COLUMN_NAME
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS tc
INNER JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS ku
ON tc.CONSTRAINT_TYPE = 'PRIMARY KEY'
AND tc.CONSTRAINT_NAME = ku.CONSTRAINT_NAME
) pk
ON c.TABLE_CATALOG = pk.TABLE_CATALOG
AND c.TABLE_SCHEMA = pk.TABLE_SCHEMA
AND c.TABLE_NAME = pk.TABLE_NAME
AND c.COLUMN_NAME = pk.COLUMN_NAME
--WHERE c.TABLE_SCHEMA = @schema AND c.TABLE_NAME = @table
ORDER BY c.TABLE_SCHEMA,c.TABLE_NAME, c.ORDINAL_POSITION
This is working with select @@version as version
reporting Microsoft SQL Azure (RTM) - 12.0.2000.8
Could you identify a query that would pick computed column property from INFORMATION_SCHEMA.COLUMNS with your version? If not, then we have to at least get a query that won't crash.
I ran this query directly in SSMS and it runs fine.
Weird. Can this be a caching problem of some kind? I expect you didn't have VS open during the upgrade?
It was the cached .schema file. I had to delete it and allow it to be regenerated for the update to work. Thanks.
Describe the bug After upgrading from v1.1.91 to 1.1.92 I get the following build error:
The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: The data contract type 'FSharp.Data.Sql.Schema.Column' cannot be deserialized because the required data member 'IsComputed@' was not found.
To Reproduce Steps to reproduce the behavior:
Expected behavior Should build.
Desktop (please complete the following information):
Additional context Reverting to v1.1.91 fixes the problem. Database is SQL Server 2017.