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.

learn more… | top users | synonyms

0
votes
0answers
11 views

How to tell when a stored procedure is scheduled in MySQL [on hold]

We have a stored proc that runs daily but I'm trying to figure out when and how it runs. There's nothing scheduled in cron and when I do a show events nothing comes up. I even checked select * from ...
0
votes
0answers
30 views

How to break down a sql select query into smaller chunks? [on hold]

I'm querying my SQL Server database from C# and the resulting dataset throws a MaxReceivedMessageSize exceeded exception. My MaxReceivedMessageSize size is set to size 40960000, and I'd like to keep ...
2
votes
2answers
37 views

sp_send_dbmail stored procedure send with attachment

I've been tasked with sending a small monthly report to for one of my customers. The report has previously been run manually on the instance, the output copied to a spreadsheet and send to the ...
3
votes
3answers
45 views

How to generate documentation from stored procedures? [on hold]

I'm working with a new set of tables and an increasing list of stored procedures. Is there a way to generate documentation out of the comments on tables and stored procedures, like autodoc or ...
1
vote
3answers
59 views

How to store a query result into a variable? SQL Server 2008

I have two tables and I want to store the result query of my stored procedure into a variable. UserTable: UserID int primary key identity CredentialsID int AccountType nvarchar(15) ModifiedDate date ...
0
votes
1answer
38 views

Using of OPTIMIZE FOR hints in a sql query

as I know, OPTIMIZE FOR hint helps to avoid parameter sniffing. For such a stored procedure: SELECT * FROM Tabele WHERE param=@param1 We have two parameter S1 with high selectivity and s2 with low ...
-5
votes
1answer
29 views

How to execute stored procedure in another procedure in oracle [closed]

Is it possible to execute stored procedure in another stored procedure in oracle both are in same db. And also if any procedure not executed then other procedures to rollback.
1
vote
1answer
79 views

SQL Server Stored procedures run very slowly after a while

We have an ASP.Net application with a report page that runs several stored procedures. We have a problem with a production system where the report runs so slowly that it times out when the user ...
1
vote
0answers
18 views

creating deadlock for distributed database in mysql-(Testing purpose)

I need to create a deadlock for distributed database in MySQL for testing purpose with a simple sql query(without front end), can anyone good with MySQL query help me out in this with sample query. ...
5
votes
1answer
39 views

MySQL overhead of calling a Stored Procedure

Within Java, we access MySQL (v5.5.40) via JDBC -- a prepare statement, setting parameters then calling the stored procedure. It appears that every execute() has the overhead of 4 meta-calls (per ...
0
votes
0answers
6 views

MySQL log shows excessive meta queries on SP calls [duplicate]

We access MySQL via JDBC -- a prepare statement, parameters binding then invoking the actual stored procedure. It appears that every execute() has an associated "overhead" of 4 meta-calls (per MySQL ...
2
votes
1answer
37 views

SQL Server : parsing with XPath Performance

I have a UI that allows a user to select certain data points they want to filter the results by. There are things such as location, department etc. Once they have selected all of the options, I ...
0
votes
1answer
22 views

How can I limit a user to only be able to run procs in a schema, which access another db?

In a SQL Server 2012 SP2 Standard Edition instance I have a user in database A that needs to be able to run stored procedures in schema foo within that database. They shouldn't be able to do anything ...
0
votes
2answers
71 views

Sql Agent Jobs executes too slow

I have posted a question like this before but is seems that I did not explain the whole story clear. So I made this one to explain it in details. Here's the stored procedure USE [xxxx] GO /****** ...
0
votes
1answer
22 views

ORA-01722 Error when running stored procedure

I am trying to run a stored procedure however when I run it with an a valid Number it gives me an ORA-01722 error. I checked to make sure that the columns in the where clause where the parameter is ...
1
vote
2answers
64 views

How to update a multiple rows all at once with a procedure.?

Im trying to do a procedure to update an (for now) empty column recently added. In this new column, i will put the values of the result obtained by a join query. To explain it better, i have this ...
2
votes
1answer
25 views

MySQL stored procedure user privilege

I have a query regarding user permission on a stored procedure. If a user that does not have permissions to create tables in a database, but it does have permissions to create and execute stored ...
0
votes
0answers
52 views

How can I replace the cursor in the below query?

I have this below query which calls a stored procedure that takes only 1 item's attributes at a time. But because of performance problems we are required to remove the cursor. How can I replace the ...
2
votes
1answer
35 views

stored procedures vs inline SQL in a Job step SQL SERVER 2014

I have created a job with two steps. Step 1 deletes 50000 rows from an error table older than 90 days. Step 2 creates and emails a quick report on the number of new records created in the error ...
0
votes
0answers
23 views

IF statement inside stored procedure, seems to cause locks by side effects

We are running a MySQL 5.5. server with READ-COMMITTED transaction level to store and process a large time series dataset. We have a large time-series-table, into which we write batch updates every ...
0
votes
0answers
25 views

Hide Inconsequential Result Sets From Stored Proc

How does one mask resultsets in multi-layered stored proc calls? Due to stored proc reuse, I have an issue where a top level stored procedure calls multiple stored procedures (directly) and in-tern ...
0
votes
1answer
61 views

SQL Server : execute stored procedure from another stored procedure

I have two stored procedures. Proc1 executes a SQL statement and results a data table as a result set. I need to use the datatable in a select SQL that resides in proc2 as a datasource. like, ...
2
votes
1answer
129 views

Stored Procedure with Table Value Parameter

I'm attempting to write a stored procedure that will have two parameters. ComputerName | nvarchar Monitor_Serial | Table-valued parameter (TVP) I'm using a TVP because some computers have an ...
0
votes
1answer
29 views

Call a stored procedure for every select result

I have an stored procedure to delete from a long series of tables. It uses one main ID as parameter. I have to delete a bunch of rows based on a view that show that lot of tables. I want to apply the ...
0
votes
2answers
70 views

Executing sp in ssms much faster than executing in job step

My stored procedure takes 23 secs in ssms but takes 4 minutes when exec via job. Can you please help me in finding out. Below is SP code ALTER procedure [ops].[trailers_sitting_builder_mod] --WITH ...
0
votes
1answer
31 views

SQL Server stored procedure to insert/ update which has date

The source which has date in dd-MMM-yy format , have to convert it yyyy-mm-dd hh:mm:ss:SS and insert/update into the Database using stored procedure.New to stored procedure I am managed to write a ...
0
votes
2answers
20 views

Logging the Execution times of dynamically constructed mysql stored procedures

I have a MySQL Server. The MySQL server contains a huge network data collection. The client API's will connect to the MySQL server and execute some dynamically created stored procedures and delete ...
2
votes
1answer
84 views

How to output more than 4000 characters in sqlcmd

I've made a stored procedure restoredatabase that returns code to restore a database. The output script looks like this: restore database [DB] from disk='F:\FULL1.bak' with norecovery restore ...
6
votes
2answers
295 views

Unexpected Implicit conversion in a procedure

I have a procedure like this (simplified): CREATE PROCEDURE test @userName VARCHAR(64) SELECT * FROM member M INNER JOIN order O ON M.MemberId=O.MemberId WHERE M.Username = @userName There is a ...
0
votes
1answer
43 views

“Incorrect Syntax near S” in Stored Procedure [closed]

I'm creating a SQL Server stored procedure and getting error Incorrect Syntax near S I'm not able to find the exact reason of the error. CREATE PROCEDURE RPT_IVR_CALL_SUMMARY ...
0
votes
0answers
50 views

Optimising an SP - Left Join against several big tables

I have stumbled upon performance bottleneck due to LEFT JOIN against several big tables (approx. 6 million rows of data, consisting of 10 columns). Any suggestions on how to optimize this SP is ...
0
votes
2answers
45 views

Executing stored procedures asynchronously using tasks in SSIS

I have a stored procedure which is calling 20-30 stored procedures. I need these stored procedures to run asynchronously. From what I have read, it seems like executing those stored procedures using ...
0
votes
0answers
31 views

Mysql cursor alternative / Optimization - each row updates are too slow

I'm looking to optimize my cursor based update or actually replacing it... Situation We're carrying out promotional campaigns and I'd like to track user activity per campaign. Logic Each campaign ...
0
votes
1answer
24 views

Access denied to user@localhost

As a root user i did this: GRANT DELETE, SELECT, INSERT, UPDATE, EXECUTE ON dbName.* TO 'user'@'localhost' IDENTIFIED BY 'apassword'; In 'dbName' i created a procedure 'proc_name' with definer set to ...
0
votes
0answers
41 views

MySQL is pretty slow after 50-100k rows whats happen?

i have trying now a lots of time, and i try to find a way there make sense to find out of my problem, but this problem stil make a lot perfumes issues. i testing it of on a developer server ( 2 ...
3
votes
2answers
39 views

Getting Machine name from where stored procedure was last executed

Is there any way to find out machine IP or machine name from where a particular stored procedure is executed in SQL Server 2005? We have a client server architecture with .NET as a front end and SQL ...
0
votes
0answers
34 views

Can I change “Category_Id” & “Current_execution_status” value in SQL Server 2012 through stored procedure?

I have created one job in SQL Server 2012 through SQL Server agent, and that job is not running due to some security privileges. When I am seeing through below SQL query to that my created job ...
0
votes
2answers
55 views

How to Solve ERROR 1064 (42000)?

DROP PROCEDURE IF EXISTS proc_x; DELIMITER # CREATE DEFINER=`root`@`localhost` PROCEDURE proc_x(sequel CHAR) proc_main:BEGIN SET @SQL = CONCAT(@sequel); PREPARE stmt FROM @SQL; EXECUTE stmt; ...
0
votes
1answer
49 views

Need help with my MySQL PROCEDURE #1193 - Unknown system variable

I've this simple table: CREATE TABLE IF NOT EXISTS `testing` ( `testing_ID` INT UNSIGNED NOT NULL AUTO_INCREMENT, `meter` INT NOT NULL, `price` DECIMAL(12,2) NOT NULL, ...
0
votes
1answer
25 views

“show procedure status” displaying the non existing databases stored procedures in mysql server

i have taken a mysql server backup using mysqldump and imported the backup file in another mysql server.Import failed because of disk full issue. Only 11 databases are created out of 15 . when i issue ...
0
votes
1answer
26 views

No records in Mysql.func table even though there are stored functions in server

When i am creating a user defined function in one of my mysql server, it's not creating any row in mysql.func table . Even though i have multiple functions in my mysql server , this table is empty . ...
1
vote
2answers
105 views

MySQL Workbench not showing stored procedures that I have created

I have a simple stored procedure that I have just created. I have applied this script to my database This script shows up in the my list of stored procedure However, when I restart MySQL ...
0
votes
0answers
24 views

MySQL: routines removed but still in information_schema

I have a MySQL server with a lot of stored procedures (around 150). When I tried to list the routines with PHPMyAdmin it requires a lot (around 2-3 minutes) in order to load all of them. So I started ...
2
votes
2answers
194 views

Insert/Update Stored Procedure

My database model is quite simple. I have the following tables: Monitor, Computer, and Monitor_Computer_Map as my mapping table for a many-to-many relationship between the other two tables. I have a ...
1
vote
0answers
29 views

Clarification on usage of Serially Reusable Pragma for Oracle 10g

I need to make packages for Oracle 10g that can be changed while users are still logged in an using an application that makes database calls through PL/SQL. Unfortunately, anytime a package is updated ...
0
votes
1answer
21 views

Is there any way to perform atomic updates of stored procedures in MySQL?

I know that MySQL does not support atomic updates of stored procedures yet and it is bug which was reported on 2005 but not yet resolved.(http://bugs.mysql.com/bug.php?id=9588). In our project ...
5
votes
4answers
209 views

How to check if Alter view/stored proc script has run successfully

For the database deployments, I call all the db schema changes in a batch file and run them on the target database. Sometimes we have scripts for altering the views or stored procs. I'm wondering ...
1
vote
2answers
78 views

Stored procedure to check if username exists

I'm trying to write a stored procedure So far I have this, but it always returns 1 CREATE DEFINER=`root`@`localhost` PROCEDURE `USER_EXISTS`(IN `USERNAME` VARCHAR(64) CHARSET utf8mb4) SELECT CASE ...
0
votes
0answers
22 views

Report not pulling records

Stored procedure working fine. Procedure contains 5 parameters and 30 columns. I am using this stored procedure in my SSRS report. When I click preview, it is asking for parameter values I just ...
0
votes
0answers
15 views

When will store procedure/functions support result set as return type

I have noticed that MySql doesn't support result-set on a store procedure and functions, which means return a table. So I can't do things like CALL sp_my_store_procedure() ORDER BY id ASC; Or ...