BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

View content of stored procedure

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Gilby
Guest





PostPosted: Thu Aug 21, 2003 8:03 am    Post subject: View content of stored procedure Reply with 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.

Best regards,

Gilby


Back to top
Jeremy Collins
Guest





PostPosted: Thu Aug 21, 2003 9:04 am    Post subject: Re: View content of stored procedure Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.