[Solved] This procedure not working

The problem is not at the procedure it is at the calling. When you call the stored procedure, you need to declare and pass in the required parameter declare @NAME VARCHAR(50), @CITY VARCHAR(200), @MOBILE NUMERIC(20) execute GETDETAIL @AGE = 21, @NAME = @NAME OUTPUT, @CITY = @CITY OUTPUT, @MOBILE = @MOBILE OUTPUT SELECT @NAME, @CITY, … Read more

[Solved] How can I write this stored procedure with EF in C# [closed]

SO is not a website when you throw everything here and expected people finish the job for you. Anyway, to give you some hint, I give you a straight suggestion: Select CostGroupId From CostGroups Where CostGroupType = 1 –> Stored these in A collection, like an array: var costGroupsIdArr = ctx.CostGroup.Where(x=>x.CostGroupType == 1).Select(x.CostGroupId).toArray(); Then from … Read more

[Solved] How to convert the Varchar of sum to time using sql server 2008 [closed]

Try this: DECLARE @SUM VARCHAR(50)=’33.90′; SELECT CAST(CAST(LEFT(@SUM,CHARINDEX(‘.’,@SUM,0)-1) AS INT)+ CAST(SUBSTRING(@SUM,CHARINDEX(‘.’,@SUM,0)+1,LEN(@SUM)) AS INT)/60 AS VARCHAR(10))+’.’+ CAST(CAST(SUBSTRING(@SUM,CHARINDEX(‘.’,@SUM,0)+1,LEN(@SUM)) AS INT)%60 AS VARCHAR(10)) result: 34.30 1 solved How to convert the Varchar of sum to time using sql server 2008 [closed]

[Solved] How to create a stored procedure for select/update/delete statements

As David said you are almost there but just need minor changes. I suppose @Pid is a parameter,if so, it is missing from the Stored Procedure defintion. The (and specialistId=@Pid and iscompleted =1) form the Where clause (Filter expression). So the procedure goes like this ` CREATE PROCEDURE PROCD1 (@PID INT ) AS BEGIN SELECT … Read more

[Solved] Why is this cursor giving an error?

Given an input XML, you can use this simple XQuery statement to “shred” the XML into relational rows and columns – just do a simple INSERT INTO ….. and you’re done. No messy cursor nor OPENXML stuff needed… DECLARE @input XML = ‘<Salaray> <TransactionSalary EmpSL=”2″ Basic=”9860″ Grad_pay=”4100.00″ DA=”6282.00″ HRA=”2094″ MA=”300.00″ Ptax=”150.00″ pf=”2000″ Itax=”0.00″ LIC=”0.00″ Month_Of=”14/Dec/2012″ … Read more

[Solved] Stored procedure takes too much time in if statement when i pass @ip=” and takes 0 sec with some value to @IP

As I wrote in the comment the answer of your first question is: If I understand your PRC well, in case of @IP = ” it should returns a wieder set of members. I think it is possible that the Username, Email or Country is longer in the member table then the @Temp table’s definition. … Read more

[Solved] An unhandled exception of type ‘System.InvalidOperationException’ occurred in System.Data.dll?

You should either use this method: SqlCommand cmd = new SqlCommand(“dbo.workScheduleDataGrid”, sqlcon); or this method SqlCommand cmd = sqlcon.CreateCommand(); to create the command, but not both (the second assignment in your code overwrites the first one). With the second options, you need to specify the command to execute separarely: cmd.CommandText = “dbo.workScheduleDataGrid”; Also, do not … Read more