Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help to write Stored Procedures..

Status
Not open for further replies.

udayit55

Technical User
Jun 12, 2007
16
US
Hi
I'm new and I need help to write some simple stored procedures... Can somone give me some samples and how to start and execute them...

Your help is appreciated.
 
Look in Books online under Create Procedure.

Questions about posting. See faq183-874
 
well, create proc is used to create stored procedures, exec procName is used to execute procedures, and sometimes, you can just do use procName to run the procedure...

--------------------
Procrastinate Now!
 
First, you'll need to come up with a really good idea for a stored procedure. I got a hundred of them, but their mine and I'm not sharing.

Second, you'll need the right development tools. I suggest you start with, keyboard, computer and monitor (mouse if you insist).

Third, start touching those development tools. Be careful though, because the order is important.

This will surely get you started. When you get this far, feel free to post a followup question (hopefully with more details) so that we can help you better.

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
You could also take a look at the stored procedures in the sample databases.

< M!ke >
Acupuncture Development: a jab well done.
 
gmmastros said:
I got a hundred of them, but their mine and I'm not sharing.

Lamo...

oh, go on, share one...

--------------------
Procrastinate Now!
 
He did. It started with the keyboard

[sub]____________ signature below ______________
You are a amateur developer until you realize all your code sucks.
Jeff Atwood[/sub]
 
Lamo...LMAO?

< M!ke >
Acupuncture Development: a jab well done.
 
>> oh, go on, share one...

OK, but don't tell anyone. [wink]

I was thinking of writing a stored procedure that would calculate the shortest distance between 2 locations on a street network. I already have front end code to do this, but it requires pulling large amounts of data from the DB and then runs through some recursion. I'm thinking that a completely server side solution may speed up the process.

But, seriously... don't tell anyone. [smile]

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
And don't name your stored proc starting with the letters 'sp' because that is what the system stored procs start with and the system will look for system one first, so even if there isn't one, it will slow down the processing.

Questions about posting. See faq183-874
 
I was thinking of writing a stored procedure that would calculate the shortest distance between 2 locations on a street network. I already have front end code to do this, but it requires pulling large amounts of data from the DB and then runs through some recursion. I'm thinking that a completely server side solution may speed up the process.
Didn't Alex already write that?

- Paul
10qkyfp.gif

- If at first you don't succeed, find out if the loser gets anything.
 
And put comments in your procedures so future developers will know what your code was trying to do.

- Paul
10qkyfp.gif

- If at first you don't succeed, find out if the loser gets anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top