SELECT WarehouseCode,ItemCode,LocationCode = (
STUFF((SELECT ',' + LocationCode FROM WMS_DefaultLocation WHERE WarehouseCode = A.WarehouseCode AND ItemCode = A.ItemCode AND Enabled = 1 AND DeletionStateCode = 0 ORDER BY LocationCode ASC FOR XML PATH('')),1,1,'')
) FROM WMS_DefaultLocation AS A WHERE A.Enabled = 1 AND A.DeletionStateCode = 0 GROUP BY WarehouseCode,ItemCode
尽管Sql Server 2005已经问世几年,但我相信很多公司还仍然大量的使用着Sql Server 2000的服务器,依然有很多在使用SQL 2000的DTS。那么DTS Backup 2000作为一款DTS包备份、恢复、迁移的免费工具,肯定会获得你的喜爱。
DTS Backup 2000介绍
下面是来自官方的介绍:
<br/>DTS Backup 2000 is a tool designed to help with both backup and transfer of DTS packages. The DTSBackup file format and direct transfer of packages between SQL Servers options do not suffer the loss of layout or annotations as you get when the DTS object model. It is of course free to use. <br/>
大家知道SQL server 2005以后,DTS已经被SSIS所替换,[URL=http://www.sqldts.com]SQLDTS.COM[/URL]也顺应这种发展,升级为[URL=http://www.sqlis.com]SQLIS.COM[/URL]。
select tdsls401.orno, tdsls401.pono, tdsls401.sqnb from tdsls401, | Sales Order Lines whinh430, | Shipment whinh431 | Shipment Lines where whinh431.worn = tdsls401.orno and whinh431.wpon = tdsls401.pono and whinh431.wseq = tdsls401.sqnb and whinh430.pcsp = tcyesno.yes and whinh431.shpm = whinh430.shpm and (whinh431.worg = whinh.oorg.sales or whinh431.worg = whinh.oorg.purchase) order by tdsls401.orno,tdsls401.pono
反选的时候,用Not Exists
select tdsls401.orno, tdsls401.pono, tdsls401.sqnb from tdsls401 | Sales Order Lines where not exists (select * from whinh430, | Shipment whinh431 | Shipment Lines where whinh431.worn = tdsls401.orno and whinh431.wpon = tdsls401.pono and whinh431.wseq = tdsls401.sqnb and whinh430.pcsp = tcyesno.yes and whinh431.shpm = whinh430.shpm and (whinh431.worg = whinh.oorg.sales or whinh431.worg = whinh.oorg.purchase)) order by tdsls401.orno,tdsls401.pono
其实第一种正常查询中,查询多个表中关联出现的结果集也可以用Exists:
select tdsls401.orno, tdsls401.pono, tdsls401.sqnb from tdsls401 | Sales Order Lines where exists (select * from whinh430, | Shipment whinh431 | Shipment Lines where whinh431.worn = tdsls401.orno and whinh431.wpon = tdsls401.pono and whinh431.wseq = tdsls401.sqnb and whinh430.pcsp = tcyesno.yes and whinh431.shpm = whinh430.shpm and (whinh431.worg = whinh.oorg.sales or whinh431.worg = whinh.oorg.purchase)) order by tdsls401.orno,tdsls401.pono
今天上午遇到的问题,当从文本文件倒入数据到Sqlserver 2005时出现一下错误:"[Flat File Source [1]] Error: Data conversion failed. The data conversion for column “Column 2” returned status value 4 and status text “Text was truncated or one or more characters had no match in the target code page.”. "。数据来源是Baan系统,出错的字段是供应商名称,查了一下Oracle数据库,知道这个字段长度为60个字符。而在做Data Conversion的时候,默认的转换为Unicode String[DT_WSTR] 50(见下图),这里只能改成60才行。
今天在使用SSIS从Sql Server 2000导出数据到Sql Server 2005中的时候出现了以下错误。
<br/><br/>Error at StaffViewBak [OLE DB Destination [16]]: Column "Staff_Name" cannot convert between unicode and non-unicode string data types.<br/><br/>Error at StaffViewBak [DTS.Pipeline]: One or more component failed validation.<br/><br/>Error at StaffViewBak: There were errors during task validation.<br/><br/> (Microsoft.DataTransformationServices.VsIntegration)<br/><br/>
最近得到了一份Offer,决定了一下步的发展方向和研究领域: 1、数据库方面,以MSSQL为主,渐渐转向Oracle数据库 2、网页设计方面渐渐转入Flash website and Flash game 3、网络编程方面从原来的ASP环境逐渐升级到.net(C#)版本 4、个人职业发展从Designer or Programmer 变化为Team work and Team leader 5、Flash方面着重研究Actionscript2的编程,然后就是基于Database和XML的Flash应用设计 6、系统管理方面开始对Web server\Exchange Server\Ftp Server进行直接的管理和应用 7、英语学习方面,因为的确吃了苦头,坚持每天学习英语,提高英语听说读写能力