Retrieve SQL Server Stored Procedure Sql using Delphi - sql-server

I am trying to display T-SQL of stored procedure in my delphi application.
I have no idea whether it is possible using ADO or Firedac components. I am able to get list of stored procedures using firedac but not sql.
Need to be pointed to the right direction so that i can add this feature in my application.

Related

Call SQL Server stored procedures from SAP HANA

We are using a SAP HANA environment to connect to various databases (SQL Server, Oracle, Teradata). Now one of our sources (the SQL server one) contains a lot of stored procedures to calculate transient values. We would need to have these values as well in SAP HANA and are thinking about the best way:
Ideally, HANA can call the stored procedure of SQL and get back the result data, but I could not find information about this. Is this possible?
Another option is to write a little program (Java) in HANA that can call the stored procedure on SQL Server and then give back the data (either directly, or by storing is some temporary table on SQL side and then read in with HANA).
Other ideas?
Does anybody have suggestions on this?
As long as you can run SQL queries you could see if using OPENROWSET would work for you.
Using OPENROWSET with stored procedure as source you can then consume data as it would SQL rowset.
SELECT * FROM
OPENROWSET ('SQLOLEDB','Server=(local);TRUSTED_CONNECTION=YES;','exec master.dbo.sp_who')
AS tbl
Using SAP HANA Smart Data Integration (SDI) remote sources, you are able to access/federate to remote tables, views and stored procedures.
First create the remote source, then wrap the Stored Procedure in a Virtual Procedure, these can be created via the Web IDE or SQL. You would use the CREATE VIRTUAL PROCEDURE statement as described below.
Create Virtual Procedure with Web IDE
CREATE VIRTUAL PROCEDURE via SQL

Can Sql Server Return a Result Set to a Calling Application from a Stored Procedure with an Output Cursor?

I'm new to a team where we are converting a transactional Oracle DB to SQL Server. There are a lot of DB objects so an automated tool was used for the initial conversion and we must fix the remaining issues for our application.
One issue is that Oracle returns a cursor to the calling app from a stored procedure. We don't want to change the code, so the app must support the same functionality with SQL Server. Is this possible? I know SQL Server supports returning an output cursor from a stored procedure within another stored procedure. I don't know whether that cursor can be returned to a calling application and haven't found any examples so far.
A result set is returned from SQL Server through the dbconnection object. I've never compared the differences between the Oracle cursor and the SQL Server result set, but they are essentially the same, a set of data. I have used both in the past, but have no details for you.
I'm sure it makes a difference what front-end you are using, but you are on the right track.

Add on to SP in SSRS

Was wondering if anyone knew if it was possible to add on to a stored procedure using SSRS? I have a stored procedure in SQL Server that is manipulating data to create a great base. I then want to use that stored procedure and transform it some more inside SSRS depending on the reports I am doing.
Is this even possible?
Thanks,

SSRS 2008 R2, VS 2008, User Defined Table Types

I have a stored proc that I use to create some customized lists. I'm trying to create it as an SSRS report, but it's running into a sticking point where it chokes trying to deal with the User Defined Table Type parameters.
Am I just screwed?
As an aside, it does work when you call it with a sql exec statement.
Thanks,
AFAIK there is currently no "native" way to pass table-valued parameters from SSRS to a stored procedure. However it is still can be done in a sort of a hackish way:Using Table-Valued Parameters With SQL Server Reporting Services or Passing Multivalued Parameters in SQL Server 2008.

Classic ADO and Table-Valued Parameters in Stored Procedure

Is there some way to pass a table-valued parameter to a stored procedure in SQL Server via classic ADO?
Classic ADO is COM and OLE and the SQL Native Client supports Table Valued Parameters over OleDB, see Table-Valued Parameters (OLE DB). One would have to get its hand dirty and code straight to the OleDB interfaces (in C/C++).
Also TVPs are only in SQL 2008, so you won't be able to use them in SQL 2005.
BTW, for completness here is the Table Valued Parameters (ODBC) reference, for the ODBC nostalgics out there...
I thought they were new in 2008?
Anyway, I think the answer is going to be no, I doubt there's a DataTypeEnum value that you'll be able to bend to your needs.
So if I may suggest an alternative, I guess what you want to do is pass some sort of structured data into the stored procedure. I have done this before in ADO using XML:
define the parameter in the stored proc as type xml
define the parameter in ADO as type adLongVarChar with a length = len(xml) + 1
I know it's not what you wanted, but it's a method that works

Resources