• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            xyjzsh

            sqlserver2008里面的游標(biāo)

             SQL是一種基于集合的語言(a set-based language) ,他更擅長(zhǎng)操作和提出一組數(shù)據(jù),而不是對(duì)
             數(shù)據(jù)進(jìn)行一行一行的處理。
             SQL is a set-based language ,meaning that is excels at mantipulating and retrieving
             set of rows ,rather than performing single row-by-row processing.
             如果你的程序里一定要一條一條的執(zhí)行,那么一定要先考慮使用如while循環(huán),子查詢,
             臨時(shí)表,表變量等等,如果這些都不能滿足要求,在考慮使用游標(biāo)。
             
             T-SQL中游標(biāo)的生存周期:
             1.用返回一個(gè)有效結(jié)果集的sql語句來定義一個(gè)游標(biāo)。
              a cursor is defined via a SQL statement that returns a valid result set.
             2. 打開游標(biāo)
             3. 一旦游標(biāo)被打開就可以從游標(biāo)中每次取出一行數(shù)據(jù),要根據(jù)游標(biāo)的定義可以向前去數(shù)據(jù)或
             向后取數(shù)據(jù)
             the rows can be fetched moving forword or backword ,depending on the original cursor definition.
             4. 根據(jù)游標(biāo)的類型,數(shù)據(jù)可以被修改或者只能讀。
             5.最后,用完游標(biāo)后,必須被顯示的關(guān)閉,并且從內(nèi)存中移除。
             
             游標(biāo)定義格式:
             declare cursor_name cursor
             [local|global]
             [forword_only|scroll]
             [static|keyset|dynamic|fast_forword]
             [read_only| scroll_locks|optimistic]
             [type_warning]
             for select_statement[for update [of column[,...]]]
             
            The select_statement argument is the query used to define the data within the cursor. Avoid
            using a query that hasmore columns and rows than will actually be used, because cursors, while
            open, are kept inmemory. The UPDATE [OF column_name [,...n]] is used to specify those columns
            that are allowed to be updated by the cursor.
             

            posted on 2011-11-03 16:28 呆人 閱讀(1689) 評(píng)論(0)  編輯 收藏 引用 所屬分類: sqlserver2008

            <2011年11月>
            303112345
            6789101112
            13141516171819
            20212223242526
            27282930123
            45678910

            導(dǎo)航

            統(tǒng)計(jì)

            常用鏈接

            留言簿(1)

            隨筆分類

            隨筆檔案

            搜索

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            亚洲精品美女久久777777| 97久久精品午夜一区二区| 久久久久九九精品影院| 久久久久亚洲精品无码网址| 一级a性色生活片久久无少妇一级婬片免费放 | 久久久一本精品99久久精品88| 精品无码久久久久久午夜| 久久黄视频| 国产精品久久久久国产A级| 欧美久久一级内射wwwwww.| 久久久亚洲欧洲日产国码aⅴ| 国产精品女同一区二区久久| 久久精品国产2020| 久久国产精品视频| 青草国产精品久久久久久| 武侠古典久久婷婷狼人伊人| 99久久久精品| 亚洲精品tv久久久久久久久| 久久精品国产精品亚洲人人 | 狠狠色丁香久久综合五月| 要久久爱在线免费观看| 青草影院天堂男人久久| 久久久噜噜噜久久中文福利| 欧美日韩精品久久久免费观看| 成人久久综合网| 久久久久久亚洲精品成人| 久久人人爽人人爽人人片AV不| 久久久久九国产精品| 国产成人精品久久综合| 日本精品久久久中文字幕| 国产成人综合久久综合| 亚洲欧美日韩中文久久| 777午夜精品久久av蜜臀| 精品久久久久成人码免费动漫| 精品久久久久久国产牛牛app| 91精品国产综合久久精品| 久久国产色AV免费看| 久久精品黄AA片一区二区三区| 久久久亚洲欧洲日产国码二区| 久久亚洲精品无码AV红樱桃| 成人免费网站久久久|