Viewing 15 posts - 1 through 15 (of 17 total)
Thanks Drew. I will try and let you know.
October 3, 2016 at 8:21 am
Hi Drew,
Sorry, for the delay in response. Back to working on this. I ran the sample code using windows functions, but I can't use that approach because I am not...
September 30, 2016 at 4:00 pm
Also, the reason I was unable to window function from the link above is, it does this:
SUM(Col2) OVER(ORDER BY Col1 ROWS UNBOUNDED PRECEDING) "Rows" FROM #TMP
basically adding...
September 27, 2016 at 10:43 am
Thanks Jacob for the link on window functions. However, I was not sure on implementing it in my scenario. I came up with this for runningtotal implementation. The query runs...
September 27, 2016 at 10:37 am
You are right, the expected output for this procedure is runningtotal which would be runningtotal= runningtotal+numericof(response_string), ( from columns 6 through 9) the response string is the output...
September 27, 2016 at 8:20 am
Now the procedure finally works fine. Thanks all for your suggestions
September 23, 2016 at 1:43 pm
Thanks Luis. Yaay my code works like a charm now!!!
September 23, 2016 at 1:42 pm
Hello,
Thank you. I removed the aliases from insert. All are errors are gone. Now they are narrowed down to insert statement. It says incorrect syntax near insert.
insert into FY_ST_ANSWER_DETAIL (FY_ST_QUESTION_DTL_TABLE_ID,...
September 23, 2016 at 1:29 pm
@Phil,
Thanks. I have changed my code like this, but still get the errors near both the delete statements and insert statement. For insert, I have 2 tables with same no....
September 23, 2016 at 12:24 pm
Sorry, @Phil. I forgot to post the errors earlier.
Here they are:
I get errors on the delete statement:
delete from FY_ST_ANSWER_DETAIL ad
where ad.fy_st_question_dtl_table_id = @nFY_ST_QUESTION_DTL_TABLE_ID
and on
SELECT UL.FY_ST_QUESTION_DTL_TABLE_ID,UL.REGION,UL.STATE_CODE,UL.FY,.......
and on
WHERE UL.FY_ST_QUESTION_DTL_TABLE_ID...
September 23, 2016 at 10:59 am
@drew Allen,
Thanks for identifying the problem. I did not understand the XML concatenation part here. CAn you please provide some examples. I have never used it before. Also,...
September 22, 2016 at 8:35 am
All it does is concatening 2 strings and it returns resulting string. For example 26, 32 result: 2632.
I have defered this function will try to implement the same directly in...
September 21, 2016 at 2:34 pm
Thanks for the help. I tried to run your code, but it gives errors near end. not sure why. I think multi-line tvf have to be used here....
September 21, 2016 at 1:47 pm
Fixed it. I did this and query works fine:
USE [HSIP]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [hsip].[DELETE_A_ROW](
@cRegion CHAR(2) = '00',
@cState_Code CHAR(2) = '00',
@nFY NUMERIC(4,0) = 0,
@nREPORT_ID NUMERIC(2,0) = 0,
@nSECTION_ID NUMERIC(2,0) =...
September 20, 2016 at 4:13 pm
Here's the code I have. Can someone please suggest an improvement. Is it syntactically correct?
CREATE FUNCTION [HSIP].[Isnumeric]
(
@sResponse_string varchar(250)
)
RETURNS BOOLEAN
AS
BEGIN
RETURN
DECLARE @Output AS INT
select @Output= CASE @sResponse_string
WHEN @sResponse_string= ISNUMERIC(REPLACE(REPLACE(@sResponse_string, ',',''),'$','')) THEN...
September 20, 2016 at 11:59 am
Viewing 15 posts - 1 through 15 (of 17 total)