Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Listing files on the RDS DB instance

Focus mode
Listing files on the RDS DB instance - Amazon Relational Database Service

To list the files available on the DB instance, use both a stored procedure and a function. First, run the following stored procedure to gather file details from the files in D:\S3\.

exec msdb.dbo.rds_gather_file_details;

The stored procedure returns the ID of the task. Like other tasks, this stored procedure runs asynchronously. As soon as the status of the task is SUCCESS, you can use the task ID in the rds_fn_list_file_details function to list the existing files and directories in D:\S3\, as shown following.

SELECT * FROM msdb.dbo.rds_fn_list_file_details(TASK_ID);

The rds_fn_list_file_details function returns a table with the following columns.

Output parameter Description
filepath Absolute path of the file (for example, D:\S3\mydata.csv)
size_in_bytes File size (in bytes)
last_modified_utc Last modification date and time in UTC format
is_directory Option that indicates whether the item is a directory (true/false)
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.