Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Sql server´æ´¢¹ý³ÌÖÐ Êý¾Ý¼¯µÄ»º´æ

create procedure DeleteWareHouse_StoreArea_SummaryByPUR
(@po_no nvarchar(100))
as
begin
declare @cacheTable table(wh_id int);--ÉùÃ÷Ò»¸ötableÀàÐ͵ıäÁ¿
insert @cacheTable select wh_id from aps_inventory_store_area where description=@po_no--Ïò±äÁ¿@cacheTableÖÐÌí¼Ó½á¹û¼¯
--select * from @cacheTable
delete aps_inventory_summary where wh_id in(select * from @cacheTable)
delete aps_inventory_store_area where wh_id in(select * from @cacheTable)
delete aps_inventory_warehouse where wh_id in(select * from @cacheTable)
end 


Ïà¹ØÎĵµ£º

SQL 2005ÆôÓÃ×é¼þAd Hoc Distributed Queries

SQL Server ×èÖ¹Á˶Ô×é¼þ 'Ad Hoc Distributed Queries' µÄ STATEMENT'OpenRowset/OpenDatasource' µÄ·ÃÎÊ£¬ÒòΪ´Ë×é¼þÒÑ×÷Ϊ´Ë·þÎñÆ÷°²È«ÅäÖõÄÒ»²¿·Ö¶ø±»¹Ø±Õ¡£ÏµÍ³¹ÜÀíÔ±¿ÉÒÔͨ¹ýʹÓà sp_configure ÆôÓà 'Ad Hoc Distributed Queries'¡£ÓÐ¹ØÆôÓà 'Ad Hoc Distributed Queries' µÄÏêϸÐÅÏ¢£¬Çë²ÎÔÄ SQL Server Áª»ú´ÔÊéÖÐ ......

ÎÒÏëÓÃÒ»ÌõSQLÏÔʾÕâÑùµÄ½á¹û

²»ÖªµÀÕâÑùµÄÒªÇóÄܲ»ÄÜʵÏÖ£¿
±ÈÈçÎÒÓÐÒ»ÕűíT1£¬ÀïÃæÖ»ÓÐÒ»¸ö×Ö¶Î1
ÀïÃæÓÐ100Ìõ¼Ç¼£¬ÈçÏÂËùʾ£º
×Ö¶Î1
A1
A2
A3
A4
...
A100
ÎÒÏëÓÃÒ»ÌõSQLÏÔʾÕâÑùµÄ½á¹û
µÚÒ»ÁР   µÚ¶þÁР   ...        µÚÊ®ÁÐ
A1        A11    &nb ......

SQL Server º¯Êý´óÈ«

SQL Server×Ö·û´®´¦Àíº¯Êý´óÈ«
 selectÓï¾äÖÐÖ»ÄÜʹÓÃsqlº¯Êý¶Ô×ֶνøÐвÙ×÷£¨Á´½Ósql server£©£¬
select ×Ö¶Î1 from ±í1 where ×Ö¶Î1.IndexOf("ÔÆ")=1;
ÕâÌõÓï¾ä²»¶ÔµÄÔ­ÒòÊÇindexof£¨£©º¯Êý²»ÊÇsqlº¯Êý£¬¸Ä³Ésql¶ÔÓ¦µÄº¯Êý¾Í¿ÉÒÔÁË¡£
left£¨£©ÊÇsqlº¯Êý¡£
select ×Ö¶Î1 from ±í1 where charindex£¨'Ô ......

SQLֻȡÈÕÆÚµÄÄêÔÂÈÕ²¿·Ö


·½·¨Ò»:
select CONVERT(varchar, getdate(), 120 )
2004-09-12 11:06:08
select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),\'-\',\'\'),\' \',\'\'),\':\',\'\')
20040912110608 h
select CONVERT(varchar(12) , getdate(), 111 )
2004/09/12
select CONVERT(varchar(12) , getdate(), 11 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ