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.
| 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 thisissue. Of course I'll keep looking.Books online is not helpful at all, in the key work search typeAPIsthere is a sub heading Win32 but the info here is useless, infactit really should be removed.I am using NT4 sp6 with SQL-Server 7.0Thanks in advance for your helpEoin" |
|
|
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. |
 |
|
|
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 @@servernameDamian |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-02-05 : 18:09:58
|
| Or the undocumented:exec master..xp_getnetnameAnd I got this from..............wait for it:The Guru's Guide to Transact-SQLAhhh, kickbacks! |
 |
|
|
|
|
|