Docstoc

شرح بعض دوال sql2005 Programmer shenawy yahoo com hotmail com ‫ا‬ ‫ا ا‬

Document Sample
شرح بعض دوال sql2005 Programmer shenawy yahoo com hotmail com ‫ا‬ ‫ا ا‬ Powered By Docstoc
					Programmer.shenawy@yahoo.com,@hotmail.com



                                 ‫ا‬              ‫ا ا‬
                                     ‫دوال ا‬                  ‫ح‬
                                     Sql2005
                                      sql      ‫دا‬       ‫ا وال ا‬                 ‫- ه ك‬a
                                                               deterministic    ‫1- دوال‬
                      ‫آ ا و ت‬               ‫دا و‬                       ‫- دوال‬
                                             ‫ة‬   ‫آ‬        ‫دة‬     ‫ر ات‬
                                                        nondeterministic ‫2- دوال‬

                                     ‫اى وو‬                      ‫- دوال د‬
                         ‫را‬           ‫اآ‬                     ‫ك دا‬    ‫ن‬                 -b
                                                        ‫,ا‬                ‫ات‬    ‫ا ر‬


                              tb_Master             ‫آ‬   ‫ا‬             ‫ا‬         ‫ول ا ى‬          ‫ا‬




                                                                               ‫ا وال‬        ‫ا‬

                                            ‫ا وال ا‬

Programmer.shenawy@yahoo.com,@hotmail.com
Programmer.shenawy@yahoo.com,@hotmail.com


                                                        LEN (string) -1
                   ‫او‬    ‫اء آ ن‬                   ‫وا‬     ‫را‬          -
            ‫ا را‬              ‫وف ا‬     ‫لا‬               ‫مه ا ا‬       -




                                                                     -
                                                       LTRIM (string)    -2

                                                ‫ا د‬     ‫فا‬       ‫ا‬   -




                                                       RTRIM (string) -3
                                            ‫ا‬     ‫ت‬     ‫فا‬       ‫ا‬   -



Programmer.shenawy@yahoo.com,@hotmail.com
Programmer.shenawy@yahoo.com,@hotmail.com




                                                           LEFT (string, length) -4
                              ‫ا‬       ‫ا‬       ‫ل‬   ‫ا‬       length ‫وف‬    ‫ا‬   ‫د‬   -




                                                          RIGTH (string, length) -5
                                  ‫ا‬       ‫ا‬           ‫ا‬    length ‫وف‬   ‫ا‬   ‫د‬   -




                                                                               -
                            SUBSTRING (string, start, length) -6

Programmer.shenawy@yahoo.com,@hotmail.com
Programmer.shenawy@yahoo.com,@hotmail.com


                        ‫ا‬       ‫ا‬   length ‫ل‬     start       ‫وف ا‬   ‫ا‬        ‫د‬           -




                                                                                         -
                                      REPLACE (search, find, replace) -7
    REPLACE         ‫ا‬       ‫ا‬       ‫ وذ‬replace           ‫ و‬find                      ‫م‬   -




                                                                                         -

                                                             REVERSE (string) -8
                                                                    ‫وف‬   ‫ا‬       ‫ا‬       -




Programmer.shenawy@yahoo.com,@hotmail.com
Programmer.shenawy@yahoo.com,@hotmail.com




                                 CHARINDEX (find, search [, start] -9
                      Start       ‫ ا‬Search              ‫ا‬         ‫ا‬   find ‫ف‬             ‫ا‬       ‫دا‬   -
                                              ‫ا ا‬             ‫ءا‬              start              ‫ان‬   -
                                                                      ‫ع‬       ‫ا‬          ‫ف‬   ‫ا‬   ‫ان‬   -




                         PATINDEX (find, search [, start])                                            -10
              ‫ا‬   ‫ا‬           ‫ و‬index Start         ‫ا‬        search               find                -
                                                            ‫ا ا‬           ‫ا‬        start         ‫ان‬   -
                                                                              ‫ع‬      ‫ا‬           ‫ان‬   -




Programmer.shenawy@yahoo.com,@hotmail.com
Programmer.shenawy@yahoo.com,@hotmail.com




                                                LOWER (string)                  -11
                                                     Small     ‫ا‬       ‫ا‬   ‫لا‬   -




                                                    UPPER (string)              -12
                           Capital   ‫ا‬      ‫ا‬   ‫ا‬      ‫م‬               ‫ا ا ا‬    -




                                                SPACE (integer)                 -13
                                                           ‫ا‬       ‫ا‬   ‫ت‬        -




Programmer.shenawy@yahoo.com,@hotmail.com
Programmer.shenawy@yahoo.com,@hotmail.com




                                                                                    -



                                        ‫ا وال ا‬
                     ROUND (number, length, [function]) -1
           Length ‫ا ل‬             number            ‫مه ا ا‬                          -
                  ‫ا دى‬             ‫ا‬            ‫لا‬                                  -
              23.45 ‫ا‬                  ROUND(123.4545, 2)                           -
                            ‫آ‬        ‫ا‬           ‫لا‬                                 -
              ‫ا‬                         ROUND(123.45, -2)                           -
                                                     100.00
       ‫ا‬    ‫ز دة ا‬   ‫ى اآ‬   ‫ا‬   ‫واذا آ ن ا‬       ‫ا‬       ‫ ب‬function                 -
                       ‫ا ر ما‬                ‫ه‬       ‫ا‬   1 ‫ ب‬function               -
                                                                        ‫ل‬   ‫ا‬   ‫ا‬   -




Programmer.shenawy@yahoo.com,@hotmail.com
Programmer.shenawy@yahoo.com,@hotmail.com




                                  ISNUMERIC(expressions) -2
                                       0    ‫ذ‬   ‫1و‬           ‫ر‬   ‫اذا آ‬       ‫ا‬   -




                                                 ABS (number) -3
                                                     ‫ا‬   ‫ا‬               ‫ا‬   ‫ا‬   -




Programmer.shenawy@yahoo.com,@hotmail.com
Programmer.shenawy@yahoo.com,@hotmail.com




                                                                                                                    -
                                                            CEILING (number) -4
                       ‫ارا م‬       ‫ى‬        ‫ا‬          ‫اذا آ ن ا‬       ‫وا‬    ‫ا‬                  ‫ا‬                   -
                                            ‫ا‬           ‫ع‬          ‫ا‬                  ‫ون ار م‬           ‫اذا آ ن ر‬   -




                                                              FLOOR (number) -5
                     ‫ى‬         ‫ا‬       ‫فا‬                                        ‫بر‬                 ‫ع‬          ‫- ا‬




                                                                                                                    -
                                                                            RAND ([seed]) -6
                                                             ‫وا ا‬            ‫ا‬              ‫ا‬                       -
                                       ‫ا‬                               ‫ ر‬tinyint            ‫ه ر‬Speed                -
                                   ‫ة‬   ‫آ‬        ‫ن وا‬                    ‫ا‬        ‫نا‬     ‫ا‬                           -




Programmer.shenawy@yahoo.com,@hotmail.com
Programmer.shenawy@yahoo.com,@hotmail.com




                                                                  -

                          ‫وا‬   ‫دوال ا ر‬
                                                        GetDate -1
                                       sql   ‫وا ر‬       ‫ع‬    ‫دا‬   -




                                              GETUTCDATE -2
                                                    ‫م‬    ‫ا‬   ‫ع‬    ‫ا‬


Programmer.shenawy@yahoo.com,@hotmail.com
Programmer.shenawy@yahoo.com,@hotmail.com




                                                                     DAY (date) -3
                                                ‫ا‬   ‫ا ر‬         ‫ا‬     ‫ا ر‬     -




                                                                              -
                                                              MONTH (date) -4
                                                          ‫ا‬   ‫ا ر‬       ‫ا‬     -




                                                                    YEAR (date) -5
                                                          ‫ا‬    ‫ا ر‬      ‫ا‬     -




                                 DATENAME (datepart, date) -6
                                      ‫ا‬   ‫ا ر‬        ‫ءا ر‬      Datepart ‫ب‬     -

Programmer.shenawy@yahoo.com,@hotmail.com
Programmer.shenawy@yahoo.com,@hotmail.com


                                                              ‫آ‬   -




                                            ‫آ‬   ‫اء ا ر‬   ‫ءا‬       ‫7- ا‬




Programmer.shenawy@yahoo.com,@hotmail.com
Programmer.shenawy@yahoo.com,@hotmail.com


                           DATEADD (datepart, number, date) -8
 number ‫د‬       datepart   ‫ءا ر‬      ‫ا‬    date         ‫رة‬       ‫ر‬   ‫ع‬         ‫مه ا ا‬        -




                      DATEDIFF (datepart, startdate, enddate) -9
     ‫ع‬      ‫ر‬    ‫رة‬   enddate     ‫ و‬Startdate ٍ    ‫ؤ‬        ‫ق‬       ‫ع‬         ‫مه ا ا‬        -
                                                                             datepart
                                                                                   ..   ‫آ‬   -




                                             ISDATE (expression)                            -10
                                    ‫ام‬   ‫ر‬        ‫ه ه‬                   ‫ا‬      ‫ا‬      -
                                                  0‫دب‬                    ‫ر‬         ‫- ان‬
                                                    1‫دب‬                      ‫- ان آ ن ر‬




Programmer.shenawy@yahoo.com,@hotmail.com
Programmer.shenawy@yahoo.com,@hotmail.com




                                                        CASE      -11
    ‫د‬      ‫ا‬      ‫ر وه‬    ‫آ ا‬               ‫د‬   ‫و‬   ‫ا‬    ‫ا ا‬   ‫- ه‬
                                                          ‫ال‬    ‫ا‬




Programmer.shenawy@yahoo.com,@hotmail.com
Programmer.shenawy@yahoo.com,@hotmail.com




                                                       ISNULL       -12
                     ‫او و‬                   null         ‫ا‬          -




               OVER ([<partition_by_clause>] <order_by_clause>)     -13
                                                    ROW_Number
                            ‫تا‬                            ‫ف‬   ‫ا‬     -
                                                   ......  ‫ا لا‬   ‫- ا‬




Programmer.shenawy@yahoo.com,@hotmail.com

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:32
posted:1/15/2012
language:
pages:15