黄色在线观看视频-黄色在线免费看-黄色在线视频免费-黄色在线视频免费看-免费啪啪网-免费啪啪网站

首頁 考試吧論壇 Exam8視線 考試商城 網絡課程 模擬考試 考友錄 實用文檔 求職招聘 論文下載
2011中考 | 2011高考 | 2012考研 | 考研培訓 | 在職研 | 自學考試 | 成人高考 | 法律碩士 | MBA考試
MPA考試 | 中科院
四六級 | 職稱英語 | 商務英語 | 公共英語 | 托福 | 雅思 | 專四專八 | 口譯筆譯 | 博思 | GRE GMAT
新概念英語 | 成人英語三級 | 申碩英語 | 攻碩英語 | 職稱日語 | 日語學習 | 法語 | 德語 | 韓語
計算機等級考試 | 軟件水平考試 | 職稱計算機 | 微軟認證 | 思科認證 | Oracle認證 | Linux認證
華為認證 | Java認證
公務員 | 報關員 | 銀行從業資格 | 證券從業資格 | 期貨從業資格 | 司法考試 | 法律顧問 | 導游資格
報檢員 | 教師資格 | 社會工作者 | 外銷員 | 國際商務師 | 跟單員 | 單證員 | 物流師 | 價格鑒證師
人力資源 | 管理咨詢師考試 | 秘書資格 | 心理咨詢師考試 | 出版專業資格 | 廣告師職業水平
駕駛員 | 網絡編輯
衛生資格 | 執業醫師 | 執業藥師 | 執業護士
會計從業資格考試會計證) | 經濟師 | 會計職稱 | 注冊會計師 | 審計師 | 注冊稅務師
注冊資產評估師 | 高級會計師 | ACCA | 統計師 | 精算師 | 理財規劃師 | 國際內審師
一級建造師 | 二級建造師 | 造價工程師 | 造價員 | 咨詢工程師 | 監理工程師 | 安全工程師
質量工程師 | 物業管理師 | 招標師 | 結構工程師 | 建筑師 | 房地產估價師 | 土地估價師 | 巖土師
設備監理師 | 房地產經紀人 | 投資項目管理師 | 土地登記代理人 | 環境影響評價師 | 環保工程師
城市規劃師 | 公路監理師 | 公路造價師 | 安全評價師 | 電氣工程師 | 注冊測繪師 | 注冊計量師
繽紛校園 | 實用文檔 | 英語學習 | 作文大全 | 求職招聘 | 論文下載 | 訪談 | 游戲

三級數據庫:有用的SQLServer語句和存儲過程

來源:考試吧Exam8.com) 2010-3-17 17:46:09 考試吧:中國教育培訓第一門戶 模擬考場
本文為“計算機三級數據庫:有用的SQLServer語句和存儲過程”,以供廣大學員參考使用。更多關于計算機等級考試資料,請訪問考試吧計算機等級考試頻道。

  CREATE proc proc_insert (@tablename varchar(256))

  as

  begin

  set nocount on

  declare @sqlstr varchar(4000)

  declare @sqlstr1 varchar(4000)

  declare @sqlstr2 varchar(4000)

  select @sqlstr='select 'insert '+@tablename

  select @sqlstr1='

  select @sqlstr2=' ('

  select @sqlstr1= ' values ( '+'

  select @sqlstr1=@sqlstr1+col+'+','+' ,@sqlstr2=@sqlstr2+name +',' from (select case

  -- when a.xtype =173 then 'case when '+a.name+' is null then 'NULL' else '+'convert(varchar('+convert(varchar(4),a.length*2+2)+'),'+a.name +')'+' end'

  when a.xtype =104 then 'case when '+a.name+' is null then 'NULL' else '+'convert(varchar(1),'+a.name +')'+' end'

  when a.xtype =175 then 'case when '+a.name+' is null then 'NULL' else '+'''''+'+'replace('+a.name+','''','''''')' + '+'''''+' end'

  when a.xtype =61 then 'case when '+a.name+' is null then 'NULL' else '+'''''+'+'convert(varchar(23),'+a.name +',121)'+ '+'''''+' end'

  when a.xtype =106 then 'case when '+a.name+' is null then 'NULL' else '+'convert(varchar('+convert(varchar(4),a.xprec+2)+'),'+a.name +')'+' end'

  when a.xtype =62 then 'case when '+a.name+' is null then 'NULL' else '+'convert(varchar(23),'+a.name +',2)'+' end'

  when a.xtype =56 then 'case when '+a.name+' is null then 'NULL' else '+'convert(varchar(11),'+a.name +')'+' end'

  when a.xtype =60 then 'case when '+a.name+' is null then 'NULL' else '+'convert(varchar(22),'+a.name +')'+' end'

  when a.xtype =239 then 'case when '+a.name+' is null then 'NULL' else '+'''''+'+'replace('+a.name+','''','''''')' + '+'''''+' end'

  when a.xtype =108 then 'case when '+a.name+' is null then 'NULL' else '+'convert(varchar('+convert(varchar(4),a.xprec+2)+'),'+a.name +')'+' end'

  when a.xtype =231 then 'case when '+a.name+' is null then 'NULL' else '+'''''+'+'replace('+a.name+','''','''''')' + '+'''''+' end'

  when a.xtype =59 then 'case when '+a.name+' is null then 'NULL' else '+'convert(varchar(23),'+a.name +',2)'+' end'

  when a.xtype =58 then 'case when '+a.name+' is null then 'NULL' else '+'''''+'+'convert(varchar(23),'+a.name +',121)'+ '+'''''+' end'

  when a.xtype =52 then 'case when '+a.name+' is null then 'NULL' else '+'convert(varchar(12),'+a.name +')'+' end'

  when a.xtype =122 then 'case when '+a.name+' is null then 'NULL' else '+'convert(varchar(22),'+a.name +')'+' end'

  when a.xtype =48 then 'case when '+a.name+' is null then 'NULL' else '+'convert(varchar(6),'+a.name +')'+' end'

  -- when a.xtype =165 then 'case when '+a.name+' is null then 'NULL' else '+'convert(varchar('+convert(varchar(4),a.length*2+2)+'),'+a.name +')'+' end'

  when a.xtype =167 then 'case when '+a.name+' is null then 'NULL' else '+'''''+'+'replace('+a.name+','''','''''')' + '+'''''+' end'

  else ''NULL''

  end as col,a.colid,a.name

  from syscolumns a where a.id = object_id(@tablename) and a.xtype <>189 and a.xtype <>34 and a.xtype <>35 and a.xtype <>36

  )t order by colid

  select @sqlstr=@sqlstr+left(@sqlstr2,len(@sqlstr2)-1)+') '+left(@sqlstr1,len(@sqlstr1)-3)+')' from '+@tablename

  -- print @sqlstr

  exec( @sqlstr)

  set nocount off

  end

  GO

上一頁  1 2 3 4 5  下一頁
  相關推薦:計算機三級數據庫:SQL查詢語句精華使用簡要
       數據庫:無數據庫日志文件恢復數據庫方法兩則
       計算機三級數據庫:數據庫設計范式(實例)
文章搜索
版權聲明:如果計算機等級考試網所轉載內容不慎侵犯了您的權益,請與我們聯系800@exam8.com,我們將會及時處理。如轉載本計算機等級考試網內容,請注明出處。
主站蜘蛛池模板: 欧美一级高清片欧美国产欧美 | 免费人成激情视频在线观看冫 | 国产综合色香蕉精品五月婷 | 婷婷综合色 | 色综合久久五月 | 午夜三级影院 | 爱搞视频首页在线 | 性性影院在线观看 | 免费乱理伦片在线观看影院 | 99精品全国免费观看视频.. | 美日韩视频 | 国产成人精品综合网站 | 国产最新进精品视频 | 亚洲一区二区免费在线观看 | 国产免费a视频 | 午夜伦理视频 | 最近高清中文字幕大全1 | 国产区成人精品视频 | 成人影院免费在线观看 | 永久免费视频v片www | 日韩三级中文字幕 | 日本免费一区二区视频 | 午夜www| 甜性涩爱在线观看e8 | 欧美激情一区二区三区 | 欧美日韩国产成人精品 | 天天干天天拍天天射天天添天天爱 | 日韩伦理片在线 | 最新中文字幕在线播放 | 91在线免费公开视频 | 亚欧毛片基地国产毛片基地 | 欧美激情精品久久久久久久 | 精品国产高清自在线一区二区三区 | 中国黄色a | www.人人| 美女视频网站黄 | 日韩video| 韩日一级毛片 | 性xxxfreexxxx性欧美 | 免费观看亚洲视频 | 国产三级国产精品国产普男人 |