We noticed in a SQL Server Profiler trace that this proc is being called:
sp_procedure_params_managed
Each call has 350+ reads in the trace!
We are using Microsoft.Practices.EnterpriseLibrary.Data in an ASP.NET front end.
How can we eliminate these stored procedure calls? We are not explicitly calling it in code.
I'm running Sql Server 2005 and Enterprise library 3.1.0.0.
sp_procedure_params_managed is used determine the stored procedure parameters. I guess the Microsoft.Practices.EnterpriseLibrary.Data uses it to determine what the parameters are for the stored procedure call. It will probably cache the results to prevent extra overhead.
Related
I'm calling a java stored procedure from oracle. After i called execute() method it is never coming out of SP execution and locking the tables. But after i stop the server, the records are getting inserted into tables. Any one face similar issue?
Got the solution. Before calling the SP, i'm doing many insert and update statements and they are locking 5 to 6 tables. I committed the transaction before calling the SP and after that my SP is running fine.
I need to quickly execute stored procedure which updates table with data from different data source in SQL Server. Is it possible to do it with EF7, I have tried FromSql, but this seems to only works with the mapped entities.
It doesn't need to return anything, just execute.
Is there any other method than using SQLConnection, or SQL job running every 10 minutes on the server?
I think you can use DbContext.Database and ExecuteSqlCommand to execute your stored procedure.
_db.Database.ExecuteSqlCommand("EXEC mySp");
A while back I set up BizTalk to pick up a file via FTP and drop it into a network directory. It's all passsthru so I didn't use an orchestration.
Now I've been asked to execute a stored procedure once the file is picked up. The procedure contains no parameters and I do not need the contents of the file.
It seems like such a simple request but I can't figure it out. Is there any way to do this without over complicating things?
This can be accomplished through the use of either the WCF-SQL adapter or the WCF_Custom adapter with a SQL binding. You can do this using messaging only with just a SendPort with a filter/map on it thus no orchestration needed.
For the SOAP action header use TypedProcedure/dbo/name_of_your_stored_procedure and in the messages tab you can specify the paramters to the stored procuders as well as add a payload in the following manner:
<name_of_your_stored_procedure xmlns="http://schemas.microsoft.com/Sql/2008/05/TypedProcedures/dbo">
<parameter1>XXXX</parameter1>
<xml_parameter>
<bts-msg-body xmlns="http://www.microsoft.com/schemas/bts2007" encoding="string"/>
</xml_parameter>
</name_of_your_stored_procedure>
In the above case xml_parameter will have the contents of the message payload passed to it.
The stored procedure should look something like :
CREATE PROCEDURE [dbo].[name_of_your_stored_procedure]
#parameter1 int,
#xml_parameter nvarchar(max)
AS
BEGIN
-- your code goes here
END
More details can be found here
Regards Hasse
This MSDN page describes the process and has this to say: "You must create a BizTalk orchestration to use BizTalk Server for performing an operation on SQL Server."
However if you're really desperate not to use an orchestration I believe you have the option of setting the operation context property in a custom pipeline component. Then you can initialise the message in a map on a port. In theory this should work but I can't guarantee it.
In BizTalk 2010, I am using the SQL Adapter for polling a table to create a message and to initiate the orchestration process.
I have modified the stored procedure without changing the schema. But i have started getting errors after modifying it and SQL polling is not happening. So i have restarted the Host instance and it started working.
So here my question is Is restarting host instance mandatory after changing the stored procedures?
Error is "The adapter "WCF-Custom" raised an error message. Details "Microsoft.ServiceModel.Channels.Common.AdapterException: The ResultSet returned as part of the Typed Stored Procedure or Typed Polling invocation did not match the metadata available. If this Stored Procedure or Polling Statement can return a variable number of result sets, consider using the un-typed Stored Procedure or un-typed Polling operation instead."
Can anyone please suggest what could be the root cause?
Thanks,
Sasikumar.S
Yes, you will need to restart the Host Instance of the Host configured for your WCF-SQL Handler.
Under the hood, the first time a particular Stored Proc is called, the WCF-SQL adapter first executes it with the SET FMTONLY ON; flag. This causes Sql Server to return just the datatypes of the expected data, but not execute the sproc itself. The adapter caches these datatypes for the lifetime of the host process.
If you change the data returned by the stored procedure, the next time it executes, it will be out of sync, and unable to coerce into the expected type. Hence, the need to restart the Host Instance(s).
TL;DR - If you change a stored procedure, you need to restart the WCF-SQL Host Instance.
I have an issue in calling oracle stored procedures(oracle xmltype as input parameter) in ASP.NET 2.0 using ODP.NET (Oracle.DataAccess assembly version 9.2.0.700).the web page freezes during processing on executenonquery.
Executenonquery is not firing any command on database. i have implemented some tracing logic and found that no request is made to database procedure and web page is freezes.
I just had an issue calling a stored procedure using inputoutput parameters that was freezing on ExecuteNonQuery. My code looked correct. I had Oracle SQL Developer opened that had some non commited transactions. I disconnected from the database. The dba killed all of my processes. I ran the same code again and it worked perfectly.