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.

-1 votes
1 answer
33 views

SQL Server Management Studio "Key cannot be null" error when giving a specific user permissions on Stored Procedures

I'm attempting to give a specific user execute permissions on a Stored Procedure. When I attempt to do so, I get an error: Key cannot be null. Parameter name: key (System)" When I attempt to ...
LYNITS's user avatar
  • 1
1 vote
1 answer
73 views

Trouble with slow stored procedure performance on 35M rows with CTE/Temp table

We recently went through a new feature release to our app that added about 25 new columns to a large table (~35 million rows), and now we're having some major query performance issues. I assume that ...
David Allen's user avatar
0 votes
1 answer
42 views

Conditional update

I would like to create a conditional update on an audit table, such that if the update on the main table succeeds, then the update on the audit table is performed. Right now I have this CREATE DEFINER=...
tcelvis's user avatar
0 votes
0 answers
49 views

Calling stored procedures multiple times in the same transaction

I have a PLSQL Package with several stored procedures inside. This package is used to create specific reports. I call the procedures like that : package.init(parameter1 => 'Blablabla'); package....
Luke's user avatar
  • 1
1 vote
0 answers
48 views

MySQL InnoDB Stored Procedure locks table?

MySQL 8.0 InnoDB I have some sql statement like SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; START TRANSACTION; INSERT INTO MyTable SELECT Name FROM MyTable ...
onets's user avatar
  • 11
3 votes
2 answers
277 views

How to create stored procedure in remote server using linked server

I tried to create an stored procedure in a remote server using this way EXECUTE (N'USE [master]; EXEC sp_executesql N'+ @sqlCommand) AT [LinkedServer] However I received this error Msg 111, Level 15,...
lego con tsijiari's user avatar
-1 votes
1 answer
40 views

SQL code to calculate amount based in parent child relationship

account code amt abc x 123 abc y 456 efg x 321 efg y 654 sdf x 123 sdf y 345 sdf z 234 x is the parent code and y and z are the child code, if same account is present for both parent and ...
Shweta Srivastava's user avatar
-2 votes
1 answer
84 views

Data Is Null. The Method or Property cannot be call on null values. Exception

In my application ultiple users request the API and in the API I am calling the stored Procedure via Entity Framework but some times getting exception Data Is Null. The Method or Property cannot be ...
Diya Rawat's user avatar
0 votes
0 answers
25 views

Configuring Informix to access data on another server

I have inherited an Informix installation that contains a large amount of business logic in the form of procedures. The company also uses SQL Server, MySQL and Postgres for various roles. We're very ...
Hut8's user avatar
  • 101
0 votes
0 answers
10 views

KILL QUERY Flooding in General Query log for MySQL 8.0.25

Problem : We have two MySQL servers in master master replication. We can see many KILL QUERY statements in MySQL general log specific to stored procedures as below : 2024-03-20T21:54:45.056981+05:30 ...
Sana Ansari's user avatar
0 votes
1 answer
46 views

Need to create a duplicate table in a separate schema automatically whenever a new table is being created

Whenever a new table is being created in Schema 'A', I need the table to be duplicated in the Schema 'B'. This should happen automatically. I have searched for trigger concept but it wont work on DDL ...
Edvin Guromin's user avatar
1 vote
0 answers
20 views

procedure that takes the distinct tables with incremented (int) key and sub the int back for the original value

I'm working on developing a set of stored procedures in PostgreSQL to abstract common operations I'm seeking advice on implementing a pattern for substituting values for INTS in child tables. Please ...
RandomNumberFun's user avatar
2 votes
1 answer
305 views

Catching exceptions and rolling back transactions

I am just trying to see if I understand this correctly: By default, any error occurring in a PL/pgSQL function aborts execution of the function and the surrounding transaction I have a procedure ...
Lugoom485's user avatar
1 vote
2 answers
116 views

Prevent users from sending an email attachment in sql server

In SQL Server, I want to restrict all users (except a few specific users) to send an email with attachment. For example, someone import data into excel file and send it via mail using the ...
Farid Zahidov's user avatar
0 votes
1 answer
44 views

sql bigger parameter then specyfied - no error - just taking substring? why?

I have some sql procedure (MSSQL 2019) if relevant Create PROCEDURE [dbo].[test] @tmp varchar(32) AS print @tmp why when i do EXEC @return_value = [dbo].[test] @tmp = N'...
Dorian's user avatar
  • 103

15 30 50 per page
1
2 3 4 5
113