Showing posts with label perform. Show all posts
Showing posts with label perform. Show all posts

Friday, March 9, 2012

I Need to rise to the next level of SQL Programming, Recommendations?

This really isn't a SQL Server specific question, but more tword SQL in general. I am pretty good at SQL, being able to perform joins on several tables at one time. I am looking for more challenges in SQL though as I want to learn more and to rise to the next level. Can anyone recommend some good resources to me?

It would be challenging to me to learn how to do more complex queries involving three or more tables.

Ralph

This forums is a good place to start. Keep checking for questions being asked here and see if you can help out. This way you benefit from learning while the poster benefits from getting his issue resolved.

|||

Subscribe to SQL Server Magazine and read Itzik Ben-Gan's articles religiously. And get his books: very deep T-SQL information. Also, get the Inside SQL Server series of books; Kalen Delaney is the series editor.

These are the best resources available, hands down.

Let us know what you think of them, if you get any, okay?

Don

Sunday, February 19, 2012

I need Help

Hi Freinds,
I need some help on SQL Server.
I need to create a trigger on the update of a particular field in a table.
This trigger has to perform some action after an hour since this field is updated.
Java has a sleep function, does SQL also have something like that.

Please (if ull can)Reply on my personal id.
parul.gulati@.india.birlasoft.com

Thanks and Regards,
ParulSQL Server has:

WAITFOR { DELAY 'time' | TIME 'time' }

The WAITFOR statement suspends the execution of a connection until either:

i) specified time interval has passed.
ii) specified time of day is reached.

Example:
WAITFOR DELAY '00:00:02'

However I would not use this within a trigger. Since a trigger is fired on a event (INSERT,UPDATE,DELETE), that event will also be suspend for an hour (your example), untill the trigger has completed.

If you need to perform some sort of action after an hour, look at:

1) use xp_cmdshell to call an external program which will sleep for the hour, then connect to the DB and perform the action.

2) Look at sp_OA procedures (sp_OACreate, sp_OAMethod, ...) which could be used to run a COM object program.

3) Have the trigger load a seperate table or set a flag indicating an action to be taken, then have a seperate stored procedure perform your work for you, the procedure could be scheduled using SQL Server's scheduler to run every 15 minutes or so.