2014年12月14日 星期日

關閉win8.1的資料夾內容的「自動排列」

原文網址http://www.eightforums.com/tutorials/4299-windows-explorer-auto-arrange-disable-windows-8-a.html
batch檔內容如下:
===============================================================
@echo off

:: Created by: Shawn Brink
:: http://www.eightforums.com/
:: Tutorial:  http://www.eightforums.com/tutorials/4299-windows-explorer-auto-arrange-disable-windows-8-a.html


:: To reset all folders to default folder views
Reg Delete "HKCU\Software\Microsoft\Windows\Shell\BagMRU" /F
Reg Delete "HKCU\Software\Microsoft\Windows\Shell\Bags" /F

Reg Delete "HKCU\Software\Microsoft\Windows\ShellNoRoam\Bags" /F
Reg Delete "HKCU\Software\Microsoft\Windows\ShellNoRoam\BagMRU" /F

Reg Delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU" /F
Reg Delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags" /F

Reg Delete "HKCU\Software\Classes\Wow6432Node\Local Settings\Software\Microsoft\Windows\Shell\Bags" /F
Reg Delete "HKCU\Software\Classes\Wow6432Node\Local Settings\Software\Microsoft\Windows\Shell\BagMRU" /F



:: To kill and restart explorer
taskkill /f /im explorer.exe
start explorer.exe
CLS
echo.
echo.
echo Please wait for explorer to restart. No need to do anything.
echo.
TIMEOUT 10


:: To open the Computer window
explorer.exe shell:MyComputerFolder



:: Disable Auto Arrange for CompressedFolder (zipped) folder
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{80213e82-bcfd-4c4f-8817-bb27601267a9}" /V FFLAGS /T REG_dWORD /D 1124073476 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{80213e82-bcfd-4c4f-8817-bb27601267a9}" /V LogicalViewMode /T REG_dWORD /D 1 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{80213e82-bcfd-4c4f-8817-bb27601267a9}" /V Mode /T REG_DWORD /D 4 /F


:: Disable Auto Arrange for Contacts folder template
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{de2b70ec-9bf7-4a93-bd3d-243f7881d492}" /V FFLAGS /T REG_dWORD /D 1124073476 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{de2b70ec-9bf7-4a93-bd3d-243f7881d492}" /V LogicalViewMode /T REG_dWORD /D 1 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{de2b70ec-9bf7-4a93-bd3d-243f7881d492}" /V Mode /T REG_DWORD /D 4 /F


:: Disable Auto Arrange for Documents folder template
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{7D49D726-3C21-4F05-99AA-FDC2C9474656}" /V FFLAGS /T REG_dWORD /D 1124073476 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{7D49D726-3C21-4F05-99AA-FDC2C9474656}" /V LogicalViewMode /T REG_dWORD /D 1 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{7D49D726-3C21-4F05-99AA-FDC2C9474656}" /V Mode /T REG_DWORD /D 4 /F


:: Disable Auto Arrange for Games Explorer folder
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{b689b0d0-76d3-4cbb-87f7-585d0e0ce070}" /V FFLAGS /T REG_dWORD /D 1124073476 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{b689b0d0-76d3-4cbb-87f7-585d0e0ce070}" /V LogicalViewMode /T REG_dWORD /D 1 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{b689b0d0-76d3-4cbb-87f7-585d0e0ce070}" /V Mode /T REG_DWORD /D 4 /F


:: Disable Auto Arrange for General Items folder template
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{5C4F28B5-F869-4E84-8E60-F11DB97C5CC7}" /V FFLAGS /T REG_dWORD /D 1124073476 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{5C4F28B5-F869-4E84-8E60-F11DB97C5CC7}" /V LogicalViewMode /T REG_dWORD /D 1 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{5C4F28B5-F869-4E84-8E60-F11DB97C5CC7}" /V Mode /T REG_DWORD /D 4 /F


:: Disable Auto Arrange for Libraries folder
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{C4D98F09-6124-4fe0-9942-826416082DA9}" /V FFLAGS /T REG_dWORD /D 1124073476 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{C4D98F09-6124-4fe0-9942-826416082DA9}" /V LogicalViewMode /T REG_dWORD /D 1 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{C4D98F09-6124-4fe0-9942-826416082DA9}" /V Mode /T REG_DWORD /D 4 /F


:: Disable Auto Arrange for Music folder template
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{94D6DDCC-4A68-4175-A374-BD584A510B78}" /V FFLAGS /T REG_dWORD /D 1124073476 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{94D6DDCC-4A68-4175-A374-BD584A510B78}" /V LogicalViewMode /T REG_dWORD /D 1 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{94D6DDCC-4A68-4175-A374-BD584A510B78}" /V Mode /T REG_DWORD /D 4 /F


:: Disable Auto Arrange for Pictures folder template
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{B3690E58-E961-423B-B687-386EBFD83239}" /V FFLAGS /T REG_dWORD /D 1124073476 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{B3690E58-E961-423B-B687-386EBFD83239}" /V LogicalViewMode /T REG_dWORD /D 1 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{B3690E58-E961-423B-B687-386EBFD83239}" /V Mode /T REG_DWORD /D 4 /F


:: Disable Auto Arrange for Printers folder
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{2c7bbec6-c844-4a0a-91fa-cef6f59cfda1}" /V FFLAGS /T REG_dWORD /D 1124073476 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{2c7bbec6-c844-4a0a-91fa-cef6f59cfda1}" /V LogicalViewMode /T REG_dWORD /D 1 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{2c7bbec6-c844-4a0a-91fa-cef6f59cfda1}" /V Mode /T REG_DWORD /D 4 /F


:: Disable Auto Arrange for Searches folder
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{0b0ba2e3-405f-415e-a6ee-cad625207853}" /V FFLAGS /T REG_dWORD /D 1124073476 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{0b0ba2e3-405f-415e-a6ee-cad625207853}" /V LogicalViewMode /T REG_dWORD /D 1 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{0b0ba2e3-405f-415e-a6ee-cad625207853}" /V Mode /T REG_DWORD /D 4 /F


:: Disable Auto Arrange for Videos folder template
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{5FA96407-7E77-483C-AC93-691D05850DE8}" /V FFLAGS /T REG_dWORD /D 1124073476 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{5FA96407-7E77-483C-AC93-691D05850DE8}" /V LogicalViewMode /T REG_dWORD /D 1 /F
REG ADD "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{5FA96407-7E77-483C-AC93-691D05850DE8}" /V Mode /T REG_DWORD /D 4 /F
========================================================

2014年9月23日 星期二

for Extjs4 無邊框之Window物件設定

如果你已經試過,以下屬性的話,相信結果還是沒辦法達到你要的結果
           ...
           ...
           ...
            header:false,
            closable: false,
            draggable: false,
            border: false,
            frame: true,
             ...
             ...
事實上,你只差最一個屬性--「 baseCls: ''」
加上她,就大工告成了
參考來源在此

皆樣,頑張!!

2014年9月2日 星期二

extjs 4 textareafield 如何讓它不折行?

以前extjs3時,textarea有個 wrap: 'off' 參數,把自動折行關閉
可是到了extjs4時,就不知道在哪設定了
當然有人用XTemplate來解決,不過那的很厚工
最後,就是一個小小的設定「 inputAttrTpl: 'wrap="off"' 」,
就醬
(Extjs可設定的地方多了,相對的也就沒那麼方便了,掠龜走鼈啊)

2014年8月29日 星期五

Disable Backspace key for SPA (single Page Application)

       Ext.EventManager.on(window, 'keydown', function (e, t) {
           if (e.getKey() == e.BACKSPACE && (!/^input$/i.test(t.tagName) || t.disabled || t.readOnly)) {
               e.stopEvent();
           }
       });

2014年8月18日 星期一

Extjs label 不折行

Label不折行的一個方式,最直接的方式就是設定width
不過,在width不知道的情況下(ex: text from database)
怎麼不靠width這屬性來做?
老句話,還是css的屬性做到了「white-space:nowrap」
ex:
===css 有弧角的 label=======================
.categoryLabel {
                      border-radius: 5px;
                      -moz-border-radius: 5px;
                      -webkit-border-radius: 5px;
                      -o-border-radius: 5px;
                      -ms-border-radius: 5px;
                      -khtml-border-radius: 5px;
                       background-color: #00FF00;color:#000000;
                       font-weight: bold;
                       white-space:nowrap;
                     
            }
================================
in js:
==================================
                    var node = Ext.create('Ext.form.Label', {
                        x: nextXPosition,
                        y: 3,
                        border: 2,
                        padding:'0 5 0 5',
                        cls: 'categoryLabel',
                        text: nodesArray[i].node_text,
                    });
====================================
如果你要測得label長度,還真的是要加入其他container時,才能取值的

以上,加油了

2014年8月8日 星期五

treed node add customer attributes

node物件是有很多參數
但是總是無法滿足多變的專案需要
所以要加些專案需要的參數上去
假設node長這樣:
                                 {
                                     text: "產品資料管理", expanded: true,id:'100' 
                                     ,testValue:'1974'
                                     ,valueAgain:'xyz'
                                     ,children: [
                                       { text: "產品資料增修查", testValue:'1950',leaf: true, id: '1-1' },
                                       { text: "統計資訊", leaf: true, id: '1-2' }
                                     ]
                                 }
 其中「testValue」及「valueAgain」是我們加入的自訂屬性
,那如何在其他事件中找出這些值?
不急!!
一定先要去Treepanel上加工!!
=================================
                            xtype: 'treepanel',
                              ...
                              ...
                              ...
                            , fields: ['text' ,'testValue','valueAgain'] 一定要先加這欄!!,而且text是必要的!!
                                 ...
                                  ...
==================================
之後,才能在其他事件中找到這些欄位的值:
  example:
===============================
 ,listeners: {
                                itemclick: function(s,r) {
                                    alert(r.data.testValue);
                                    //doMainSvcFunctions(r.data.id);

                                }
                            }
=================================
or
===================================
               ...
               ...
               ...
               var testNode = Ext.getCmp('pnlFunctionTree').getStore().getNodeById('z-12');
               var record = testNode.parentNode;
               console.log('parenet id  of test neode is is ' + record.data.valueAgain);
               ....
=======================================

以上,大家加油了

2014年7月24日 星期四

EF4->EF6,執行時出現 「The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.」訊息

 最近為了要用到log等機制及把entity 從web project 獨立成為函數庫的專業以供日後他案應用
索興把EF從4升到EF6,不過在執行測試時,出現以下的訊息:
===========================================================
The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
===========================================================
那會安爾生~~~!?
anyway,先找solution吧,
參考以下的連結,照他吩咐去做就是了:

1.把app.config (是caller project的app.config,不是entity 所在的project的app.confiig)的
<entityFramework>區塊拿掉

2.DbContext子類別--EntityContext類別提供一個public static getDbContext的函數,取代其建構元
   (能不能把建構元設為 inner或是private的層次?沒試,要試才知)
 ex:
   ==============================
 public static ERPEntities getDbContext() {
            if (!isEF6Inited) {
                // EF 6.0.1 throws an exception, unless we first probe the provider types.
                var type1 = typeof(System.Data.Entity.SqlServer.SqlProviderServices);
                //var type2 = typeof(System.Data.Entity.SqlServerCompact.SqlCeProviderServices);
            }
            return new ERPEntities();
        }
   ==============================
2.在repository(也就是呼叫/操作Entity Context的商業邏輯Facade類別)中,
  把原本呼叫new xxxEntity()的方式改由從 getDbContext()的方式取得DbContext


以上,大功告成,祝大家開發愉快了

2014年6月12日 星期四

for asp.net 2.0 "__doPostBack" 沒有無定義!?

錯誤訊息:"__doPostBack"找不到定義
不想討論成因
直接說solution好了
找個地方放個asp.net的TextBox,其AutoPostBack要設定為true
試看看就可以了.
..
什麼? 要把這TextBox隱藏起來啊,當然不能用asp:TextBox中的visible屬性,否則就白做了
直接用control.Style["visibility"]="hidden" 把它藏起來....而且還不會影響到功能

大家加油了

2014年6月7日 星期六

MSSQL 2000之連結及分頁 (for .net 2.0)

別看銀行系統億來億去的,他們很多內部系統到現在還在用classic asp & vb6的
而且SQL還是用2000的
案子接下來了就是要找solution的
1.MSSQL之於ASP.NET2.0的連接例句:
"server=10.10.10.20;uid=sa;pwd=s123A;database=Northwind"
就這樣簡單

2.分頁機制:
注意!! 只有MSSQL2005以上才支援ROW_NUMBER函數!!
所以要用別的方式來自己造出rownum

select * from
(SELECT productId,supplierid,
             (SELECT COUNT(*)
             FROM products AS em2
             WHERE em2.productID < em1.productID and   supplierId<>5) as temprownum
FROM products AS em1 where  supplierId<>5) as subtable

order by temprownum

 條件兩個都要有....別忘了.

(參考: http://www.dotblogs.com.tw/hatelove/archive/2009/07/14/9482.aspx)

不過我覺的最好用的方式是用temp Table的方式來做:
==============================================
select 
 testRowNum=IDENTITY(INT,1,1),
 orders.shipName,
 orders.ShipAddress,
 orders.CustomerId
 into #tempViewTest1974
from orders;
select * from #tempViewTest1974 where testRowNum between 10 and 20;
drop table #tempViewTest1974;
===============temp table 的流水號請自己產生比較妥當================




其他,有遇到再行補充.

2014年2月14日 星期五

oracle 11g create db後,遇到「監聽器未啟動或資料庫服務未在監聽器註冊」的error !?

環境:
server 2012 (64bit)+11g 64
在create一個「TOC64」的db時,結果出現以下錯誤畫面:
第一次看到這樣的錯誤,真的會很不知所措

如何解決?
請打開Net Manager:
1. 看一下「服務命名」是否有沒有把db加入(如果沒有,那就真的無救了,正常是會有的)
2.切換到Listener,IP形態的位址要指定(日後外部連入會用的到)
3.重點來了!!,請切換到listener的「其他服務」

   請新增一個「服務」,指定其「程式名稱」、「SID」及「ORACLE本位目錄」

Oracle本位目錄不知道的話,直接copy第一個服務的那個欄位來用就可以了
設定完後,儲存網路組態,再去服務中把Oracle Listener 的服務重新啟動(其相對的「OracleService你的DB」也重啟服務吧)
 用toad在本機連看看吧
----後記--------------------------
事實上最快的方式是直到修改listener.ora  & tnsnames.ora,修改完後,用tns name(在toad中手動輸入)直接去連就可以了
---listener.ora--參考內容
# listener.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_2\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (PROGRAM = extproc)
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_2)
    )
    (SID_DESC =
      (PROGRAM = ttcs64)
      (SID_NAME = ttcs64)
      (ORACLE_HOME = D:\app\Administrator\product\11.2.0\dbhome_2)
    )

  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.10.11)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = WIN-A2HVFKEQJ1M)(PORT = 1521))
    )

  )

ADR_BASE_LISTENER = D:\app\Administrator
=========================================

------------tnsnames.ora參考內容-----------------
# tnsnames.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_2\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

TOC64 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = WIN-A2HVFKEQJ1M)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TOC64)
    )
  )

ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))


TTCS64 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TTCS64)
    )
  )



LISTENER_TTCS64 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))


ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )
===============================================
以上,大家加油吧
  


2014年1月6日 星期一

for MSSQL-- 「in 」語法後面要用字串變數去做,行嗎?

舉例:
==================================
declare @id as varchar(100)
set @id='1,150,45,33'
 select rows from table where table.id in (@id)
============================
行嗎?
以上面這寫法是不行的,不過只要變巧一下
在這之前,先準備好一個叫做SplitWords函數,放心,人家已經寫好了
為了怕連結失效,我也在此Ctl-C / Ctl-V一下
================================================
CREATE FUNCTION SplitWords(@text varchar(8000))
   RETURNS @words TABLE (
      pos smallint primary key,
      value varchar(8000)
   )
AS
BEGIN
   DECLARE
      @pos smallint,
      @i smallint,
      @j smallint,
      @s varchar(8000)

   SET @pos = 1
   WHILE @pos <= LEN(@text) 
   BEGIN 
      SET @i = CHARINDEX(' ', @text, @pos)
      SET @j = CHARINDEX(',', @text, @pos)
      IF @i > 0 OR @j > 0
      BEGIN
         IF @i = 0 OR (@j > 0 AND @j < @i)
            SET @i = @j

         IF @i > @pos
         BEGIN
            -- @i now holds the earliest delimiter in the string
            SET @s = SUBSTRING(@text, @pos, @i - @pos)

            INSERT INTO @words
            VALUES (@pos, @s)
         END 
         SET @pos = @i + 1

         WHILE @pos < LEN(@text) 
            AND SUBSTRING(@text, @pos, 1) IN (' ', ',')
            SET @pos = @pos + 1 
      END 
      ELSE 
      BEGIN 
         INSERT INTO @words 
         VALUES (@pos, SUBSTRING(@text, @pos, LEN(@text) - @pos + 1))

         SET @pos = LEN(@text) + 1 
      END 
   END 
   RETURN 
END
================================================
有這個好用的函數後,之前的
----------------------------------------------------
declare @id as varchar(100)
set @id='1,150,45,33'
 select * from table1 where table1.id in (@id)
----------------------------------------------------
 改成:
----------------------------------------------------
declare @id as varchar(100)
set @id='1,150,45,33'
 select * from table1 t1
where t1.id in (select value from  dbo.SplitWords(@id) )
----------------------------------------------------
怎樣,好用吧?