随笔分类 -  SQL SERVER

摘要:sql server里 临时表是在系统数据库tempdb里的 所以如下:1ifobject_id('tempdb.#tmp_table')isnotnull2droptable#tmp_table 阅读全文

posted @ 2006-03-25 23:13 ting 阅读(288) 评论(0) 推荐(0) |

摘要:1declare@xxml2set@x='<bookgenre="security"publicationdate="2002"ISBN="0-7356-1588-2">3<title>WritingSecureCode</title>4<author>5<first-name>Michael</first-name>6<... 阅读全文

posted @ 2006-03-24 14:49 ting 阅读(324) 评论(0) 推荐(0) |

摘要:1Declare@xlevelsysname--定义表名2set@xlevel='table1'3declare@numint,@sqlsnvarchar(100)4set@sqls='select@a=count(*)from'+@xlevel5execsp_executesql@sqls,N'@aintoutput',@numoutput6select@num7 阅读全文

posted @ 2006-03-24 10:58 ting 阅读(508) 评论(0) 推荐(0) |

博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3