It returns a list of objects that can appears in the FORM cluse. It unable to returns the synonym objects. To view the details related to synonym just go to the sys.synonyms system catalog views.
The syntax of the sp_tables is mentioned bellow.
sp_tables [ [ @table_name= ] 'name' ]
[ , [ @table_owner= ] 'owner' ]
[ , [ @table_qualifier= ] 'qualifier' ]
[ , [ @table_type= ] "type" ]
[ , [@fUsePattern = ] 'fUsePattern'];
Now we are discussing about each of the parameters
1. [ @table_name = ]
Table name is used to return the catalog information. Supported nvarchar(384). Default value is NULL. Wildcard character can be used.
2. [ @table_owner = ]
Owner of the table is used to return the catalog information. Supported nvarchar(384). Default is NULL.
3. [ @table_qualifier = ]
It is the name of the table qualifier. In others RDBMS supports qualifier.owner.name. In SQL server it is the database name.
4. [ @table_type] = ]
This can be includes TABLE, SYSTEMTABLE or VIEWS. The Default is NULL. It is the list of values separated by a comma, which gives the information about.
5. [ @fUserPattern = ]
Determines whether the underscore ( _ ), percent ( % ), and bracket ( [ or ] ) characters are interpreted as wildcard characters. Valid values are 0 (pattern matching is off) and 1 (pattern matching is on). fUsePattern is bit, with a default of 1.
Example:
USE my_DB;
GO
EXEC sp_tables
@table_name = '%',
@table_owner = 'student',
@table_qualifier = 'my_DB';
GO
Return Result set:
Columns | Data Type | Descriptions |
TABLE_QUALIFIER | sysname | In SQL Server it contains the Database name. |
TABLE_WONER | sysname | Name of the Database owner who create the table. |
TABLE_NAME | sysname | The name of the Table. |
TABLE_TYPE | Varchar(32) | Table, System Table or Views |
REMARKS | Varchar(254) | No Value returned |
Hope you like it.
Posted by: MR. JOYDEEP DAS
You have lots of great content that is helpful to gain more knowledge.
ReplyDeleteBest wishes.
BA Result 2021 - BA 1st 2nd 3rd Year Exam Result
BA 1st Year Result 2021 | BA 2nd Year Result 2021 | BA 3rd Year Result 2021.
https://saglamproxy.com
ReplyDeletemetin2 proxy
proxy satın al
knight online proxy
mobil proxy satın al
P6Z