SP newbee tips? 
Author Message
 SP newbee tips?
Hello

I've never done a SP before and now I need to learn some, I've used sql
in 2 years using ASP with regular queries (insert/update/select/joins
and such) and some tsql (create db/table/..) queries. What should I
start with? are there any easy examples available somewhere so I can see
how it's different from the queries I've been using? Soon I need to
build a SP that runs each day and mails everyone from a mailing list
using the built-in sql-mail. Is that very hard to do?

I'd appreciate any help
/Lasse



Mon, 21 Jul 2003 06:44:31 GMT
 SP newbee tips?

A stored procedure is nothing more than a SELECT (for example) wrapped
within a  CREATE PROCEDURE procname ......GO

There are multiple ways to email many people you can write a cursor (row by
row operation) to use master..xp_sendmail to send the emails.  Read up on
cursor and xp_sendmail within Books Online if you want more information.
OR
You could call a SELECT stored procedure and have your middle tier
application send the emails...

--
Keith
==============
Please reply only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which
can be cut and pasted into Query Analyzer is appreciated.


Quote:
> Hello

> I've never done a SP before and now I need to learn some, I've used sql
> in 2 years using ASP with regular queries (insert/update/select/joins
> and such) and some tsql (create db/table/..) queries. What should I
> start with? are there any easy examples available somewhere so I can see
> how it's different from the queries I've been using? Soon I need to
> build a SP that runs each day and mails everyone from a mailing list
> using the built-in sql-mail. Is that very hard to do?

> I'd appreciate any help
> /Lasse



Mon, 21 Jul 2003 23:53:26 GMT
 SP newbee tips?
The hard part would be getting sql mail to work. <g>  I've had enormous
difficult ensuring reliability when using sql mail, but that's just _my_
experience.  maybe i suck.

ffoiii


Quote:
> Hello

> I've never done a SP before and now I need to learn some, I've used sql
> in 2 years using ASP with regular queries (insert/update/select/joins
> and such) and some tsql (create db/table/..) queries. What should I
> start with? are there any easy examples available somewhere so I can see
> how it's different from the queries I've been using? Soon I need to
> build a SP that runs each day and mails everyone from a mailing list
> using the built-in sql-mail. Is that very hard to do?

> I'd appreciate any help
> /Lasse



Tue, 05 Aug 2003 17:39:57 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. sp writing tip

2. MS Tips Engine Services tips.exe Application Error

3. SP:ExecContextHit,SP:CacheMiss,SP:CacheInsert

4. newbee seeks upgrade help

5. sql 7 newbee

6. Newbee: Trigger problem

7. Newbee Quetion :-)

8. Newbee: How to connect through perl

9. newbee crystal report question

10. newbee

11. Newbee Question

12. dynamic sql - newbee question


 
Powered by phpBB® Forum Software