Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql function

Create Function Fn_ToplamaYap(@sayi1 int,@sayi2 int)
Returns int
As
Begin
Declare @toplam int
Set @toplam = @sayi1+ @sayi2
return @toplam
End
Comment

sql function

//the syntax to create a function with input parameters:
CREATE FUNCTION function_name(input_parameter)
RETURNS return_type
AS
BEGIN
DECLARE
--Local Variables to be declared--
--SQL statements--
RETURN return_value
END

//example : 

CREATE FUNCTION [dbo].Circle(@Radius int)
RETURNS real
AS
BEGIN
DECLARE
@Area real
SET @Area=3.14*@Radius*@Radius
RETURN @Area
END


// We will execute the function with the SELECT statement as:
SELECT [dbo].Circle(5) AS Area
Comment

function in sql

CREATE [OR ALTER] FUNCTION <FNAME> (@<PARAMETER NAME1><DATATYPE>[SIZE]
RETURNS <return PARAMETER / ATTRIBUTE /VARIABLE DATATYPE>
AS
BEGIN
<FUNCTION BODY / STATEMENTS>
RETURN <return PARAMETER/ATTRIBUTE/VARIABLE NAME>
END
Comment

PREVIOUS NEXT
Code Example
Sql :: create table from query mysql 
Sql :: t sql return on letters only 
Sql :: how mysql store datetime 
Sql :: sql reverse 
Sql :: Write an SQL query to print details of the Workers whose FIRST_NAME ends with ‘h’ and contains six alphabets. 
Sql :: postgres enumerated type 
Sql :: can sqldatareader be null 
Sql :: mysql current date between two dates 
Sql :: insert value to new table by joining 2 different tables 
Sql :: sql datetime functions 
Sql :: how to compare two columns in sql server 
Sql :: like in sql 
Sql :: update or insert sql 
Sql :: ms sql select datetime as date 
Sql :: sql file in postgres with pgadmin 
Sql :: indexing in mysql 
Sql :: How to drop table in mysql ? 
Sql :: oracle exchange subpartition 
Sql :: create-toys-table-with-toy_name-column 
Sql :: how to install mysql without admin rights 
Sql :: rasa mysql connection custom actions example 
Sql :: 5000/208 
Sql :: hashpass 
Sql :: spfile oracle 
Sql :: events not working db 
Sql :: executescalar in sql server 
Sql :: dumping sql table 
Sql :: how to count with except in psql 
Sql :: INSERT INTO RAHULDEV 
Sql :: oracle sql date summer time 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =