user385665
user385665

Reputation: 1

Open table froma service

Can I open the ads_err table from a windows service?

Upvotes: 0

Views: 103

Answers (1)

Mark Wilkins
Mark Wilkins

Reputation: 41252

Yes. You should be able to open it just like any other table. You don't mention what development environment (client type) you are using, so I am not able to give more details specific to your situation.

After you have a connection to the server, all that is necessary is to supply the full path to the error log. If you don't want to hard code the path (probably desirable to avoid that), you can retrieve it with sp_mgGetConfigInfo(). The Error Log Path field is the one you would want.

You could also read the error log with SQL by including the path. For example, select * from [c:\ads_err].

Upvotes: 2

Related Questions