(remote linked server)
(远程连接服务器)
select * from [linkedserver].master.sys.sysdatabases
columns returned:
name dbid sid mode status status2 crdate reserved category cmptlevel filename version
(local)
(本地)
select * from master.sys.sysdatabases
columns returned:
name database_id source_database_id owner_sid create_date compatibility_level collation_name user_access user_access_desc is_read_only is_auto_close_on is_auto_shrink_on state state_desc is_in_standby is_cleanly_shutdown is_supplemental_logging_enabled snapshot_isolation_state snapshot_isolation_state_desc is_read_committed_snapshot_on recovery_model recovery_model_desc page_verify_option page_verify_option_desc is_auto_create_stats_on is_auto_update_stats_on is_auto_update_stats_async_on is_ansi_null_default_on is_ansi_nulls_on is_ansi_padding_on is_ansi_warnings_on is_arithabort_on is_concat_null_yields_null_on is_numeric_roundabort_on is_quoted_identifier_on is_recursive_triggers_on is_cursor_close_on_commit_on is_local_cursor_default is_fulltext_enabled is_trustworthy_on is_db_chaining_on is_parameterization_forced is_master_key_encrypted_by_server is_published is_subscribed is_merge_published is_distributor is_sync_with_backup service_broker_guid is_broker_enabled log_reuse_wait log_reuse_wait_desc is_date_correlation_on is_cdc_enabled is_encrypted is_honor_broker_priority_on
what is going on?
什么是怎么回事?
1 个解决方案
#1
4
Are you sure that second one wasn't
你确定第二个不是吗
SELECT * FROM master.sys.databases
instead of
而不是
SELECT * FROM master.sys.sysdatabases?
Both sys.databases
and sys.sysdatabases
exist and return database information. The latter is a SQL 2000 view that is retained only for compatibility. The former is the preferred source of information for SQL 2008 and includes a lot more columns.
这两个系统。数据库和系统。sysdatabase存在并返回数据库信息。后者是SQL 2000视图,仅为兼容性而保留。前者是SQL 2008首选的信息源,包含更多的列。
See: http://msdn.microsoft.com/en-us/library/ms179900.aspx and http://msdn.microsoft.com/en-us/library/ms178534.aspx
见:http://msdn.microsoft.com/en-us/library/ms179900.aspx和http://msdn.microsoft.com/en-us/library/ms178534.aspx
#1
4
Are you sure that second one wasn't
你确定第二个不是吗
SELECT * FROM master.sys.databases
instead of
而不是
SELECT * FROM master.sys.sysdatabases?
Both sys.databases
and sys.sysdatabases
exist and return database information. The latter is a SQL 2000 view that is retained only for compatibility. The former is the preferred source of information for SQL 2008 and includes a lot more columns.
这两个系统。数据库和系统。sysdatabase存在并返回数据库信息。后者是SQL 2000视图,仅为兼容性而保留。前者是SQL 2008首选的信息源,包含更多的列。
See: http://msdn.microsoft.com/en-us/library/ms179900.aspx and http://msdn.microsoft.com/en-us/library/ms178534.aspx
见:http://msdn.microsoft.com/en-us/library/ms179900.aspx和http://msdn.microsoft.com/en-us/library/ms178534.aspx