Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
albertkohl
Aged Yak Warrior
740 Posts |
Posted - 2008-11-24 : 21:48:48
|
| i thought for some reason sql 2005 has a type of "job que" or something?if so, i'm interested in setting it up, and how to add jobs to it via query analyzer or mgt studio, and via vb.netany direction you kind people can point me in?Thanks! |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-11-24 : 22:35:05
|
| Do you mean steps? |
 |
|
|
albertkohl
Aged Yak Warrior
740 Posts |
Posted - 2008-11-24 : 22:54:28
|
| no i mean like, have a program where users can punch in all the parameters for the query, and it enters into a job list and when it's done it send the results... something kinda like that. i thought for some reason sql had something like that. |
 |
|
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2008-11-25 : 00:11:09
|
| SQL Server has all the pieces you'd need to build something like that, but it's not built-in functionality. |
 |
|
|
albertkohl
Aged Yak Warrior
740 Posts |
Posted - 2008-11-25 : 11:54:10
|
| can you point me in any direction by chance? |
 |
|
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2008-11-25 : 22:59:54
|
| Well you basically have to create an app - could be a web or Windows app depending on who will be queueing the the queries. You could save the queries to a table then use a scheduled job (http://msdn.microsoft.com/en-us/library/ms186273(SQL.90).aspx) to run a stored proc at regular intervals to get the queries and execute them. You can send the results with Database Mail (http://msdn.microsoft.com/en-us/library/ms175887(SQL.90).aspx).You could also create a more open queue processor by implementing a Service Broker queue (http://msdn.microsoft.com/en-us/library/ms166043(SQL.90).aspx) to receive the queries and then creating an app (a Windows Service for example) or a scheduled job to process the Service Broker queue. |
 |
|
|
albertkohl
Aged Yak Warrior
740 Posts |
Posted - 2008-11-25 : 23:31:30
|
| my head hurts now, but atleast i got some direction :p i already have a web-app that collects all the parameters, and then executes a stored procedure with it, so i guess now i'll have to work on setting up the scheduled job and database mail, and then tweak everything to work JUUUUST right.Thanks again! |
 |
|
|
albertkohl
Aged Yak Warrior
740 Posts |
Posted - 2008-12-01 : 02:34:10
|
| Okay question. i got the job que set up, so far i'm running into one issue though, i export the results and email them via bcp using temp tables ##count + an idbasically, the job executes a stored procedure, this procedure will come back with a result set from ##count+id. the server then does a BCP export for ##count+id to .csv and emails the file to the user that submitted the query.my problem is, i have a table that i save these quries to (separate for the job que) so that the user kinda has a history of saved counts. i need to figure out how i can save the qty from the result set the stored procedure had and then update the saved count record w/ the total from the stored procedures results.any advice? |
 |
|
|
|
|
|
|
|