Search
 
SCRIPT & CODE EXAMPLE
 

SQL

recursive stored procedure in sql server

CREATE PROCEDURE [dbo].[Factorial_ap]

(
    @Number Integer,
    @RetVal Integer OUTPUT

)

AS
    DECLARE @In Integer
    DECLARE @Out Integer
    IF @Number != 1
        BEGIN
        SELECT @In = @Number – 1
        EXEC Factorial_ap @In, @Out OUTPUT
        SELECT @RetVal = @Number * @Out
    END
        ELSE
            BEGIN
                SELECT @RetVal = 1
            END

RETURN
Comment

PREVIOUS NEXT
Code Example
Sql :: can we rollback data that are deleted using delete clause? 
Sql :: will graphql replace sql 
Sql :: sqlite3 get data from table c 
Sql :: mysql collation portugues brasil 
Sql :: naming conventions postgres index 
Sql :: configurer mysqlwampserver a distance 
Sql :: how to update date in oracle 
Sql :: datetrunc hour snowflake 
Sql :: SQL Primary Key single column 
Sql :: sql run online 
Sql :: parent: [Error: SQLITE_READONLY: attempt to write a readonly database] { 
Sql :: open database restricted mode oracle 
Sql :: sql Contain declare sample 
Sql :: PSQL qith variables 
Sql :: add plugins to mysql workbench 
Sql :: database restoring error 
Sql :: sql equal then arrow 
Sql :: INSERT INTO RAHULDEV 
Sql :: postgres create table like another table 
Sql :: heroku postgres permission denied 
Sql :: find invalid datetime field 
Sql :: como hacer una consulta en sql 
Sql :: group_concat only returns one row 
Sql :: how to add session data into mysql database from button 
Sql :: compound operator in sql 
Sql :: sql server convert string list integers list 
Sql :: sql file md5 
Sql :: current month mysql query 
Sql :: how to make full text search dynamic in mysql 
Sql :: Postgres: Update Boolean column with false if column contains null 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =