 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Gilby Guest
|
Posted: Thu Aug 21, 2003 8:03 am Post subject: View content of stored procedure |
|
|
Hi out there,
I have AdoConnection, AdoDataset and AdoStoredprocedure on a datamodule.
I load a stored procedure of the DB in the AdoStoredprocedure component.
That works fine but is there a method to view the contents of a stored
procedure on the screen, fi. a memo field.
Best regards,
Gilby
|
|
| Back to top |
|
 |
Jeremy Collins Guest
|
Posted: Thu Aug 21, 2003 9:04 am Post subject: Re: View content of stored procedure |
|
|
Gilby wrote:
| Quote: | Hi out there,
I have AdoConnection, AdoDataset and AdoStoredprocedure on a datamodule.
I load a stored procedure of the DB in the AdoStoredprocedure component.
That works fine but is there a method to view the contents of a stored
procedure on the screen, fi. a memo field.
|
I'd do it with SQL DMO, but there are probably other ways:
uses SQLDMO_TLB;
:
var
svr : SQLServer;
db : Database;
sp : StoredProcedure;
begin
svr := CoSQLServer.Create;
//next line connects to LOCAL sever with trusted connection
svr.Connect('', '', '');
db := svr.Databases.Item('DB_Name', '');
sp := db.StoredProcedures.Item('sp_foo', EmptyParam);
Memo1.Text := sp.Text;
end;
HTH
--
jc
Remove the -not from email
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|