30 Topics

Member Avatar for
Member Avatar for RudyM

Hi all, I wanted to procedure to return number of days and weekdays between two dates. This is what I came up with and it seems to work ok, but I'd like to read what others think. And if there's already a single line function for this, oops. Also, I'm …

Member Avatar for kccole01
0
4K
Member Avatar for jeffersonalomia

Hi, I would like to ask a question about returning the column value(s) returned by stored procedure in c#. I have created the code but somehow I encountered an error saying: ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll Additional information: Subquery returned more than 1 value. This …

Member Avatar for RabidDog5150
0
990
Member Avatar for JModak

How to copy a store procedure one to another database in same server I work on a project. I want copy all or single store procedure from old financial year **db_17_18** to new financial year **db_18_19** I want to do it using sql server command. i try it but showing …

Member Avatar for pty
0
492
Member Avatar for Himanshu Chawla

SELECT CASE WHEN (Employees.End_Date is null) THEN select EmpId, Emp_Name, Salary , Start_date , End_date ,DATEDIFF(DATE_ADD(Start_Date, INTERVAL 30 DAY), Start_Date) * Salary/30 as 'Total_Salary' from Employees ELSE Select EmpId, Emp_Name, Salary , Start_date , End_date ,DATEDIFF(End_Date, Start_Date) * Salary/30 as 'Total_Salary' from Employees END From Employees; Please help me to …

Member Avatar for AndrisP
0
349
Member Avatar for DGULLIVER

Hi, CREATE PROCEDURE `FindDuplicateExpenses`(IN `strExpenseDate` DATE, IN `strProfile` VARCHAR(50)) NO SQL SQL SECURITY INVOKER SELECT PD.Code, PD.ExpenseAuthorizedRefAmount, PD.FullName, PD.ExpenseDate, PD.ExpenseNatureID, PD.Ignore_Expense, PD.Profile FROM tblExpenses AS PD, (SELECT Profile, ExpenseAuthorizedRefAmount, FullName, ExpenseDate, ExpenseNatureID FROM tblExpenses GROUP BY Profile, ExpenseAuthorizedRefAmount, FullName, ExpenseDate, ExpenseNatureID HAVING COUNT(*) > 1) AS SUB1 WHERE PD.ExpenseAuthorizedRefAmount = …

Member Avatar for ryantroop
0
238
Member Avatar for ryantroop

Im working through sprocs with MySQL and I came across something that made me quite uncertain... I learned sprocs with MSSQL and I am used to declaring as such: create ... myProc (@var type, @var2 type(xxx)) as .... and for declares, we declare vars as declare @var3 type(xxx), @var 4 …

Member Avatar for ryantroop
0
302
Member Avatar for androtheos

I have a console application that I need to run a stored procedure in but I'm getting this error: a t S y s t e m . D a t a . S q l C l i e n t . S q l C o n n …

Member Avatar for Momerath
0
270
Member Avatar for M.Waqas Aslam

hello! i have shifted my application from mssql server 2000 to mssql server 2005 , now the prob is the command object is not returning the recordset if command text is stored procedure , here is my code please check it and guide me through errors . [ICODE] dim cmdsp …

Member Avatar for BitBlt
0
234
Member Avatar for sujimon

I have a storedProcedure in SQL-Server that I am using to delete duplicates from one of the tables. This storedprocedure makes use of a cursor. I tried to create the same storedprocedure in microsoft access by just replacing the 'CREATE PROCEDURE' with 'CREATE PROC' but it didn't seem to work. …

Member Avatar for thines01
0
181
Member Avatar for abathurst

I have a drop down menu on a page where the user can select between, All, House, Unit and Rural which send the selection to a stored procedure which access' the database and returns the information with the selection eg. House from the category column. It all works great when …

Member Avatar for abathurst
0
125
Member Avatar for spowel4

I'm new to stored procedures and, really anything about sql beyond the basic SELECT/INSERT/etc... so this is probably just something I don't understand but my problem is that my stored procedure seems to only return the last row of the result set (i.e. if it should return 10 items it …

Member Avatar for adam_k
0
1K
Member Avatar for ssreevidya.m

Hai, I Have an sp like this: [CODE]ALTER procedure [dbo].[SP_ClassInsertion] @ClassType varchar(50), @ClassTypeId varchar(50), @ClassName varchar(50), @SchoolId varchar(50), @ClassID varchar(50), @BatchId varchar(50), @Userid uniqueidentifier, @ClassCategoryId varchar(50), @SchoolClassCategoryId varchar(50) as declare @STATUS int begin if exists(select Class_Id from SCH_Class where Class_Name=@ClassName and School_Id=@SchoolId and Is_Valid=1) begin set @STATUS=0 end else begin …

Member Avatar for ssreevidya.m
0
300
Member Avatar for dwayned

Hi Guys, I have imported an excel document into MySQL to tidy up and make better use of the data but I am having problems running an update. All tables used as examples below; [U]Tables[/U] asset_register phone sim team The asset_register contains the following cols; [CODE] id INT, serialNo VARCHAR, …

Member Avatar for dwayned
0
17K
Member Avatar for folberlin

hi, i have an application that feeds data into a table of a database - table name is XTABLE716C6DC3. now i need a stored procedure that takes and calculates data from that dable anytime the table is changed and store the results in a certain format into a new table …

Member Avatar for adam_k
0
202
Member Avatar for sels2005j

In my application some stored procedures are not working properly in current database of SQL Server. I have taken backup of database 2 weeks ago and all stored procedures are working in backup database. I have checked the properties of current database and backup database both are same. After restoring …

Member Avatar for crishlay
0
160
Member Avatar for jenny666

Hello, im new to stored procedure and never really used C. For a project i have to write stored procedures and execute them in C. I have written my stored procedures in MySql Workbench and I have Visual Basic 2010 express and Visual studio 2008 installed. How do i execute …

Member Avatar for Ancient Dragon
0
176
Member Avatar for studentoflife

I return 30 tables or so from sql in a stored procedure. In the stored procedure I select these tables via... [CODE]select * from myTable1 select * from myTable2 select * from myTable3[/CODE] etc. These tables lose their sql table name when returned in a dataset and have default names …

Member Avatar for studentoflife
0
188
Member Avatar for stevenfagan

I'm using a linux shared hosting account with godaddy and I can't seem to get stored procedures working correctly with my MySQL database. I can create them from within phpMyAdmin fine. I can also create them in MySQL workbench fine. However, whenever I try to call the stored procedures either …

Member Avatar for davidchilders
0
1K
Member Avatar for GL.Za

Hi I am working on a procedure to log the users and times of our reports. Our reports are all executed from stored procedures. The generic logging proc which will be placed in the 30+ report procedures. I'm having a problem with getting the start and end times for the …

Member Avatar for sa_coder
0
635
Member Avatar for zylog

HI iam a beginner in php . just started learning stored procedure . is there any way to execute stored procedure form the php page

Member Avatar for jkon
0
64
Member Avatar for Richard.Randle

Hi , I am a Newbie using SQL server and vb.net in VS2010. I am re-writing an exisitng application which is written in an old programming language. I have a table with invoice records waiting to be assigned an invioce number and invoice date. I have two ways of uupdating …

Member Avatar for Richard.Randle
0
261
Member Avatar for genosy

hi, Am having a problem Inserting into SQL 2008 database using stored procedure from a php webpage. My Stored Procedure is: [code=text] Create PROCEDURE [dbo].[udp_AddContact_Insert] @Contact_ID int, @Client_ID int, @STD varchar(10), @Tel varchar(20), @Mobile varchar(20), @EmailAddress varchar(100), @FirstName varchar(20), @LastName varchar(20), @Title_ID int, @Position_ID int, @User_ID int, @SourceURL varchar(1000), @PositionText …

Member Avatar for genosy
0
198
Member Avatar for el_vala

I know, is a very basic question, but I am in the process of re-learning sql stored procedures, and this is what happended: I was practicing with some simple delete / insert routines, when encountered with this: if I ONLY insert records: 1. dog 2. cat 3. t-rex 4. llama …

Member Avatar for el_vala
0
206
Member Avatar for fadi-ft

Hello DW Forum, i am a new member between you and this is my first post i am building a website mostly uses Stored Procedure, but now i am facing a problem such that i want to call the SP more than one time from the .vb page this is …

Member Avatar for fadi-ft
0
167
Member Avatar for Michael27

I'm trying to create login form in C#. I store username and password in SqlServer 2008 express using the stored procedure [CODE]ALTER procedure [dbo].[InsertNewUser] ( @UserName varchar(30), @Password varchar(30) ) as If exists(Select 'True' from Users where UserName = @UserName) begin --This means that the user name is taken select …

Member Avatar for arunkumars
0
167
Member Avatar for dnanetwork

i can handle a store procedure which returns one output parameter using ExecuteScalar() but wot if my store procedure returns more than one parameter then how can i handle it. any advice Adapost ?

Member Avatar for dnanetwork
0
88
Member Avatar for dwayned

Hi, I am having problems inserting data into a table using a stored procedure. When I click the button to insert the data nothing happens at all. I added a [B]server.transfer[/B] after the insert to see if it was falling over before the end of the query/insert. My code behind …

Member Avatar for dwayned
0
182
Member Avatar for sandeep210

[CODE]<?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Samples.Controllers" schema="I_USER" assembly="Samples" > <sql-query name="PROCEDURE1" callable="true"> <!--<return class="empdetails.cs" />--> <return-scalar column="iusrfname" type="String" /> <return-scalar column="iusrlname" type="String" /> <return-scalar column="iusrlinname" type="String" /> <return-scalar column="iusremailid" type="String" /> <return-scalar column="iusrmobileno" type="String" /> <return-scalar column="iusrrmrks" type="String" /> <!--<return-scalar column="iusrcreated" type="DateTime" />--> call PROCEDURE1(:pr_userid,:iusrfname,:iusrlname,:iusrlinname,:iusremailid,:iusrmobileno,:iusrrmrks)<!--,:iusrcreated)--> </sql-query> </hibernate-mapping>[/CODE]

0
111
Member Avatar for sam023

This is my Stored Procedure DELIMITER $$ [code=mysql] DROP PROCEDURE IF EXISTS `call`.`sp_login`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_login`(userid varchar(50),pass varchar(50),out chk int(11),out user_alias varchar(50),out user_tariff varchar(50),out c_credit decimal(15,5),out r_reseller varchar(10),out r_level varchar(10),out c_tariff char(2)) BEGIN select id into chk from cc_reseller where useralias =userid and uipass=pass and level!=0 and activated!='0'; if(chk!="") …

Member Avatar for network18
0
275
Member Avatar for gedkins

I have a stored procedure in SQL Server 2008 that follows: USE [Numbers] GO /****** Object: StoredProcedure [dbo].[thenextnum] Script Date: 09/23/2009 15:35:16 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER procedure [dbo].[thenextnum] @descrip varchar(50) as begin declare @t table (nextseq varchar(100)) update number_definition_table set Current_Number=Current_Number+1 output inserted.prefix_format +(Case …

Member Avatar for GeekByChoiCe
0
184

The End.