2017年12月6日 星期三

Robocopy and a Few Examples

https://social.technet.microsoft.com/wiki/contents/articles/1073.robocopy-and-a-few-examples.aspx

利用robocopy複製資料夾結構(不複製檔案)

robocopy /zb /e /xf *

https://social.technet.microsoft.com/Forums/lync/en-US/0b3d3006-0e0f-4c95-9e2f-4c820832ebfa/using-robocopy-to-copy-folder-structure-only?forum=w7itprogeneral

/zb allows you access into the folders that you DON'T have permission to.  This will let you pull a complete folder structure even to the folders you haven't been granted permission to so that you don't have to mess with permissions to get this information.

2017年11月12日 星期日

WHERE 0 = (( CAST(CHARINDEX(N'Bill', [Extent1].[NAME]) AS int)) - 1)

            var result = from s1 in context.EMPLOYEE
                         where s1.NAME.IndexOf("Bill") == 0

=>上面的LINQ語法會產生以下SQL語法,滿少用到CHARINDEX
SELECT
    [Extent1].[ID] AS [ID],
    [Extent1].[NAME] AS [NAME]
    FROM [dbo].[EMPLOYEE] AS [Extent1]
    WHERE 0 = (( CAST(CHARINDEX(N'Bill', [Extent1].[NAME]) AS int)) - 1)

2017年11月6日 星期一