SQL Server: should I use information_schema tables over sys tables?

后端 未结 4 729
半阙折子戏
半阙折子戏 2020-11-27 18:17

In SQL Server there is two schemas for metadata:

  • INFORMATION_SCHEMA
  • SYS

I have heard that INFORMATION_SCHEMA tables are

4条回答
  •  误落风尘
    2020-11-27 18:54

    INFORMATION_SCHEMA is more suitable for external code that may need to interface with a variety of databases. Once you start programming in the database, portability kind of goes out the window. If you are writing stored procedures, that tells me you have committed to a particular database platform (for better or for worse). If you have committed to SQL Server, then by all means, use the sys views.

提交回复
热议问题