Skip to main content

Questions tagged [stored-procedures]

Callable code installed on a database manager, exposing an API through which it can be invoked. Normally written in the native query language, some DBMS platforms support other languages as well.

Filter by
Sorted by
Tagged with
4 votes
3 answers
1k views

Is it better to add conditional logic to a heavily used stored procedure or create a separate one for a new use case?

We have a core stored procedure that's a critical part of our system and gets called thousands of times every hour to handle important operations. Now, there's a new application being introduced that ...
lifeisajourney's user avatar
0 votes
0 answers
111 views

On Sybase ASE 16, why is a simple query using a prepared statement 37 % slower than an equivalent stored procedure?

I am using Sybase Adaptive Server Enterprise (ASE) 16. I am using jConnect 4 in version 7.07. I have a stored procedure that contains a rather simple query, equivalent to this one (I have changed the ...
Harold L. Brown's user avatar
0 votes
2 answers
80 views

Can I get data from an estimated Execution Plan in my C# code?

After years of growth, some reports now take minutes to extract from our database, and in some cases fail due to excess resource consumption. This depends on the parameters that our customers choose ...
Henrik R Clausen's user avatar
3 votes
2 answers
483 views

Tracking stored procedure performance metrics

I’m trying to track impacts of stored procedure executions - CPU time, execution duration, logical/physical reads, memory grants, etc. - in order to visualize them. In particular, I'm looking for ...
Kaaniche Emna's user avatar
0 votes
1 answer
99 views

Could not find stored procedure 'sp_BlitzLock' [closed]

I'm running into an issue while trying to execute the stored procedure sp_BlitzLock in SQL Server 2022 Developer Edition. Here's the exact error message I'm getting: Msg 2812, Level 16, State 62, Line ...
Andy's user avatar
  • 111
2 votes
2 answers
145 views

sp_describe_first_result_set with json columns

I'm working on an analyzer that accepts a SQL Server query and returns information about all columns in the first result set - until for clause is used, this is pretty straightforward with ...
Matěj Štágl's user avatar
2 votes
1 answer
159 views

On a linked server I can execute a stored procedure A but Can Not execute stored procedure B

On a linked server I can execute a stored procedure A but Can Not execute stored procedure B I have a db server DBServer and a linked server LinkedServer. From the DBServer I can execute successfully ...
SqlStar's user avatar
  • 23
5 votes
1 answer
281 views

OUTPUT as default parameter value for stored procedure?

I've encountered peculiar behaviour by SQL Server, and I wonder why does it behave like this. Consider following CREATE PROCEDURE script: CREATE PROCEDURE dbo.myProc @parameter INT = OUTPUT AS ...
Yano_of_Queenscastle's user avatar
3 votes
1 answer
80 views

MYSQL and random performance of store procedure

I run this SP at night, when there’s almost no activity. The SP performs an accumulative calculation of machine usage from a laundromat—an artisanal BI query. It writes the result to a table. On most ...
chronotrigger's user avatar
3 votes
2 answers
578 views

Deploy encrypted stored procedures that cannot be decrypted

There are many ways you can see an encrypted procedure. Example of an encrypted procedure in SSMS: There is this very good question: How to view an encrypted view or stored procedure where you can ...
Marcello Miorelli's user avatar
0 votes
0 answers
43 views

SQL Server Agent job to verify logshipping on multiple databases

I'm trying to come up with a SQL script that will verify log shipping on about 100 databases in an instance. I need to be alerted if log shipping is failing, but I do not want 100 plus emails coming ...
user323060's user avatar
3 votes
3 answers
242 views

Stored procedure to get max startDate with optional AgentId

I have this stored procedure that I want the max startDate base on AgentId or without the AgentId. The way I am doing this is using a if else and wanted to see if there was a better way to do this? ...
Jefferson's user avatar
  • 111
6 votes
1 answer
918 views

When creating stored procedure, are the comments before the definition always preserved?

When I wrote some comments before the CREATE PROCEDURE command, those comments seem to be preserved as part of procedure definition. For example, when I create procedure like this /*Comment header*/ ...
Yano_of_Queenscastle's user avatar
0 votes
1 answer
109 views

Why can't I create a new stored procedure?

I need to copy existing stored procedures from one SQL-Server database to another one. In the first SQL-Server database (the source), when clicking on "Stored Procedures", this is what I see:...
Dominique's user avatar
  • 609
0 votes
1 answer
85 views

How to tune the complex Oracle stored procedure?

I have an Oracle stored procedure that takes a bunch of parameters and heavily does the left outer join like this: create or replace PROCEDURE "SOME_PROCEDURE" ( cRECORDSET OUT ...
Pranithan T.'s user avatar

15 30 50 per page
1
2 3 4 5
113