TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Bineesh Viswanath
NA
1k
781.6k
table row count problem
Mar 8 2014 2:13 AM
Sir,
I having a problem of a SQL select Query.
This is the screenshot of my form where data being retrieved:-
I think this should show in debug as rows.count=4, but what happens is:-
How this comes rows.count=5?.
The SQL Query to this is:-
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER Procedure [dbo].[Update_New_invPurchaseItems]
(
@as_CompCode nchar(3),
@as_DivCode nchar(3),
@as_YearCode nchar(5),
@as_ltype smallint,
@as_gid int,
@as_PurchaseID bigint,
@as_PCode nvarchar(20),
@as_PID bigint,
@as_batchno nvarchar(20),
@as_rate float,
@as_qty float,
@as_freeqty float,
@as_disc float,
@as_taxid bigint,
@as_taxrate float,
@as_tax float,
@as_amount float,
@as_isdeleted bit,
@as_discper float,
@as_remarks nvarchar(100),
@as_mandate datetime,
@as_expdate datetime,
@as_conrate float,
@as_mrp float,
@as_uomid int,
@as_stockaffect bit,
@as_accountid int,
@as_rrate float,
@as_wrate float,
@as_status varchar(10),
@as_isdelivered bit
)
AS
BEGIN
INSERT INTO INVPURCHASEITEMS
(
PurchaseID,
PCode,
PID,
batchno,
rate,
qty,
freeqty,
disc,
taxid,
taxrate,
tax,
amount,
isdeleted,
discper,
remarks,
mandate,
expdate,
conrate,
mrp,
uomid,
stockaffect,
accountid
)
VALUES
(
@as_PurchaseID,
@as_PCode,
@as_PID,
@as_batchno,
@as_rate,
@as_qty,
@as_freeqty,
@as_disc,
@as_taxid,
@as_taxrate,
@as_tax,
@as_amount,
@as_isdeleted,
@as_discper,
@as_remarks,
@as_mandate,
@as_expdate,
@as_conrate,
@as_mrp,
@as_uomid,
@as_stockaffect,
@as_accountid
)
IF @as_isdelivered = 'True'
BEGIN
IF @as_status = 'New'
BEGIN
INSERT INTO INVSTOCK
(
Compcode,
DivCode,
Yearcode,
PID,
Batchno,
GID,
LTYPE,
qty,
Mandate,
Expdate,
prate,
mrp,
rrate,
wrate
)
VALUES
(
@as_Compcode,
@as_DivCode,
@as_Yearcode,
@as_PID,
@as_Batchno,
@as_GID,
@as_LTYPE,
(@as_qty + @as_freeqty),
@as_Mandate,
@as_Expdate,
@as_rate,
@as_mrp,
@as_rrate,
@as_wrate
)
END
ELSE IF @as_status = 'NotNew'
BEGIN
UPDATE INVSTOCK SET
Compcode = @as_CompCode,
DivCode = @as_DivCode,
Yearcode = @as_YearCode,
PID = @as_PID,
Batchno = @as_batchno,
GID = @as_gid,
LTYPE = @as_ltype,
qty = qty + @as_qty + @as_freeqty,
Mandate = @as_mandate,
Expdate = @as_expdate,
prate = @as_rate,
mrp = @as_mrp,
rrate = @as_rrate,
wrate = @as_wrate
WHERE PID = @as_PID AND Batchno = @as_batchno AND LTYPE = @as_ltype AND GID = @as_gid
AND Compcode = @as_Compcode AND DivCode = @as_Divcode AND Yearcode = @as_Yearcode
END
END
END
Reply
Answers (
3
)
give me discription
Code Before Response.Redirect doesn't Execute ?