Tag: stored-procedures

How to map table fields from source as the variables of stored procedure in destination in SSIS Package?

I want to transfer data from source Database table named Patient (which contains many rows) to destination database tables(2) named Person & Patient. I already have stored procedure named AddPatient in destination database which will add person related fields to Person table and other fields to Patient table, so I would like to execute that […]

Stored procedure search parameter in MS SQL

I have got the MS SQL stored procedure, which is designed to return the results in XML showing all the applicants who are ‘sales’. There are filters on the page to drill down the results one being a search (sString). The desired behavior is: If sString is null, it should return all the results; If […]

MS SQL SERVER 2005 + SQLAlchemy + Stored Procedure + output parameter

From my python code, I am trying to execute stored procedure. Stored Procedure return integer value. CREATE PROCEDURE MY_PROC @empID char(10), @oldEmpList XML, @newEmpList XML, @Status INT OUTPUT AS — sp body SET @Status = 1 RETURN GO python t = text(‘EXEC MY_PROC :empID, :oldEmpList, :newEmpList, :Status’, bindparams=[bindparam(’empID’, type_=String, value=’1234′), bindparam(‘oldEmpList’, type_=TEXT, value='<emp><id>1</id><id>2</id>’), bindparam(‘newEmpList’, type_=TEXT, […]

Capturing print messages sql to vb

I do have a stored procedure and the stored procedure will be printing an output. We copy paste the output from the stored procedure and run in the desired db. I want to capture the print messages and show it in a text box or label or whatever in a vb application. Is there any […]

Register output parameter for calling stored procedure in SQL

I have this stored procedure: create procedure sp_findMaxEmployee @maxID as varchar(10) OUTPUT as SET @maxID = (SELECT MAX(e_ID) FROM Employee) go I try to register an output parameter like this: public string generateID() { connection = new SqlConnection(connectionStr); cmd = new SqlCommand(“sp_findMaxEmployee”, connection); SqlParameter param = new SqlParameter(); param.ParameterName = “@maxID”; param.Direction = ParameterDirection.Output; param.SqlDbType […]

SQL Server 2008 – INSERT for table working but UPDATE/DELETE hangs

I have a dead simple stored procedure which only does an INSERT to a table. The stored procedure takes several parameters (it’s called from C# code) and does a simple insert. Everything works fine with the insert – however, in some cases, there might be a PK violation, in which case I check the error […]

VB: Stored Procedures and Passing in Parameters

I am having a difficult time getting a stored procedure to execute with a parameter being passed into it. I have changed out the code with different examples from the web, but I keep getting the below error, so I must be ding something wrong. *Conversion failed when converting the varchar value ‘Error’ to data […]

Some issue with logical tables (DELETED, INSERTED) in procedure

I try use logical tables in procedure but I have error: “Invalid object name DELETED” So first question can I use logical tables in procedure? If yes how can I do this? This is a code USE Operator GO CREATE PROCEDURE generuj ( @nazwaTabeli VARCHAR(20) ) AS BEGIN SET NOCOUNT ON; — — Check if […]

Procedure or function “Procedure name” expects a parameter “Param name” which was not supplied occurs rarely

I have a web service function in VB.NET that will send parameters to a SQL Server stored procedure. Everything works perfectly for two months in the deployed machine. But now the error Procedure or function GetEmployeeDetails expects a parameter @Progress which was not supplied’ occurred only once on the deployed machine. Before and after the […]

sql server(Find the difference between 2 columns in 2 rows )

I am having a problem with a Cashback Report I am building. Here is the code of my Stored Procedure and what i want. –SP CODE CREATE PROCEDURE [dbo].[CashbackPromo] @startDate DateTime, @endDate DateTime AS create table #CashbackInfo ( UserID int, PreviousBal money, DepositAmount money, NewBalance money, LostMoney money ); –DECLARE @startDate DateTime =’2014-06-07 00:00:00′ –DECLARE […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.