Showing posts with label programmatically. Show all posts
Showing posts with label programmatically. Show all posts

Wednesday, March 21, 2012

Files associated with a DB

Hi all
Is there any way to find the files/filenames associated with the SQL server instance ?. Is there any way to find it programmatically ? Does Microsoft provide any API for that ?

Thanks in Adcance,
mani3727

Maybe you can use WMI.

See what you can list installed software

In another example you can List Specific Files Included in the Indexing Service

|||

Are you talking about binary files or database files?

If you are using SQL Server 2005 you can use the following code to get all databases related to the instance:

Code Snippet

SELECT * FROM sys.master_files

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

|||Hi Wesley

Thanks for the reply.I want to know all the files associated with a specific SQL server instance.Could you tell me how it can be done programmaically ?

Thanks,
mani3727

Files associated with a DB

Hi all
Is there any way to find the files/filenames associated with the SQL server instance ?. Is there any way to find it programmatically ? Does Microsoft provide any API for that ?

Thanks in Adcance,
mani3727

Maybe you can use WMI.

See what you can list installed software

In another example you can List Specific Files Included in the Indexing Service

|||

Are you talking about binary files or database files?

If you are using SQL Server 2005 you can use the following code to get all databases related to the instance:

Code Snippet

SELECT * FROM sys.master_files

WesleyB

Visit my SQL Server weblog @. http://dis4ea.blogspot.com

|||Hi Wesley

Thanks for the reply.I want to know all the files associated with a specific SQL server instance.Could you tell me how it can be done programmaically ?

Thanks,
mani3727

filename in Subscription

Hello,

I have a question regarding the report file which is included in an email, when a subscription is created:

Is it possible to programmatically add something to the name of the created file of the subscription? I want to have one parameter of the report, which is a date, added at the end of the filename to let the clients distinguish between different report files.

Thank you in advance.

Sandra Geisler

The way I'd reslove this situation is by using data-driven subscription where in step 3 you put a query such as

SELECT FN=CAST('Your file name-' + CONVERT(char(20),GETDATE(),105) AS CHAR(20));

and on step 4; for filename you pick get the value from database for FILENAME and select FN based on above query.

Thanks

filename in Subscription

Hello,

I have a question regarding the report file which is included in an email, when a subscription is created:

Is it possible to programmatically add something to the name of the created file of the subscription? I want to have one parameter of the report, which is a date, added at the end of the filename to let the clients distinguish between different report files.

Thank you in advance.

Sandra Geisler

The way I'd reslove this situation is by using data-driven subscription where in step 3 you put a query such as

SELECT FN=CAST('Your file name-' + CONVERT(char(20),GETDATE(),105) AS CHAR(20));

and on step 4; for filename you pick get the value from database for FILENAME and select FN based on above query.

Thanks

sql

Friday, February 24, 2012

File Operations

I need to know, how to rename a file, how to delete a file. how to create a file, all programmatically in Vista.

Thanks in advance,

Frank

If your question is specific to SSIS, you can use the File System Task. If this is a general Vista question, you might want to try another forum.