0% found this document useful (0 votes)
24 views2 pages

Chapter9 Examples

The document provides a series of SQL query examples for interacting with a database named 'sample'. It includes queries to select object IDs, join tables, and configure database settings. Each example demonstrates different SQL functionalities related to database objects and columns.

Uploaded by

riyasathsafran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views2 pages

Chapter9 Examples

The document provides a series of SQL query examples for interacting with a database named 'sample'. It includes queries to select object IDs, join tables, and configure database settings. Each example demonstrates different SQL functionalities related to database objects and columns.

Uploaded by

riyasathsafran
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Example 9.

1
USE sample;
SELECT object_id, principal_id, type
FROM sys.objects
WHERE name = 'employee';

Example 9.2
USE sample;
SELECT sys.objects.name
FROM sys.objects INNER JOIN sys.columns
ON sys.objects.object_id = sys.columns.object_id
WHERE sys.objects.type = 'U'
AND sys.columns.name = 'project_no';

Example 9.3
SELECT sys.database_principals.name
FROM sys.database_principals INNER JOIN sys.objects
ON sys.database_principals.principal_id = sys.objects.schema_id
WHERE sys.objects.name = 'employee'
AND sys.objects.type = 'U';

Example 9.4
USE sample;
SELECT t.table_name
FROM information_schema.tables t INNER JOIN
information_schema.columns c
ON t.table_name = c.table_name
AND c.column_name = 'project_no';

Example 9.5
USE sample;
EXEC sp_configure 'show advanced options' , 1;
RECONFIGURE WITH OVERRIDE;
EXEC sp_configure 'fill factor', 100;
RECONFIGURE WITH OVERRIDE;

Example 9.6
USE sample;
SELECT object_id
FROM sys.objects
WHERE name = 'employee';
SELECT object_id('employee');

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy