Update model (edmx) with system tables (SYS.xxx) - Sybase

送分小仙女□ 提交于 2020-01-07 02:23:30

问题


When selecting 'update model from database' none of the system tables (SYS. schema) is available from the list of tables.

How may I add a system table to my EF model.

Sybase (ASA12) is the database platform which I am using.


回答1:


As a workaround I created a view on the system table. It is then available and may be updated automated by the edmx generator




回答2:


I created a script that recreates all the catalog views, i.e. sys.*, as views in a user schema:

Note: This is T-SQL, and SQL Server object names, but I'm sure you can adapt the concept to Sybase.

SELECT
    'CREATE VIEW ' + 'dpc.' + name + ' AS SELECT * FROM ' + 'sys.' + name + char(13) + char(10) + ' GO' + char(13) + char(10)
FROM 
    sys.all_objects 
WHERE
    type = 'v' 
    and is_ms_shipped = 1
    and schema_name(schema_id) = 'sys'
ORDER BY 
    name

Then I ran the script output by the above query, which copied each sys.x view to a new dpc.x view, and added all the dpc.* views to my EDMX model.



来源:https://stackoverflow.com/questions/8064568/update-model-edmx-with-system-tables-sys-xxx-sybase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!