??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美一区在线观看视频,欧美日韩一区在线播放,97精品视频在线看http://www.aygfsteel.com/Werther/category/37767.htmlLive as if you were to die tomorrow. Learn as if you were to live forever. zh-cnThu, 22 Oct 2009 13:53:41 GMTThu, 22 Oct 2009 13:53:41 GMT60SQL Server数据库开发的二十一条军?/title><link>http://www.aygfsteel.com/Werther/archive/2009/10/22/299331.html</link><dc:creator>Werther</dc:creator><author>Werther</author><pubDate>Thu, 22 Oct 2009 04:53:00 GMT</pubDate><guid>http://www.aygfsteel.com/Werther/archive/2009/10/22/299331.html</guid><wfw:comment>http://www.aygfsteel.com/Werther/comments/299331.html</wfw:comment><comments>http://www.aygfsteel.com/Werther/archive/2009/10/22/299331.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Werther/comments/commentRss/299331.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Werther/services/trackbacks/299331.html</trackback:ping><description><![CDATA[     摘要: 如果你正在负责一个基于SQL Server的项目,或者你刚刚接触SQL ServerQ你都有可能要面临一些数据库性能的问题,q篇文章会ؓ你提供一些有用的指导Q其中大多数也可以用于其它的DBMSQ? <br>在这里,我不打算介绍使用SQL Server的窍门,也不能提供一个包ȝ病的ҎQ我所做的是ȝ一些经?---关于如何形成一个好的设计。这些经验来自我q去几年中经受的教训Q一直来Q我看到许多同样的设计错误被一ơ又一ơ的重复? <br>  <a href='http://www.aygfsteel.com/Werther/archive/2009/10/22/299331.html'>阅读全文</a><img src ="http://www.aygfsteel.com/Werther/aggbug/299331.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Werther/" target="_blank">Werther</a> 2009-10-22 12:53 <a href="http://www.aygfsteel.com/Werther/archive/2009/10/22/299331.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SQL Server2000中字W串合ƈ的问?/title><link>http://www.aygfsteel.com/Werther/archive/2009/05/21/271959.html</link><dc:creator>Werther</dc:creator><author>Werther</author><pubDate>Thu, 21 May 2009 05:59:00 GMT</pubDate><guid>http://www.aygfsteel.com/Werther/archive/2009/05/21/271959.html</guid><wfw:comment>http://www.aygfsteel.com/Werther/comments/271959.html</wfw:comment><comments>http://www.aygfsteel.com/Werther/archive/2009/05/21/271959.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Werther/comments/commentRss/271959.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Werther/services/trackbacks/271959.html</trackback:ping><description><![CDATA[     摘要: 解决SQL Server2000中字W串合ƈ的例?nbsp; <a href='http://www.aygfsteel.com/Werther/archive/2009/05/21/271959.html'>阅读全文</a><img src ="http://www.aygfsteel.com/Werther/aggbug/271959.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Werther/" target="_blank">Werther</a> 2009-05-21 13:59 <a href="http://www.aygfsteel.com/Werther/archive/2009/05/21/271959.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何信息请求翻译ؓSQL SELECT语句Q一Q?/title><link>http://www.aygfsteel.com/Werther/archive/2009/05/06/269143.html</link><dc:creator>Werther</dc:creator><author>Werther</author><pubDate>Wed, 06 May 2009 00:20:00 GMT</pubDate><guid>http://www.aygfsteel.com/Werther/archive/2009/05/06/269143.html</guid><wfw:comment>http://www.aygfsteel.com/Werther/comments/269143.html</wfw:comment><comments>http://www.aygfsteel.com/Werther/archive/2009/05/06/269143.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Werther/comments/commentRss/269143.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Werther/services/trackbacks/269143.html</trackback:ping><description><![CDATA[     摘要: 本文详细介绍了将信息h译为SQL SELECT语句q一技巧中的将h译为SQL的方? <br>关键词:SQL Server 请求翻译ؓSQL SQL SELECT <br>  <a href='http://www.aygfsteel.com/Werther/archive/2009/05/06/269143.html'>阅读全文</a><img src ="http://www.aygfsteel.com/Werther/aggbug/269143.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Werther/" target="_blank">Werther</a> 2009-05-06 08:20 <a href="http://www.aygfsteel.com/Werther/archive/2009/05/06/269143.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SQL取出 所有周?周日的日?http://www.aygfsteel.com/Werther/archive/2009/05/05/268922.htmlWertherWertherTue, 05 May 2009 02:04:00 GMThttp://www.aygfsteel.com/Werther/archive/2009/05/05/268922.htmlhttp://www.aygfsteel.com/Werther/comments/268922.htmlhttp://www.aygfsteel.com/Werther/archive/2009/05/05/268922.html#Feedback0http://www.aygfsteel.com/Werther/comments/commentRss/268922.htmlhttp://www.aygfsteel.com/Werther/services/trackbacks/268922.html阅读全文

Werther 2009-05-05 10:04 发表评论
]]>
全勤獎的a算http://www.aygfsteel.com/Werther/archive/2009/04/09/264690.htmlWertherWertherThu, 09 Apr 2009 11:32:00 GMThttp://www.aygfsteel.com/Werther/archive/2009/04/09/264690.htmlhttp://www.aygfsteel.com/Werther/comments/264690.htmlhttp://www.aygfsteel.com/Werther/archive/2009/04/09/264690.html#Feedback0http://www.aygfsteel.com/Werther/comments/commentRss/264690.htmlhttp://www.aygfsteel.com/Werther/services/trackbacks/264690.html阅读全文

Werther 2009-04-09 19:32 发表评论
]]>
SQL Server视频、电子书免费下蝲专辑http://www.aygfsteel.com/Werther/archive/2009/04/07/264179.htmlWertherWertherTue, 07 Apr 2009 00:15:00 GMThttp://www.aygfsteel.com/Werther/archive/2009/04/07/264179.htmlhttp://www.aygfsteel.com/Werther/comments/264179.htmlhttp://www.aygfsteel.com/Werther/archive/2009/04/07/264179.html#Feedback0http://www.aygfsteel.com/Werther/comments/commentRss/264179.htmlhttp://www.aygfsteel.com/Werther/services/trackbacks/264179.html阅读全文

Werther 2009-04-07 08:15 发表评论
]]>
SQL注入专题http://www.aygfsteel.com/Werther/archive/2009/04/02/263521.htmlWertherWertherThu, 02 Apr 2009 04:34:00 GMThttp://www.aygfsteel.com/Werther/archive/2009/04/02/263521.htmlhttp://www.aygfsteel.com/Werther/comments/263521.htmlhttp://www.aygfsteel.com/Werther/archive/2009/04/02/263521.html#Feedback0http://www.aygfsteel.com/Werther/comments/commentRss/263521.htmlhttp://www.aygfsteel.com/Werther/services/trackbacks/263521.html阅读全文

Werther 2009-04-02 12:34 发表评论
]]>
实现两个数据库的同步http://www.aygfsteel.com/Werther/archive/2009/04/02/263519.htmlWertherWertherThu, 02 Apr 2009 04:30:00 GMThttp://www.aygfsteel.com/Werther/archive/2009/04/02/263519.htmlhttp://www.aygfsteel.com/Werther/comments/263519.htmlhttp://www.aygfsteel.com/Werther/archive/2009/04/02/263519.html#Feedback0http://www.aygfsteel.com/Werther/comments/commentRss/263519.htmlhttp://www.aygfsteel.com/Werther/services/trackbacks/263519.html阅读全文

Werther 2009-04-02 12:30 发表评论
]]>
QIQ?语法参考手?http://www.aygfsteel.com/Werther/archive/2009/03/27/262274.htmlWertherWertherFri, 27 Mar 2009 00:04:00 GMThttp://www.aygfsteel.com/Werther/archive/2009/03/27/262274.htmlhttp://www.aygfsteel.com/Werther/comments/262274.htmlhttp://www.aygfsteel.com/Werther/archive/2009/03/27/262274.html#Feedback0http://www.aygfsteel.com/Werther/comments/commentRss/262274.htmlhttp://www.aygfsteel.com/Werther/services/trackbacks/262274.html阅读全文

Werther 2009-03-27 08:04 发表评论
]]>
已知q月求此q月的第一天和最後一?/title><link>http://www.aygfsteel.com/Werther/archive/2009/03/25/261861.html</link><dc:creator>Werther</dc:creator><author>Werther</author><pubDate>Wed, 25 Mar 2009 06:48:00 GMT</pubDate><guid>http://www.aygfsteel.com/Werther/archive/2009/03/25/261861.html</guid><wfw:comment>http://www.aygfsteel.com/Werther/comments/261861.html</wfw:comment><comments>http://www.aygfsteel.com/Werther/archive/2009/03/25/261861.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Werther/comments/commentRss/261861.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Werther/services/trackbacks/261861.html</trackback:ping><description><![CDATA[     摘要: 已知q月求此q月的第一天和最後一?nbsp; <a href='http://www.aygfsteel.com/Werther/archive/2009/03/25/261861.html'>阅读全文</a><img src ="http://www.aygfsteel.com/Werther/aggbug/261861.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Werther/" target="_blank">Werther</a> 2009-03-25 14:48 <a href="http://www.aygfsteel.com/Werther/archive/2009/03/25/261861.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SQL命o大全-中英文对?/title><link>http://www.aygfsteel.com/Werther/archive/2009/03/24/261618.html</link><dc:creator>Werther</dc:creator><author>Werther</author><pubDate>Tue, 24 Mar 2009 00:15:00 GMT</pubDate><guid>http://www.aygfsteel.com/Werther/archive/2009/03/24/261618.html</guid><wfw:comment>http://www.aygfsteel.com/Werther/comments/261618.html</wfw:comment><comments>http://www.aygfsteel.com/Werther/archive/2009/03/24/261618.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Werther/comments/commentRss/261618.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Werther/services/trackbacks/261618.html</trackback:ping><description><![CDATA[     摘要: SQL命o大全-中英文对?nbsp; <a href='http://www.aygfsteel.com/Werther/archive/2009/03/24/261618.html'>阅读全文</a><img src ="http://www.aygfsteel.com/Werther/aggbug/261618.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Werther/" target="_blank">Werther</a> 2009-03-24 08:15 <a href="http://www.aygfsteel.com/Werther/archive/2009/03/24/261618.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>sql server中分布式查询http://www.aygfsteel.com/Werther/archive/2009/03/23/261536.htmlWertherWertherMon, 23 Mar 2009 07:43:00 GMThttp://www.aygfsteel.com/Werther/archive/2009/03/23/261536.htmlhttp://www.aygfsteel.com/Werther/comments/261536.htmlhttp://www.aygfsteel.com/Werther/archive/2009/03/23/261536.html#Feedback0http://www.aygfsteel.com/Werther/comments/commentRss/261536.htmlhttp://www.aygfsteel.com/Werther/services/trackbacks/261536.htmll常得在sql server中查询不同数据库中数?
q就产生了分布式查询的需?  阅读全文

Werther 2009-03-23 15:43 发表评论
]]>
SQL Server日期格式的{?/title><link>http://www.aygfsteel.com/Werther/archive/2009/03/20/260994.html</link><dc:creator>Werther</dc:creator><author>Werther</author><pubDate>Fri, 20 Mar 2009 03:20:00 GMT</pubDate><guid>http://www.aygfsteel.com/Werther/archive/2009/03/20/260994.html</guid><wfw:comment>http://www.aygfsteel.com/Werther/comments/260994.html</wfw:comment><comments>http://www.aygfsteel.com/Werther/archive/2009/03/20/260994.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Werther/comments/commentRss/260994.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Werther/services/trackbacks/260994.html</trackback:ping><description><![CDATA[     摘要: SQL Server中文版的默认的日期字Ddatetime格式是yyyy-mm-dd Thh:mm:ss.mmm   <a href='http://www.aygfsteel.com/Werther/archive/2009/03/20/260994.html'>阅读全文</a><img src ="http://www.aygfsteel.com/Werther/aggbug/260994.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Werther/" target="_blank">Werther</a> 2009-03-20 11:20 <a href="http://www.aygfsteel.com/Werther/archive/2009/03/20/260994.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>數據n里的資料拆分查出http://www.aygfsteel.com/Werther/archive/2009/03/11/258991.htmlWertherWertherWed, 11 Mar 2009 00:44:00 GMThttp://www.aygfsteel.com/Werther/archive/2009/03/11/258991.htmlhttp://www.aygfsteel.com/Werther/comments/258991.htmlhttp://www.aygfsteel.com/Werther/archive/2009/03/11/258991.html#Feedback0http://www.aygfsteel.com/Werther/comments/commentRss/258991.htmlhttp://www.aygfsteel.com/Werther/services/trackbacks/258991.html分拆列?

原著Q邹?
改编Q爱新觉|?毓华(十八q风?守得冰山雪莲花开)  2007-12-16  q东深圳

有表tb, 如下:
id          value
----------- -----------
1          aa,bb
2          aaa,bbb,ccc
Ʋ按id,分拆value? 分拆后结果如?
id          value
----------- --------
1          aa
1          bb
2          aaa
2          bbb
2          ccc

1. 旧的解决Ҏ(sql server 2000)
SELECT TOP 8000 id = IDENTITY(int, 1, 1) INTO # FROM syscolumns a, syscolumns b

SELECT A.id, SUBSTRING(A.[values], B.id, CHARINDEX(',', A.[values] + ',', B.id) - B.id)
FROM tb A, # B
WHERE SUBSTRING(',' + A.[values], B.id, 1) = ','

DROP TABLE #

2. 新的解决Ҏ(sql server 2005)

create table tb(id int,value varchar(30))
insert into tb values(1,'aa,bb')
insert into tb values(2,'aaa,bbb,ccc')
go
SELECT A.id, B.value
FROM(
   
SELECT id, [value] = CONVERT(xml,' <root> <v>' + REPLACE([value], ',', ' </v> <v>') + ' </v> </root>') FROM tb
)A
OUTER APPLY(
   
SELECT value = N.v.value('.', 'varchar(100)') FROM A.[value].nodes('/root/v') N(v)
)B

DROP TABLE tb

/*
id          value
----------- ------------------------------
1          aa
1          bb
2          aaa
2          bbb
2          ccc

(5 行受影响)
*/


Werther 2009-03-11 08:44 发表评论
]]>
Excel的數據插入到數據庫中CZhttp://www.aygfsteel.com/Werther/archive/2009/03/10/258859.htmlWertherWertherTue, 10 Mar 2009 09:11:00 GMThttp://www.aygfsteel.com/Werther/archive/2009/03/10/258859.htmlhttp://www.aygfsteel.com/Werther/comments/258859.htmlhttp://www.aygfsteel.com/Werther/archive/2009/03/10/258859.html#Feedback3http://www.aygfsteel.com/Werther/comments/commentRss/258859.htmlhttp://www.aygfsteel.com/Werther/services/trackbacks/258859.html阅读全文

Werther 2009-03-10 17:11 发表评论
]]>
Excel的数据导入SQL server http://www.aygfsteel.com/Werther/archive/2009/02/24/256443.htmlWertherWertherTue, 24 Feb 2009 07:59:00 GMThttp://www.aygfsteel.com/Werther/archive/2009/02/24/256443.htmlhttp://www.aygfsteel.com/Werther/comments/256443.htmlhttp://www.aygfsteel.com/Werther/archive/2009/02/24/256443.html#Feedback0http://www.aygfsteel.com/Werther/comments/commentRss/256443.htmlhttp://www.aygfsteel.com/Werther/services/trackbacks/256443.html--可以通过使用 OPENDATASOURCE ?OPENROWSET 函数为特定目的导入数据?br /> --下列代码CZ也能?Excel Customers 工作表数据导入新?SQL Server 表:
Ҏ一Q?br />
SELECT * INTO XLImport3 FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0','Data Source=E:\Temp.xls;Extended Properties=Excel 5.0')...[Temp$]
Ҏ二:

SELECT * INTO XLImport4 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 5.0;Database=E:\Temp.xls', [Temp$])

Ҏ三:

SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 5.0;Database=E:\Temp.xls', 'SELECT * FROM [Temp$]')
--像這個表裡面J續da錄
INSERT INTO XLImport5
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 5.0;Database=E:\Temp.xls', 'SELECT * FROM [Temp$]')


SELECT * FROM XLImport5

DROP TABLE XLImport3
DROP TABLE XLImport4
DROP TABLE XLImport5

[Temp$]指的時候你的Excel表格裡面的Sheet名稱Q記得美元符合是後面加上ȝQ是必須要加的,如果你的Excel?.0的,只需要Excel 5.0卛_?br />



Werther 2009-02-24 15:59 发表评论
]]>
快速比较结构相同的两表http://www.aygfsteel.com/Werther/archive/2009/02/24/256421.htmlWertherWertherTue, 24 Feb 2009 06:11:00 GMThttp://www.aygfsteel.com/Werther/archive/2009/02/24/256421.htmlhttp://www.aygfsteel.com/Werther/comments/256421.htmlhttp://www.aygfsteel.com/Werther/archive/2009/02/24/256421.html#Feedback0http://www.aygfsteel.com/Werther/comments/commentRss/256421.htmlhttp://www.aygfsteel.com/Werther/services/trackbacks/256421.html     /* l构相同的两表,一表有记录3万条左右Q一表有记录2万条左右Q我怎样快速查找两表的不同记录Q?/

      -- l你一个测试方法,从northwind中的orders表取数据?br />        select * into n1 from orders
       select * into n2 from orders
 
       select * from n1
       select * from n2
 
       --d主键Q然后修改n1中若q字D늚若干?br />        alter table n1 add constraint pk_n1_id primary key (OrderID)
       alter table n2 add constraint pk_n2_id primary key (OrderID)
 
       select OrderID from (select * from n1 union select * from n2) a group by OrderID having count(*) > 1
 
      /* 应该可以Q而且不同的记录的ID昄出来。下面的适用于双方记录一L情况Q?/
 
       select * from n1 where orderid in (select OrderID from (select * from n1 union select * from n2) a group by OrderID having count(*) > 1)
 -- 至于双方互不存在的记录是比较好处理的
 --删除n1,n2中若q条记录
       delete from n1 where orderID in ('10728','10730')
       delete from n2 where orderID in ('11000','11001')
 
       --*************************************************************
       -- 双方都有该记录却不完全相?br />        select * from n1 where orderid in(select OrderID from (select * from n1 union select * from n2) a group by OrderID having count(*) > 1)
       union
       --n2中存在但在n1中不存的?0728,10730
       select * from n1 where OrderID not in (select OrderID from n2)
       union
       --n1中存在但在n2中不存的?1000,11001
       select * from n2 where OrderID not in (select OrderID from n1)



Werther 2009-02-24 14:11 发表评论
]]>
E典SQL行列转换http://www.aygfsteel.com/Werther/archive/2009/02/20/255828.htmlWertherWertherFri, 20 Feb 2009 07:05:00 GMThttp://www.aygfsteel.com/Werther/archive/2009/02/20/255828.htmlhttp://www.aygfsteel.com/Werther/comments/255828.htmlhttp://www.aygfsteel.com/Werther/archive/2009/02/20/255828.html#Feedback0http://www.aygfsteel.com/Werther/comments/commentRss/255828.htmlhttp://www.aygfsteel.com/Werther/services/trackbacks/255828.html問題Q?假设有张学生成W?Test)如下
       Name Subject Result
       张三 语文 80
       张三 数学 90
       张三 物理 85
       李四 语文 85
       李四 数学 92
       李四 物理 82
 
i果Q?br />        姓名 语文 数学 物理
       张三 80 90 85
       李四 85 92 82

DROP TABLE Test
create table Test(Name varchar(10),Subject Varchar(10),Result int)
insert Test
select '張三','語文',80 union all
select '張三','數學',90 union all
select '張三','物理',85 union all
select '李四','語文',85 union all
select '李四','數學',92 union all
select '李四','物理',82
go

SELECT * FROM Test
 
--用於多行的轉?br /> declare @sql varchar(4000)
set @sql = 'select Name'
select @sql = @sql + ',sum(case Subject when '''+Subject+''' then Result end) ['+Subject+']'
from (select distinct Subject from test) as a
select @sql = @sql+' from test group by name'
       exec(@sql)

--如果行數這個看起來更加明瞭
select Name as 姓名,
 sum(case Subject when '數學' then Result end) [數學],
 sum(case Subject when '物理' then Result end) [物理],
 sum(case Subject when '語文' then Result end) [語文]
from Test group by name

我以前面試的時候考試過這種似的題Q也是我們在R程開發過程中經帔R到的一E常見題Q我的分析希望對大家有幫助?/p>


 



Werther 2009-02-20 15:05 发表评论
]]>
SQL Server日期计算http://www.aygfsteel.com/Werther/archive/2009/02/20/255827.htmlWertherWertherFri, 20 Feb 2009 06:38:00 GMThttp://www.aygfsteel.com/Werther/archive/2009/02/20/255827.htmlhttp://www.aygfsteel.com/Werther/comments/255827.htmlhttp://www.aygfsteel.com/Werther/archive/2009/02/20/255827.html#Feedback0http://www.aygfsteel.com/Werther/comments/commentRss/255827.htmlhttp://www.aygfsteel.com/Werther/services/trackbacks/255827.html        SELECT DATEADD(mm, DATEDIFF(mm,0,getdate()), 0)

 b. 本周的星期一
       SELECT DATEADD(wk, DATEDIFF(wk,0,getdate()), 0)

c. 一q的W一?br />        SELECT DATEADD(yy, DATEDIFF(yy,0,getdate()), 0)

d. 季度的第一?br />        SELECT DATEADD(qq, DATEDIFF(qq,0,getdate()), 0)

e. 上个月的最后一?br />        SELECT dateadd(ms,-3,DATEADD(mm, DATEDIFF(mm,0,getdate()), 0))

f. d的最后一?br />        SELECT dateadd(ms,-3,DATEADD(yy, DATEDIFF(yy,0,getdate()), 0))

g. 本月的最后一?br />        SELECT dateadd(ms,-3,DATEADD(mm, DATEDIFF(m,0,getdate())+1, 0))

h. 本月的第一个星期一
       select DATEADD(wk, DATEDIFF(wk,0, dateadd(dd,6-datepart(day,getdate()),getdate()) ), 0)

i. 本年的最后一?br />        SELECT dateadd(ms,-3,DATEADD(yy, DATEDIFF(yy,0,getdate())+1, 0))

Werther 2009-02-20 14:38 发表评论
]]>
SQL查询分析器代码的形式出资料Q?/title><link>http://www.aygfsteel.com/Werther/archive/2009/02/19/255596.html</link><dc:creator>Werther</dc:creator><author>Werther</author><pubDate>Thu, 19 Feb 2009 09:15:00 GMT</pubDate><guid>http://www.aygfsteel.com/Werther/archive/2009/02/19/255596.html</guid><wfw:comment>http://www.aygfsteel.com/Werther/comments/255596.html</wfw:comment><comments>http://www.aygfsteel.com/Werther/archive/2009/02/19/255596.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Werther/comments/commentRss/255596.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Werther/services/trackbacks/255596.html</trackback:ping><description><![CDATA[<p style="font-size: 12pt">  <span style="font-family: Tahoma">SQL</span><span style="font-family: 新細明體">代码</span><span style="font-family: Tahoma">:   <br /> <br />   EXEC   master..xp_cmdshell   'bcp   </span><span style="font-family: 新細明體">库名</span><span style="font-family: Tahoma">.dbo.</span><span style="font-family: 新細明體">表名</span><span style="font-family: Tahoma">out   c:\Temp.xls   -c   -q   -S"servername"   -U"sa"   -P""'   <br />  </span><span style="font-family: 新細明體">参数Q?/span><span style="font-family: Tahoma">S   </span><span style="font-family: 新細明體">?/span><span style="font-family: Tahoma">SQL</span><span style="font-family: 新細明體">服务器名Q?/span><span style="font-family: Tahoma">U</span><span style="font-family: 新細明體">是用P</span><span style="font-family: Tahoma">P</span><span style="font-family: 新細明體">是密?/span> <span style="font-family: Tahoma"><br />  </span><span style="font-family: 新細明體">说明Q还可以导出文本文g{多U格?/span><span style="font-family: Tahoma">   <br />  </span><span style="font-family: 新細明體">实例</span><span style="font-family: Tahoma">1:<br /> EXEC   master..xp_cmdshell   'bcp   pubs.dbo.employee   out   c:\temp1.xls   -c   -q   -S"172.16.1.101"   -U"sa"   -P"sa"'   <br />  </span><span style="font-family: 新細明體">实例</span><span style="font-family: Tahoma">2:<br /> EXEC   master..xp_cmdshell   'bcp   "SELECT   au_fname,   au_lname   FROM   pubs..authors   ORDER   BY   au_lname"   queryout   c:\Temp.xls   -c -S"172.16.1.101"   -U"sa"   -P"sa"' <br /> <br /> </span><span style="font-family: 新細明體">q个更容易让大家理解Q注?/span><span style="font-family: Tahoma">servername</span><span style="font-family: 新細明體">应该写你</span><span style="font-family: Tahoma">computer</span><span style="font-family: 新細明體">?/span><span style="font-family: Tahoma">IP</span><span style="font-family: 新細明體">地址Q实?/span><span style="font-family: Tahoma">1</span><span style="font-family: 新細明體">?/span><span style="font-family: Tahoma">2</span><span style="font-family: 新細明體">只要你改一?/span><span style="font-family: Tahoma">IP</span><span style="font-family: 新細明體">可以看得到l果的一个实?還有一點需要大家注意,在執行SQL語句的時候,單引號裡面的字符串是不能換行埯的,如果換行會報錯?/span></p> <p style="font-size: 12pt"><strong></strong> </p> <img src ="http://www.aygfsteel.com/Werther/aggbug/255596.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Werther/" target="_blank">Werther</a> 2009-02-19 17:15 <a href="http://www.aygfsteel.com/Werther/archive/2009/02/19/255596.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>_֦的SQL和SQL SERVER 与ACCESS、EXCEL的数据导入导{?http://www.aygfsteel.com/Werther/archive/2009/02/18/255254.htmlWertherWertherWed, 18 Feb 2009 05:57:00 GMThttp://www.aygfsteel.com/Werther/archive/2009/02/18/255254.htmlhttp://www.aygfsteel.com/Werther/comments/255254.htmlhttp://www.aygfsteel.com/Werther/archive/2009/02/18/255254.html#Feedback0http://www.aygfsteel.com/Werther/comments/commentRss/255254.htmlhttp://www.aygfsteel.com/Werther/services/trackbacks/255254.html阅读全文

Werther 2009-02-18 13:57 发表评论
]]>
վ֩ģ壺 | ɫ| | ˮ| ݸ| | | ¬| | | ɽ| ¡| ԣ| | | | | ͷ| | | | | | ţ| | | Т| ɽ| | ˫| ī| | | | ͨ| | | | ɽ| | |