Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa SQL How to convert Mssql Procedure into Mysql Procedure.

Have Programming Question? Ask it here!
 
 
 


vikas pandey
How to convert Mssql Procedure into Mysql Procedure.
0 Answer(s)      a year and 7 months ago
Posted in : SQL


Hello Sir, I have a mssql procedure and i need it to be converted to mysql ...

Below is my mssql procedure code..

 WITH    CTE
              AS ( SELECT   ROW_NUMBER() OVER ( ORDER BY CASE
                                                          WHEN @SortColumnName = 'UserID'
                                                          AND @SortOrderBy = 'asc'
                                                          THEN UserID
                                                         END ASC, CASE
                                                          WHEN @SortColumnName = 'UserID'
                                                          AND @SortOrderBy = 'desc'
                                                          THEN UserID
                                                          END DESC, CASE
                                                          WHEN @SortColumnName = 'UserName'
                                                          AND @SortOrderBy = 'asc'
                                                          THEN UserName
                                                          END ASC, CASE
                                                          WHEN @SortColumnName = 'UserName'
                                                          AND @SortOrderBy = 'desc'
                                                          THEN UserName
                                                          END DESC, CASE
                                                          WHEN @SortColumnName = 'FirstName'
                                                          AND @SortOrderBy = 'asc'
                                                          THEN FirstName
                                                          END ASC, CASE
                                                          WHEN @SortColumnName = 'FirstName'
                                                          AND @SortOrderBy = 'desc'
                                                          THEN FirstName
                                                          END DESC , CASE
                                                          WHEN @SortColumnName = 'MiddleName'
                                                          AND @SortOrderBy = 'asc'
                                                          THEN MiddleName
                                                          END ASC, CASE
                                                          WHEN @SortColumnName = 'MiddleName'
                                                          AND @SortOrderBy = 'desc'
                                                          THEN MiddleName
                                                          END DESC , CASE
                                                          WHEN @SortColumnName = 'LastName'
                                                          AND @SortOrderBy = 'asc'
                                                          THEN LastName
                                                          END ASC, CASE
                                                          WHEN @SortColumnName = 'LastName'
                                                          AND @SortOrderBy = 'desc'
                                                          THEN LastName
                                                          END DESC, CASE
                                                          WHEN @SortColumnName = 'EmailID'
                                                          AND @SortOrderBy = 'asc'
                                                          THEN EmailID
                                                          END ASC, CASE
                                                          WHEN @SortColumnName = 'EmailID'
                                                          AND @SortOrderBy = 'desc'
                                                          THEN EmailID
                                                          END DESC ) AS RN ,
                            UserID ,
                            UserName ,
                            FirstName ,
                            MiddleName ,
                            LastName ,
                            EmailID
                   FROM     [Users]
                 )
        SELECT  UserID ,
                UserName ,
                FirstName ,
                LastName ,
                MiddleName ,
                EmailID
        FROM    CTE
        WHERE   RN BETWEEN @StartRow - @NumberOfRows
                   AND     @StartRow - 1

Plz sir help me to convert it into mysql procedure.

Thank you very much Sir.


Advertisement
View Answers

Related Tutorials/Questions & Answers:
 

 

 

DMCA.com