The following example returns information about the tables that belong to the Person schema in the AdventureWorks2019 database. Returning information about the tables in a specified schema The following example returns a list of objects that can be queries in the current environment. Returning a list of objects that can be queried in the current environment For more information, see Metadata Visibility Configuration. The visibility of the metadata in catalog views is limited to securables that a user either owns or on which the user has been granted some permission. The results returned are ordered by TABLE_TYPE, TABLE_QUALIFIER, TABLE_OWNER, and TABLE_NAME. Sp_tables is equivalent to SQLTables in ODBC. If the server attribute ACCESSIBLE_TABLES is Y in the result set for sp_server_info, only tables that can be accessed by the current user are returned. This result set includes not only tables and views, but also synonyms and aliases for gateways to DBMS products that support those types. Privilege information about the current user's read or write access to a specific table is not always checked. SQL Server does not return a value for this column.įor maximum interoperability, the gateway client should assume only SQL-92-standard SQL pattern matching (the % and _ wildcard characters). In SQL Server, this column represents the name of the database user who created the table. In SQL Server, this column represents the database name. Valid values are 0 (pattern matching is off) and 1 (pattern matching is on). If SET QUOTED_IDENTIFIER is ON, each single quotation mark must be doubled and the whole parameter must be enclosed in single quotation marks.ĭetermines whether the underscore ( _ ), percent ( % ), and bracket ( ) characters are interpreted as wildcard characters. Single quotation marks must enclose each table type, and double quotation marks must enclose the whole parameter. type is varchar(100), with a default of NULL. These include TABLE, SYSTEMTABLE, and VIEW. Is a list of values, separated by commas, that gives information about all tables of the table types that are specified. In some products, it represents the server name of the table's database environment. Various DBMS products support three-part naming for tables ( qualifier. qualifier is sysname, with a default of NULL. If one exists, the columns of that table are returned. If the owner is not specified and the current user does not own a table with the specified name, this procedure looks for a table with the specified name owned by the database owner. In SQL Server, if the current user owns a table with the specified name, the columns of that table are returned. If the owner is not specified, the default table visibility rules of the underlying DBMS apply. owner is nvarchar(384), with a default of NULL. Is the table owner of the table used to return catalog information. name is nvarchar(384), with a default of NULL. Is the table used to return catalog information. Transact-SQL Syntax Conventions Syntax - Syntax for SQL Server, Azure SQL Database, Azure Synapse Analytics, Parallel Data Warehouse To determine the name of the base object of a synonym, query the sys.synonyms catalog view.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |