Stored procedures and functions

What is the difference between functions and stored procedures in sql server?
what tool we are using in project management tool for developing packages in ssis?
how to rectify the errors in stored procedure in sql server how many ways are there?

Showing Answers 1 - 1 of 1 Answers

Functions

◦can be used with Select statement

◦Not returning output parameter but returns Table variables

◦You can join UDF

◦Can not be used to change server configuration

◦Can not be used with XML FOR clause

◦Can not have transaction within function



Stored Procedure

◦have to use EXEC or EXECUTE

◦return output parameter

◦can create table but won’t return Table Variables

◦you can not join SP

◦can be used to change server configuration

◦can be used with XML FOR Clause

◦can have transaction within SP

SSIS Designer is a graphical tool for creating packages that includes separate tabbed design surfaces for building the control flow, data flow, and event handlers in packages.

Transact-SQL (T-SQL) stored procedures should be treated just like reusable application code. You should follow these suggested guidelines to ensure that your stored procedures are solid and robust: •Check all parameters for valid values and return an error message if a problem exists.


•Be sure that the parameter data types match the column data types they are compared against to avoid data type mismatches and poor query optimization.


•Check the @@error system function after each SQL statement, especially insert, update, and delete, to verify that the statements executed successfully. Return a status code other than 0 if a failure occurs.


•Be sure to comment your code so that when you or others have to maintain it, the code is self-documenting.


•Consider using a source code management system, such as Microsoft Visual Studio SourceSafe, CVS, or Subversion, to maintain versions of your stored procedure source code.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions