MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old April 18th, 2004, 07:00 PM
divi2323 divi2323 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 1 divi2323 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
call stored procedure for each value in a table

I’m fairly new to this group. My company has put me in charge of datawarehousing for our Automatic Call distribution data so that we can report on it later with Crystal Reports.

Currently we do not control our own ACD system for the helpdesk and thus we are generating reports on a 15 minute interval basis. There are 4 reports which run each 15 minute interval and parsing them is easy using a Vbscript and importing them into a database.

However, I’d like to move away from the vbscript approach and use TSQL coupled with job scheduling with Microsoft SQL 2000 to do the same thing.

I’m fairly new to SQL and have the basic essentials needed to query and update and insert data, and my company has scheduled more training for me, however my classes are not offered until mid July and I’d like to get a jump start on this.

My situation is this:

I’ve got a list of filenames in a directory stored in a table on the SQL server. It updates itself with a stored procedure I wrote and it works fine. The table consists only of a list of filenames.

I’d like to execute a stored procedure for each item in this list using the filename as a parameter. It sounds like a simple task but I’m racking my brain here trying to figure it out.

Does anyone have a solution to this problem?

Thanks,

Reply With Quote
  #2  
Old April 19th, 2004, 01:26 AM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,394 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 8 h 28 m 50 sec
Reputation Power: 715
Look in your Books Online documentation for "cursors, fetching". There's even an example on that page to show you how to go through a result set, one row at a time. However, cursors should be used only as a last resort, since they are rather inefficient. Is it possible for you to write another stored procedure that joins to the filename table and does its thing?
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > call stored procedure for each value in a table


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway