Click here to Skip to main content
15,897,273 members
Home / Discussions / Database
   

Database

 
GeneralRe: Prevent queries from SQL Injection attack in SQL Server 2005 Pin
SomeGuyThatIsMe29-May-08 4:02
SomeGuyThatIsMe29-May-08 4:02 
GeneralRe: Prevent queries from SQL Injection attack in SQL Server 2005 Pin
Alsvha29-May-08 6:11
Alsvha29-May-08 6:11 
GeneralRe: Prevent queries from SQL Injection attack in SQL Server 2005 Pin
SomeGuyThatIsMe29-May-08 7:52
SomeGuyThatIsMe29-May-08 7:52 
GeneralRe: Prevent queries from SQL Injection attack in SQL Server 2005 Pin
Alsvha29-May-08 8:29
Alsvha29-May-08 8:29 
AnswerRe: Prevent queries from SQL Injection attack in SQL Server 2005 Pin
Alsvha29-May-08 6:15
Alsvha29-May-08 6:15 
GeneralRe: Prevent queries from SQL Injection attack in SQL Server 2005 Pin
salon29-May-08 22:41
salon29-May-08 22:41 
AnswerRe: Prevent queries from SQL Injection attack in SQL Server 2005 Pin
Peter Josefsson Sweden30-May-08 1:17
Peter Josefsson Sweden30-May-08 1:17 
QuestionTRIGGER problem!!!!!! Help me! [modified] Pin
Karan_TN29-May-08 2:16
Karan_TN29-May-08 2:16 
Currently i m using sql server 2000. when i directly modify the values inside the database the following TRIGGER fires correctly. But when pass values from front end (ASP.NET with C#, .net 2005, 2.0 framework) "update tbl_ORA_TBOps set Percentage_Compliant=((@comp/@tot_ex)*100) where AutoID=@id" this alone not working.. what problem.....? plz..

CREATE TRIGGER [calc] ON dbo.tbl_ORA_TBOps
AFTER INSERT, UPDATE
AS

begin
update tbl_ORA_TBOps set Total=(Compliant+Non_Compliant+InProgress+InputNotReceived+NA)
update tbl_ORA_TBOps set Total_Excl_NA=Total-NA
end

begin

declare @tot numeric
declare @na numeric
declare @tot_ex numeric
declare @comp numeric
declare @id numeric

select @tot=(Select total from inserted)
select @na=(Select NA from inserted)
select @tot_ex=(Select Total_Excl_NA from inserted)
select @comp=(Select Compliant from inserted)
select @id=(Select AutoID from inserted)

if (@tot=@na)
begin
update tbl_ORA_TBOps set Percentage_Compliant=100 where AutoID=@id
end

else

if (@tot_ex=0)
begin
update tbl_ORA_TBOps set Percentage_Compliant=0 where AutoID=@id
end

else

begin
update tbl_ORA_TBOps set Percentage_Compliant=((@comp/@tot_ex)*100) where AutoID=@id
end

end


in the above trigger, i m getting incorrect Percentage_Compliant value. how to solve this (i m very beginner to TRIGGERS). is the IF...ELSE loop correct? HELP ME! - KARAN

modified on Thursday, May 29, 2008 8:38 AM

AnswerRe: TRIGGER problem!!!!!! Help me! Pin
Peter Josefsson Sweden30-May-08 1:31
Peter Josefsson Sweden30-May-08 1:31 
GeneralRe: TRIGGER problem!!!!!! Help me! Pin
Karan_TN30-May-08 21:16
Karan_TN30-May-08 21:16 
GeneralRe: TRIGGER problem!!!!!! Help me! Pin
Peter Josefsson Sweden2-Jun-08 2:11
Peter Josefsson Sweden2-Jun-08 2:11 
GeneralRe: TRIGGER problem!!!!!! Help me! Pin
Karan_TN6-Jun-08 19:13
Karan_TN6-Jun-08 19:13 
QuestionBuilt in stored procedures Pin
dan!sh 28-May-08 23:53
professional dan!sh 28-May-08 23:53 
AnswerRe: Built in stored procedures Pin
Mark J. Miller29-May-08 3:32
Mark J. Miller29-May-08 3:32 
QuestionCopy data from one table to another problem Pin
soniasan28-May-08 22:42
soniasan28-May-08 22:42 
AnswerRe: Copy data from one table to another problem Pin
ChandraRam28-May-08 23:13
ChandraRam28-May-08 23:13 
GeneralRe: Copy data from one table to another problem Pin
Ashfield29-May-08 1:46
Ashfield29-May-08 1:46 
QuestionMaximum output length for PRINT in SQL 2005 Pin
MatthysDT28-May-08 21:38
MatthysDT28-May-08 21:38 
AnswerRe: Maximum output length for PRINT in SQL 2005 Pin
Ashfield29-May-08 2:16
Ashfield29-May-08 2:16 
QuestionODP.net (oracle data provider) - batches Pin
Member 453749128-May-08 19:42
Member 453749128-May-08 19:42 
Questionmultiple sql queries Pin
twsted f828-May-08 9:28
twsted f828-May-08 9:28 
AnswerRe: multiple sql queries Pin
Blue_Boy28-May-08 13:27
Blue_Boy28-May-08 13:27 
QuestionCould not find file 'C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE' error in VS 2008 Pin
MPCHAM28-May-08 3:49
MPCHAM28-May-08 3:49 
AnswerRe: Could not find file 'C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE' error in VS 2008 Pin
Mike Dimmick2-Jun-08 5:43
Mike Dimmick2-Jun-08 5:43 
QuestionNeed to display the links in datalist of pros in redcolor who r working for us Pin
subbu.sk28-May-08 2:50
subbu.sk28-May-08 2:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.