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.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Stored Procedure

Author  Topic 

jcb267
Constraint Violating Yak Guru

291 Posts

Posted - 2011-04-21 : 09:58:53
How and why would you write a stored procedure?

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-04-21 : 10:05:32
Because all the cool kids use stored procedures.

There are a number of benefits listed here: http://msdn.microsoft.com/en-us/library/aa174792(v=sql.80).aspx
Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-04-21 : 10:06:10
Why - For all database access because it's more secure, flexible, maintainable and better?

how
create procedure ...
as
...


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

jcb267
Constraint Violating Yak Guru

291 Posts

Posted - 2011-04-21 : 10:24:45
Do they make queries run faster and more efficient?
quote:
Originally posted by nigelrivett

Why - For all database access because it's more secure, flexible, maintainable and better?

how
create procedure ...
as
...


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.

Go to Top of Page

jcb267
Constraint Violating Yak Guru

291 Posts

Posted - 2011-04-21 : 10:25:48
In that case I must learn how to do them.....

Thanks for the info!
quote:
Originally posted by robvolk

Because all the cool kids use stored procedures.

There are a number of benefits listed here: http://msdn.microsoft.com/en-us/library/aa174792(v=sql.80).aspx

Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-04-21 : 10:44:27
quote:
Originally posted by jcb267

Do they make queries run faster and more efficient?
quote:
Originally posted by nigelrivett

Why - For all database access because it's more secure, flexible, maintainable and better?

how
create procedure ...
as
...


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.





Probably not but it makes it easier to see the execution plan and to optimise - and gives you more flexibility to optimise.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -