Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 API calls from TSQL

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-02-05 : 09:11:14
Eoin writes "Is it possible to use any API call from a Stored Proc.
For example can you use

"GetComputerName"

I found a ref to winInet for ftp on your site but after a lengthy search over the net I have found no direct ref to this
issue. Of course I'll keep looking.

Books online is not helpful at all, in the key work search type
APIs
there is a sub heading Win32 but the info here is useless, infact
it really should be removed.

I am using NT4 sp6 with SQL-Server 7.0

Thanks in advance for your help

Eoin"

andre
Constraint Violating Yak Guru

259 Posts

Posted - 2002-02-05 : 10:10:34
I don't believe T-SQL was designed to call API functions. You're better off calling doing this in a client program like VB or C++ and passing the computer name as a parameter to the stored procedure.

If that's not possible in your case, you could create a COM DLL to call the API function and call COM object in the stored procedure.

Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-02-05 : 16:56:09
DO you mean you want to do this ?


select @@servername


Damian
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-02-05 : 18:09:58
Or the undocumented:

exec master..xp_getnetname

And I got this from..............wait for it:

The Guru's Guide to Transact-SQL

Ahhh, kickbacks!

Go to Top of Page
   

- Advertisement -