0

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.

Kman
  • 4,809
  • 7
  • 38
  • 62
  • I'm not posting this as an answer because it is only my guess - when working with SQL server EF designer / provider always filters `sys` features. This can be the same with Sybase. You can try to map them manually (= no designer support) when you open EDMX as XML. – Ladislav Mrnka Nov 09 '11 at 12:49
  • Then I would have to "redo" the editing every time I generate/update the model. – Kman Nov 10 '11 at 19:43
  • You will not use generate/update model once you edit EDMX - you will maintain it manually. – Ladislav Mrnka Nov 11 '11 at 09:06
  • Yes, that would probably solve my issue, but as the model is very much "alive" that is not an option. Thanks :) – Kman Nov 11 '11 at 20:07

2 Answers2

1

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.

ProfK
  • 49,207
  • 121
  • 399
  • 775
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

Kman
  • 4,809
  • 7
  • 38
  • 62