Sql server function

Sanjay Verma replied to Lokesh M at 04-Jul-08 05:17
See the simple syntax of a function for getting the height and width multiplies as integer.

Create function get_int (@height int ,@width int)
returns int
as     
Begin
return (@height*@width)
End


How to call a function inside Stored Procedure

Suppose you are having a variable i with datatype integer in the stored proc.

SET i = myschema.get_int(5,8);

where get_int() is some function returning a value compatible with the
datatype of i.

You can use the functions anywhere you want, like in condition checks (IF, WHILE, etc).

Hope it helps.
Biography
Asp.Net Developer


Click here to sign in and reply. You could earn money via our $500 contest just for being helpful.
  SQL Server Function - Lokesh M  04-Jul-08 01:05 1:05:10 AM
      create a function in sql server and call from stroed proc - Deepak Ghule  04-Jul-08 01:40 1:40:18 AM
      create a function in sql server and call from stroed proc - Deepak Ghule  04-Jul-08 01:40 1:40:37 AM
      Use this way - A K  04-Jul-08 01:44 1:44:14 AM
      UDF - mv ark  04-Jul-08 01:47 1:47:42 AM
      SQL Server Function - Umapathy Kaliaperumal  04-Jul-08 02:15 2:15:25 AM
      Check this out - santhosh kumar  04-Jul-08 02:17 2:17:16 AM
      Sql server function - Sanjay Verma  04-Jul-08 05:17 5:17:30 AM
View Posts

promotion
Silverlight    WPF    WCF    WWF    LINQ   
JavaScript    AJAX    ASP.NET    XAML   
C#    VB.NET    VB 6.0    GDI+    IIS    XML   
.NET Generics    Anonymous Methods    Delegate   
Visual Studio .NET    Expression Blend    Virus   
Windows Vista    Windows XP    Windows Update   
Windows 2003 Server    Windows 2008 Server   
SQL Server    Microsoft Excel    Microsoft Word   
SharePoint    BizTalk    Virtual Earth   
.NET Compact Framework    Web Service   


"Everything" RSS / ATOM Feed Parser
How to send and receive messages through message queuing in .Net
How to Read text file as database
SQL Server 2005 Paging Performance Tip
Display code of web page.
Fully Scalable Excel File Importer class for .net using Microsoft Jet driver
Generic Chart Color Manager class that can be used for any charts
Helper class to style the infragistics wingrid
Using Reflection to detemine as Assembly Info in and out.
Helper class to play with Window (Owners and position)
Resolving displayname from the culture using the XmlLanguage and LanguageSpecificStringDictionary class