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
Nel
NA
716
1.1m
Problem with the stored procedure
Aug 1 2012 2:17 AM
Hi,
I have this stored procedure:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[presmetajSaldo]
(
@idki int,
@data DateTime,
@saldo numeric(12,3) output
)
as
Declare @priem numeric(12,3)
Declare @isplata numeric(12,3)
select @priem = sum(iznosden) from blagajna_jspturs
where
data=@data
set @saldo = isnull(@saldo,0) + (isnull(@priem,0)) - (isnull(@isplata,0))
update Kasovizvestaj
set
saldo=@saldo
where
data=@data
select saldo from Kasovizvestaj
return
When I erase the bold row, the sp calculates correctly, but when I put that row in the sp, it doesn't calculates. Without select saldo from Kasovizvestaj row, it throughs a message "0 rows affected".
Can anybody help me please with a suggestion what's wrong with my sp?
I also tried with:
where CONVERT(VARCHAR(10),data,104) = CONVERT(VARCHAR(10),@data,104)
instead of
where data=@data
but without success.
Thanks a lot in advance.
Reply
Answers (
1
)
System.Data.SqlClient.SqlError The File MDF is compressed but does not reside in a read only database or filegroup
Stored Procedure in SQL