- 浏览: 88316 次
- 性别:
- 来自: 鞍山
最新评论
-
mqlfly2008:
这个时钟会不会在页面访问后,客户端调节了时间,从而让时间不准确 ...
js取服务器时间显示时钟 -
chendu135:
这个挺好,可不可以在match()里面判断下一,除了字母或者汉 ...
js获取字符串长度(区分中英文)
drop proc proc_insert go 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 into '+@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 =127 then 'case when '+a.name+' is null then ''NULL'' else '+'convert(varchar(20),'+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 select * from systypes
使用方法:
exec proc_insert 你的表名
发表评论
-
(转)电脑开机报警说明
2011-11-11 10:31 1045电脑开机启动时听到机箱小喇叭发出的各种不同的“嘟”声,其实这是 ... -
(转)win xp启动蓝屏代码说明
2011-11-11 10:11 1192一、0X0000000A 这个蓝屏代码和硬件无关,是驱 ... -
word报错,需要进入安全模式才能启动
2011-03-21 15:04 1071一、问题原因:word只能用安全模式才能打开双击word文件后 ... -
解决软件安装“无法使用此产品的安装源,请确认安装源存在并且你可以访问它”
2011-03-21 15:01 6675有时候,我安装某些软件的时候,会出现以下信息“无法使用此产 ... -
用javascript 判断IE窗口是否打开
2010-10-28 17:38 1446点击父页面上的按钮,打开一个新的页面(子页面),如果子页 ... -
IE与FF兼容在JS方面要注意的一些问题
2010-10-13 09:09 842关于IE、Firefox、Opera页 ... -
js只能输入数字和小数点
2010-09-21 16:58 10121 第一个输入必须是数字,不能是小数点。例如.111 2 不能 ... -
css控制打印内容样式
2010-08-26 14:01 912<style type="text/css ... -
java读写properties文件(转)
2010-06-22 18:06 695直接代码,注释比较详 ... -
(转)软件界面设计经验
2010-06-12 10:30 834在我的记忆中,很多项 ... -
(转)IDEA快捷键
2010-06-12 10:25 727在使用InelliJ IDEA的过程中,通过查找资料以及一些自 ... -
iframe高度自适应(转载)
2010-05-11 15:52 847正在踌躇的时候发现下面的这段代码,终于得意解决。苦于对js没有 ... -
PHP5.3.2+APACHE2.2
2010-04-27 23:39 872Apache的安装与配置 打开apache官方网站 http ... -
可编辑下拉框
2010-04-07 08:24 1544可编辑的下拉框,由input和select组合成,将slele ... -
EditPlus配置JAVA开发环境
2010-03-24 17:47 1005初学者更适合使用文本编辑软件来学习Java,对Java有一定认 ... -
DIV仿frame框架
2010-03-24 13:50 16972行2列 <!DOCTYPE html PUBLIC & ... -
JS弹出窗口
2010-03-24 11:18 837<!DOCTYPE html PUBLIC " ... -
js分页代码
2010-03-24 10:47 2629<!doctype html public " ... -
div居中的一种方法
2010-03-23 21:32 1063以前用表格布局时设置网页居中非常方便,把表格对齐方式设 ... -
VC6.0-Error spawning cl.exe
2010-03-15 09:44 1868可能很多人在安装VC 6.0后有过点击“Compile”或者“ ...
评论