SQL Server OpenRowSet on Unknown Table

  • Thread starter Thread starter Pepper Mint
  • Start date Start date
  • Tags Tags
    Server Sql Table
Click For Summary
SUMMARY

The discussion centers on the use of the OPENROWSET function in SQL Server, specifically with the TABLE SQLSRC parameter. The SQLSRC table is identified as a storage location for the source code of stored procedures in Microsoft SQL Server. The provided SQL query retrieves metadata about computed columns and their associated source code from the SQLSRC table. Understanding the structure and purpose of the SQLSRC table is crucial for effectively utilizing OPENROWSET in SQL Server.

PREREQUISITES
  • Familiarity with SQL Server 2019 syntax and functions
  • Understanding of computed columns in SQL Server
  • Knowledge of the OPENROWSET function and its parameters
  • Basic concepts of stored procedures and their storage in SQL Server
NEXT STEPS
  • Research the structure and usage of the SQLSRC table in SQL Server
  • Learn about the implications of using OPENROWSET with different data sources
  • Explore best practices for managing computed columns in SQL Server
  • Investigate the security considerations when accessing stored procedure source code
USEFUL FOR

Database developers, SQL Server administrators, and anyone involved in managing or optimizing stored procedures and computed columns in SQL Server.

Pepper Mint
Messages
91
Reaction score
139
SQL:
SELECT c.object_id AS id,
        convert(smallint, c.column_id) AS number,
       s.colid, s.status,
        convert(varbinary(8000), s.text) AS ctext,
        convert(smallint, 2 + 4 * (s.status & 1)) AS texttype,
        convert(smallint, 0) AS language,     
       s.text
    FROM sys.computed_columns c CROSS APPLY OPENROWSET(TABLE SQLSRC, c.object_id, c.column_id) s

Would someone please help me explain what TABLE SQLSRC in the code means ? I am splitting hairs to just get a glimpse of it but still unable to figure it out.
 
Last edited by a moderator:
Technology news on Phys.org

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 19 ·
Replies
19
Views
10K
  • · Replies 2 ·
Replies
2
Views
475
  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 128 ·
5
Replies
128
Views
35K
  • · Replies 1 ·
Replies
1
Views
10K
  • · Replies 1 ·
Replies
1
Views
4K
  • Sticky
  • · Replies 2 ·
Replies
2
Views
506K