Task that would cause a Trigger

Category: Database Questions    |    0 views    |    Add a Comment
Hi,

I am currently trying to develop my system that would send an email reminder to a user when the deadline for a particular matter is approaching. I did a bit of a research online and I realised that I will need to do some sort of a cron job. However, speaking to my mentor, he told me that I could do some sort of a task scheduling in Microsoft SQL Server 2005 that would automatically cause a trigger at a specific time or at a period of time.

I’ve tried Googling it up but yet, I am left confused and stuck. Can anyone enlighten me with some information regarding this problem that I am facing now? Btw, I am using ASP.NET and MS SQL 2005 Express Edition.

Thanks in advance and really appreciate those who is able to help me.

Share/Save/Bookmark

 

Calling a procedure from Trigger

Category: Database Questions    |    0 views    |    Add a Comment
Hi Group,

I have a small Query regarding calling a procedure from a trigger
please go through the following and please let me knwo if any thing wrong happened.

DELIMITER $$

DROP PROCEDURE IF EXISTS `test`.`sample` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `sample`()
BEGIN
insert into test.out(num,message) select num,name from test.in,hotel
where in.message = hotel.pin;
END $$

DELIMITER ;

create trigger `pull` after insert on `test.in`
for each row
begin
call sample();

When I tried to create a trigger to call the procedure it is throwing error.

so please solve my small Query

Thanks in advance

Share/Save/Bookmark

 

Union Site Search with Relevance

Category: Database Questions    |    0 views    |    Add a Comment
I am building a site search that involves a union of two tables in two databases and needs to have relevancy factored in.
I do not want to use a full-text or boolean search.

I can search one database and one table using relevance fine. I can union the two tables and search without relevance fine. When I put relevance on both tables with the union it no longer works.

Here is the query with union that works:

(SELECT gameID,title FROM searchTest.games 
WHERE((title LIKE ‘%$searchTerm1%’ or author LIKE ‘%$searchTerm1%’ or description LIKE ‘%$searchTerm1%’)))
UNION 
(SELECT postID,title FROM searchTest2.posts WHERE((title LIKE ‘%$searchTerm1%’ or username LIKE ‘%$searchTerm1%’ or content LIKE ‘%$searchTerm1%’) ))

Here is the query on one table with relevance that works:

SELECT gameID,title, ((2*(title LIKE '%$searchTerm1%'))+(1.5*(author LIKE '%$searchTerm1%'))+(1*(description LIKE '%$searchTerm1%')))AS relevance FROM games WHERE(title LIKE '%$searchTerm1%' or author LIKE '%$searchTerm1%' or description LIKE '%$searchTerm1%')AND locked=0 ORDER BY relevance DESC

Here is the query with union and relevance that does not work:

SELECT gameID,title,
 ((2*(title LIKE ‘%$searchTerm1%’))+(1.5*(author LIKE ‘%$searchTerm1%’))+(1*(description LIKE ‘%$searchTerm1%’)))
AS relevance FROM games WHERE
(((title LIKE ‘%$searchTerm1%’ or author LIKE ‘%$searchTerm1%’ or description LIKE ‘%$searchTerm1%’))AND locked=0)
UNION 
SELECT postID,title,
((2*(title LIKE ‘%$searchTerm1%’))+(1.5*(author LIKE ‘%$searchTerm1%’))+(1*(description LIKE ‘%$searchTerm1%’)))
AS relevance FROM searchTest2.posts WHERE
(((title LIKE ‘%$searchTerm1%’ or username LIKE ‘%$searchTerm1%’ or content LIKE ‘%$searchTerm1%’))AND locked=0)

I wouldn’t be surprised if I did something really silly and screwed up a paren or something. I have been working on this for days and just can’t seem to find the mistake that is keeping the union with relevance from running.
Thank you for looking and I hope someone can help!

Share/Save/Bookmark

 

How to Collect data from Alexa ?

Category: Database Questions    |    0 views    |    Add a Comment
How to Collect data from Alexa ?
Where to find a tool or service to Extract Alexa Ranking Data : Website Name, Website URL, Traffic Ranking Number etc. , Save Records to your Database such as MS Access, MS Excel, MySQL etc.

Share/Save/Bookmark