Click here to Skip to main content
15,895,084 members
Home / Discussions / Database
   

Database

 
Questionquery problem: specially for Colin [modified] Pin
Saira Tanwir10-Feb-07 2:55
Saira Tanwir10-Feb-07 2:55 
AnswerRe: query problem Pin
Colin Angus Mackay10-Feb-07 4:05
Colin Angus Mackay10-Feb-07 4:05 
GeneralRe: query problem Pin
Saira Tanwir10-Feb-07 4:15
Saira Tanwir10-Feb-07 4:15 
GeneralRe: query problem Pin
Colin Angus Mackay10-Feb-07 4:37
Colin Angus Mackay10-Feb-07 4:37 
GeneralRe: query problem Pin
Saira Tanwir10-Feb-07 5:07
Saira Tanwir10-Feb-07 5:07 
GeneralRe: query problem Pin
Colin Angus Mackay10-Feb-07 5:58
Colin Angus Mackay10-Feb-07 5:58 
GeneralRe: query problem Pin
Saira Tanwir11-Feb-07 6:31
Saira Tanwir11-Feb-07 6:31 
GeneralRe: query problem Pin
Colin Angus Mackay11-Feb-07 6:47
Colin Angus Mackay11-Feb-07 6:47 
Saira Tanwir wrote:
that is however not the not the question


Actually it is the question. You have a conditional expression and the syntax error is that you have not completed it. You set up the condition, but don't say what happens what happens when the condition is met.


Saira Tanwir wrote:
my problem is the query i'm trying to execute does not ecexute at all.


You don't have even a query - You have only part of a conditional expression. It can't do anything because you've not told it what to do.


Saira Tanwir wrote:
suppose, there is an attribute of salary. now the trigger against it the attribute is that whenever a salary amount is entered, a check should be applied checking that the salary is not more than a 6 digit number.


I'm assuming that by attribute you mean a column called salary.

CREATE TRIGGER emp_id_trg 
ON employee 
FOR INSERT 
AS 
DECLARE @salary int;
SELECT @salary = salary FROM inserted;
IF @salary >= 1000000
BEGIN
    -- Do stuff here - the salary is greater than 6 digits
END







GeneralRe: query problem Pin
Saira Tanwir11-Feb-07 6:55
Saira Tanwir11-Feb-07 6:55 
GeneralRe: query problem Pin
Colin Angus Mackay11-Feb-07 6:58
Colin Angus Mackay11-Feb-07 6:58 
GeneralRe: query problem Pin
Colin Angus Mackay11-Feb-07 6:56
Colin Angus Mackay11-Feb-07 6:56 
GeneralRe: query problem Pin
Saira Tanwir11-Feb-07 7:07
Saira Tanwir11-Feb-07 7:07 
GeneralRe: query problem Pin
Colin Angus Mackay11-Feb-07 7:10
Colin Angus Mackay11-Feb-07 7:10 
GeneralRe: query problem Pin
Saira Tanwir11-Feb-07 7:15
Saira Tanwir11-Feb-07 7:15 
GeneralRe: query problem Pin
Colin Angus Mackay11-Feb-07 7:16
Colin Angus Mackay11-Feb-07 7:16 
GeneralRe: query problem Pin
Saira Tanwir11-Feb-07 7:20
Saira Tanwir11-Feb-07 7:20 
QuestionQuery text vs SP Pin
Astricks9-Feb-07 22:19
Astricks9-Feb-07 22:19 
AnswerRe: Query text vs SP Pin
Colin Angus Mackay9-Feb-07 23:41
Colin Angus Mackay9-Feb-07 23:41 
AnswerRe: Query text vs SP Pin
tommyligo11-Feb-07 5:32
tommyligo11-Feb-07 5:32 
Questionproblem with database access [modified] Pin
sreecahitu9-Feb-07 10:56
sreecahitu9-Feb-07 10:56 
AnswerRe: problem with database access Pin
Colin Angus Mackay9-Feb-07 23:39
Colin Angus Mackay9-Feb-07 23:39 
QuestionHow to update column values automatically Pin
Ravi Ahuja9-Feb-07 6:25
Ravi Ahuja9-Feb-07 6:25 
AnswerRe: How to update column values automatically Pin
Colin Angus Mackay9-Feb-07 23:34
Colin Angus Mackay9-Feb-07 23:34 
GeneralRe: How to update column values automatically Pin
Ravi Ahuja10-Feb-07 8:55
Ravi Ahuja10-Feb-07 8:55 
GeneralRe: How to update column values automatically Pin
Colin Angus Mackay10-Feb-07 10:00
Colin Angus Mackay10-Feb-07 10:00 

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.