June 3, 2009 at 8:46 am
Hello,
I'm quiet new to sql but I have already made a few nice triggers by searching the net etc..
Now where I'm looking for, I want to make a trigger that gives a pop-up on the screen when a certain field is not filled in.
Can anyone post here a sample becaus I do not know how to start to It?
Please Can anyone help me?
Many many thanks
Ken
Belgium
June 3, 2009 at 8:47 am
That's not something to handle with a trigger. It's something to handle in the front end application.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
June 3, 2009 at 8:48 am
Isn't there any possibility???
June 3, 2009 at 8:53 am
some trigger with a Print clause in it??
Thx
ken
June 3, 2009 at 8:54 am
It might be possible if you use a CLR trigger and set up the right messaging services between the server and the client. You can also drive a screw by twisting it with the claws on your hammer, but it's a lot easier, more efficient, etc., to just plain use a screwdriver. You can steer a car by sticking metal poles out from the sides and forcing them into the surface of the road, but it's generally better to use the steering wheel. And so on. Just because something is possible, doesn't necessarily make it a good idea.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
June 3, 2009 at 9:24 am
SQL runs on a server. If the trigger were to pop up a message box, where do you think it would pop up?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 3, 2009 at 9:39 am
I'm going to have to agree with GSquared on this one. This definitely does not belong in a trigger and as Gail said the trigger runs on the server so where would the pop-up show up?
I'd be interested to see the resources you found about triggers and how you are using triggers. Typically you try to limit the amount of work done in triggers. You either do the work in a a stored procedure or the business layer of the application.
Have you read this article[/url] here on SSC?
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
June 3, 2009 at 9:42 am
I think you're architecturally confused.
SQL Server is a server. Your application will submit an insert or update to the server, and any result from that gets sent to your application, not the user on the screen. SQL Server has no interaction here.
What you can do is return a message to the application, but it would need to handle that message and then display something. Alternatively, the way most people handle it and GSquared suggested, is that you use the front end to catch this before you submit it to SQL Server and pop a note to the client.
what is your front end, out of curiosity.
June 3, 2009 at 9:45 am
Jack Corbett (6/3/2009)
I'm going to have to agree with GSquared on this one. This definitely does not belong in a trigger
In fact, it belongs in the client-side validation before the request is ever sent to the server.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 3, 2009 at 2:11 pm
Maybe I'am a bit confused ok but I thought If some fields were updated I could sent a print to te screen to tell other fields also have be filled In, but ok no problem.
I am using sql server and working with sage.
Can anyone tell me how to make such a pop-up or something
Thx
Ken
June 3, 2009 at 2:21 pm
Maybe the Sage programming guide will help you. This is the first I've ever heard of the language.
http://www.google.com/search?q=sage+programming+guide
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply