Showing posts with the label stored-procedures

[FIXED] Any way to edit data on MS-Access form using SQL View with two tables

Issue From what I've read it should be possible to edit data described by a view if the data be…

[FIXED] Throw error on TRY, in order to manage all error instruction in the CATCH block

Issue I'm writing a Stored Procedure to do "lots of things" (input validation, insert…

[FIXED] Freezing/hanging when executing Oracle DB PL/SQL procedure in Python

Issue Hello I created a PLSQL procedure to update or insert quantity in inventory table based on pr…

[FIXED] Passing variables into Openquery and SQL Injection

Issue I have two databases (A and B), both SQL Server, on different servers. These databases are co…

[FIXED] Safely execute a dynamic sql query

Issue Consider the dangerous stored procedure below: ALTER PROCEDURE [dbo].[ExecDynamicSQL] @…

[FIXED] which method to follow to prevent SQL injection in MySql Stored Procedure

Issue hi friends i googled for this and find different methods use by others to prevent sql injecti…

[FIXED] Is there a way for me to dynamically write a script to add a domain+user to Microsoft SQL server in a stored procedure?

Issue I have to use this exact script below: ALTER PROCEDURE [dbo].[sp_CheckIfSQLLoginExistsAndCre…

[FIXED] How to cleanse (prevent SQL injection) dynamic SQL in SQL Server?

Issue We have a ton of SQL Server stored procedures which rely on dynamic SQL. The parameters to …

[FIXED] How to get output REFCURSOR in package oracle with golang ("github.com/sijms/go-ora/v2")

Issue i have a package in oracle CREATE OR REPLACE PACKAGE PKG_TEST IS TYPE REFCURSOR IS R…

[FIXED] SqlServer - OPTION RECOMPILE parallel execution behavior

Issue I need clarification on how SQLServer behaves when you execute a parameterised procedure with…

[FIXED] sp_executesql with datetime output parameter

Issue I'm facing a problem here in SQL Server. I have to use the stored procedure sp_executesql…

[FIXED] Anonymous stored procedure in SQL Server

Issue In Oracle, we can write anonymous blocks for quick testing of logic without having to store t…

[FIXED] 2nd call to stored procedure gives error (2014)

Issue my 1st day with stored procedures. when i call the procedure for the 2nd time i get an error?…

[FIXED] Selecting records greater or equal to 2021 using DATEPART in where clause but still records fo 2019, 2020 are getting returned? why?

Issue select top 10 (DATEPART (year, ss.[dateTime])) from states ss where ((DATEPART (yea…

[FIXED] Building dynamic where condition in SQL statement

Issue I want to build custom Where condition based on stored procedure inputs, if not null then I w…

[FIXED] Table name as parameter for Microsoft SQL Server procedure

Issue I am trying to use a SQL Server procedure to create two tables with different names depending…

[FIXED] Set DATE parameter default to dynamically calculated value

Issue I have a stored procedure with two DATE parameters that I want to have a default value. Howe…

[FIXED] Comparing a User Input to an already established table's column

Issue I have a User Input coming into the database to get compared to a table's column. I'…

[FIXED] Do I need to grant permission on the database if I already granted it to stored procedure?

Issue I have a SQL Server database (let's call it DB1) with a few stored procedures, and these …

[FIXED] Maintaining rows in a SQL Server junction table when rows in other table are inserted and updated

Issue Can you show sample coding to create a trigger or stored procedure that maintains rows a SQL …