Member Avatar

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 you select House, Unit or Rural and the trouble I am having is when you select All it returns no information. I'm sure there is something very simple that I am missing but your help would be great. Here is the stored procedure code: [CODE] set ANSI_NULLS ON set QUOTED_IDENTIFIER …

Member Avatar
0
3
Member Avatar

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 only shows the last one (number 10)). When I run the stored procedure in the query analyzer it runs without any errors but it only displays the last item; here's the procedure (this is MS SQL Server 2008R2 if that makes any difference): [CODE]USE [NISUSInvyControl] GO /****** Object: StoredProcedure [dbo].[NISUS_GetEDIDocTypes] …

Member Avatar
0
5
Member Avatar

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 insert into SCH_Class (Class_Id,Class_Type_Id,Batch_Id,School_Id,Class_Name,Created_Date,Updated_Date,Created_By,Updated_By,Is_Valid) values (@ClassID,@ClassTypeId,@BatchId,@SchoolId,@ClassName,GetDate(),GetDate(),@Userid,@Userid,1) set @STATUS=1 return @STATUS end [/CODE] Can u please help me to execute this sp and get the return value from it. Regards, sreevidya

Member Avatar
0
10
Member Avatar

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, simNo INT, team VARCHAR [/CODE] The problem is that I want to create a team table and the reference the teamId in the asset_register table. Does that make sense? Instead of storing the actual team name i want a foreign key to the teams table. The problem lies in updating …

Member Avatar
0
14
Member Avatar

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 varchar(200), @TitleText varchar(50), @NewContact_ID int output AS BEGIN SET NOCOUNT ON IF LEN(@PositionText)>0 BEGIN INSERT INTO dbo.tblPosition (Position) VALUES (@PositionText) SET @Position_ID = @@identity END IF LEN(@TitleText)>0 BEGIN INSERT INTO dbo.tblTitle ([Client_ID], [Title]) VALUES (@Client_ID, @TitleText) SET @Title_ID = @@identity END INSERT INTO [dbo].[tblContact] ([Client_ID] ,[STD] ,[Tel] ,[Mobile] ,[EmailAddress] ,[FirstName] …

Member Avatar
0
4
Member Avatar

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 my SQL SP: [ICODE]ALTER PROCEDURE dbo.plnCs @plan int, @level int AS SELECT p.CNo, c.CLevel FROM Plans p, Course c WHERE p.CNo=c.CNo AND p.[Year]=@plan AND c.CLevel=@level RETURN[/ICODE] and this is my VB statements that call the SP: [ICODE]... csrDa.SelectCommand.CommandType = CommandType.StoredProcedure csrDa.SelectCommand.Parameters.AddWithValue("@plan", plan) csrDa.SelectCommand.Parameters.AddWithValue("@level", x)[/ICODE] the values of x range from …

Member Avatar
0
9
Member Avatar

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 'User already exists' end else begin --This means that the username is available select 'New user created' Insert into Korisnici (UserName,UserPassword) values (@UserName, @Password) end[/CODE] How to check in C# when the new user is available, and when the username is taken? When the selected username is available do the …

Member Avatar
0
5

The End.