Archive : 个人收藏

RSS feed

将sqlserver表中的数据导出sql语句

输入表名,生成插入语句

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 '+@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

Read more...

Filed in: 个人收藏
2

8.15-10.1

100917153757 8.15 10.1

Filed in: 个人收藏
8

简单的llmp(Litespeed+mysql+php)安装教程

(时间比较急,难免有错误)

Litespeed是商业软件的,但也有免费版,而且免费版功能都很强大了,其中的实时查看每个站的链接数,实时查看每个站的in/out的流量大小.这2个功能就已经非常讨我喜欢了...更多功能,自己安装体验吧,下面是安装教程.

我选择的操作系统是CentOS,mysql版本5.1.50,php版本为5.3.3

首先用yum命令安装,升级所需的程序库

yum -y install yum-fastestmirror
yum -y update
yum -y remove httpd
yum -y install patch make gcc gcc-c++ gcc-g77 flex bison tar
yum -y install libtool libtool-libs kernel-devel autoconf213
yum -y install libjpeg libjpeg-devel libpng libpng-devel
yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel
yum -y install file glib2 glib2-devel bzip2 diff* openldap-devel
yum -y install bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs
yum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-devel
yum -y install openssl openssl-devel vim-minimal unzip vixie-cron
yum -y install fonts-chinese scim-chewing scim-pinyin scim-tables-chinese
export PHP_AUTOCONF=/usr/bin/autoconf-2.13
export PHP_AUTOHEADER=/usr/bin/autoheader-2.13

Read more...

Filed in: 个人收藏
17

日本街头为什么这么多摇小旗的?

我每到国外都喜欢在大街小巷随意走,看看建筑,拍拍照片。

一天,我在东京逛街,不到一个小时的时间,遇到了好几个摇小旗的人。他们为什么在街上摇小旗呢?我们来看看照片。

205410D5z 日本街头为什么这么多摇小旗的?

1、 这是一个建筑工地旁边,专门设置了一个人在这里摇小旗,如果有车辆和行人通过,他会根据工地作业情况决定是否允许通过,以确保安全。即使允许你通过,也会提醒你注意安全。

Read more...

Filed in: 个人收藏
41

情侣车站吻

原来标题是:后生依然可畏~中学生情侣车站公然舌吻~

我都懒得去探究他们是小学生还是中学生还是高中生了...

作者还来个舌吻,太厉害了,舌头他都看得见.....在中国啊,标题原来是这么重要的!!!

我转过来不是因为他的标题,也不是因为图片....是设计台词!!!

设计台词才是亮点啊!
01153463c 情侣车站吻
(设计台词)
红衣男:哎呀妈,咋回事啊?光天化日之下……现在这娃咋都被改革给开放呢?

Read more...

Filed in: 个人收藏
14

国内外DNS服务器地址列表

收藏备用!来源月光!

DNS(Domain Name System)是域名解析服务器的意思,它在互联网的作用是把域名转换成为网络可以识别的IP地址。目前国内电信运营商通过使用DNS劫持的方法,干扰用 户正常上网,使得用户无法访问Google、Gmail、Google AdSense、Google Maps等常用服务,昨天我介绍了使用OpenDNS的方法解决这个问题,由于OpenDNS的服务器在美国,如果使用的人多了有可能会速度变慢,因此今天我介绍一些其他国外的DNS服务器地址,供大家选择。

通常来说,香港、韩国、日本等国的DNS服务器速度会比较快,大家可以多用几个试试,尽量选择一个自己访问最快的DNS服务器,中国的电信运营商都是流氓,DNS服务器,早换早轻松。

港澳台DNS服务器地址

香港:
205.252.144.228
208.151.69.65
202.181.202.140
202.181.224.2

澳门:
202.175.3.8
202.175.3.3

台湾:
168.95.192.1
168.95.1.1

国外DNS服务器地址

Read more...

Filed in: 个人收藏
3
© 2007-2010 猫言猫语. All rights reserved. Powered by WordPress. 6 queries in 0.083 seconds.
Proudly designed by Theme Junkie.