簡單的快樂

晚餐時,坐在對面的兒子問,我看起來很久都不快樂,是在愁什麼?

默然無以對。愁什麼?

我喪失了簡單的快樂。動手,跟產出互動,了解,欣賞,放下。不二分,不針貶。

觀察自己,守住簡單。為何始終辦不到?

 

 

 

凡存在的,都合理。不理解而罣礙、恐懼。這似乎隨著年紀增長,漸漸變成太陽下無奇事,既不好奇,也不動心。

但掛心著人,這是否要去掉?總想收集一張張笑臉,這是否是生為人的基本?慈與愛。我願意去之而求靜嗎?

我欣賞拔一毛而利天下,不為也。一顆心不動,但,我要嗎?

詭異的翻譯…

https://docs.microsoft.com/zh-tw/sql/integration-services/what-s-new-in-integration-services-in-sql-server-2017

純粹好玩的機器翻譯標本…

image

透過 T-SQL Script 建立 Table 定義

Sorry,忘了來源出處,但為了讓朋友 Copy,所以貼在此處…

CREATE proc [ETL].[spCreateTable] @table_name SYSNAME,@On nvarchar(max)=",@SQLScript nvarchar(max) output
as
DECLARE
      @object_name SYSNAME
    , @object_id INT

SELECT
      @object_name = ‘[‘ + s.name + ‘].[‘ + o.name + ‘]’
    , @object_id = o.[object_id]
FROM CPADW.sys.objects o WITH (NOWAIT)
JOIN CPADW.sys.schemas s WITH (NOWAIT) ON o.[schema_id] = s.[schema_id]
WHERE s.name + ‘.’ + o.name = @table_name
    AND o.[type] = ‘U’
    AND o.is_ms_shipped = 0

DECLARE @SQL NVARCHAR(MAX) = “

;WITH index_column AS
(
    SELECT
          ic.[object_id]
        , ic.index_id
        , ic.is_descending_key
        , ic.is_included_column
        , c.name
    FROM CPADW.sys.index_columns ic WITH (NOWAIT)
    JOIN CPADW.sys.columns c WITH (NOWAIT) ON ic.[object_id] = c.[object_id] AND ic.column_id = c.column_id
    WHERE ic.[object_id] = @object_id
),
fk_columns AS
(
     SELECT
          k.constraint_object_id
        , cname = c.name
        , rcname = rc.name
    FROM CPADW.sys.foreign_key_columns k WITH (NOWAIT)
    JOIN CPADW.sys.columns rc WITH (NOWAIT) ON rc.[object_id] = k.referenced_object_id AND rc.column_id = k.referenced_column_id
    JOIN CPADW.sys.columns c WITH (NOWAIT) ON c.[object_id] = k.parent_object_id AND c.column_id = k.parent_column_id
    WHERE k.parent_object_id = @object_id
)
SELECT @SQL = ‘CREATE TABLE ‘ + @object_name + CHAR(13) + ‘(‘ + CHAR(13) + STUFF((
    SELECT CHAR(9) + ‘, [‘ + c.name + ‘] ‘ +
        CASE WHEN c.is_computed = 1
            THEN ‘AS ‘ + cc.[definition]
            ELSE UPPER(tp.name) +
                CASE WHEN tp.name IN (‘varchar’, ‘char’, ‘varbinary’, ‘binary’, ‘text’)
                       THEN ‘(‘ + CASE WHEN c.max_length = -1 THEN ‘MAX’ ELSE CAST(c.max_length AS VARCHAR(5)) END + ‘)’
                     WHEN tp.name IN (‘nvarchar’, ‘nchar’, ‘ntext’)
                       THEN ‘(‘ + CASE WHEN c.max_length = -1 THEN ‘MAX’ ELSE CAST(c.max_length / 2 AS VARCHAR(5)) END + ‘)’
                     WHEN tp.name IN (‘datetime2’, ‘time2’, ‘datetimeoffset’)
                       THEN ‘(‘ + CAST(c.scale AS VARCHAR(5)) + ‘)’
                     WHEN tp.name = ‘decimal’
                       THEN ‘(‘ + CAST(c.[precision] AS VARCHAR(5)) + ‘,’ + CAST(c.scale AS VARCHAR(5)) + ‘)’
                    ELSE "
                END +
                CASE WHEN c.collation_name IS NOT NULL THEN ‘ COLLATE ‘ + c.collation_name ELSE " END +
                CASE WHEN c.is_nullable = 1 THEN ‘ NULL’ ELSE ‘ NOT NULL’ END +
                CASE WHEN dc.[definition] IS NOT NULL THEN ‘ DEFAULT’ + dc.[definition] ELSE " END +
                CASE WHEN ic.is_identity = 1 THEN ‘ IDENTITY(‘ + CAST(ISNULL(ic.seed_value, ‘0’) AS CHAR(1)) + ‘,’ + CAST(ISNULL(ic.increment_value, ‘1’) AS CHAR(1)) + ‘)’ ELSE " END
        END + CHAR(13)
    FROM CPADW.sys.columns c WITH (NOWAIT)
    JOIN CPADW.sys.types tp WITH (NOWAIT) ON c.user_type_id = tp.user_type_id
    LEFT JOIN CPADW.sys.computed_columns cc WITH (NOWAIT) ON c.[object_id] = cc.[object_id] AND c.column_id = cc.column_id
    LEFT JOIN CPADW.sys.default_constraints dc WITH (NOWAIT) ON c.default_object_id != 0 AND c.[object_id] = dc.parent_object_id AND c.column_id = dc.parent_column_id
    LEFT JOIN CPADW.sys.identity_columns ic WITH (NOWAIT) ON c.is_identity = 1 AND c.[object_id] = ic.[object_id] AND c.column_id = ic.column_id
    WHERE c.[object_id] = @object_id
    ORDER BY c.column_id
    FOR XML PATH(“), TYPE).value(‘.’, ‘NVARCHAR(MAX)’), 1, 2, CHAR(9) + ‘ ‘)
    + ISNULL((SELECT CHAR(9) + ‘, CONSTRAINT [‘ + k.name + ‘] PRIMARY KEY (‘ +
                    (SELECT STUFF((
                         SELECT ‘, [‘ + c.name + ‘] ‘ + CASE WHEN ic.is_descending_key = 1 THEN ‘DESC’ ELSE ‘ASC’ END
                         FROM CPADW.sys.index_columns ic WITH (NOWAIT)
                         JOIN CPADW.sys.columns c WITH (NOWAIT) ON c.[object_id] = ic.[object_id] AND c.column_id = ic.column_id
                         WHERE ic.is_included_column = 0
                             AND ic.[object_id] = k.parent_object_id
                             AND ic.index_id = k.unique_index_id    
                         FOR XML PATH(N"), TYPE).value(‘.’, ‘NVARCHAR(MAX)’), 1, 2, “))
            + ‘)’ + CHAR(13)
            FROM CPADW.sys.key_constraints k WITH (NOWAIT)
            WHERE k.parent_object_id = @object_id
                AND k.[type] = ‘PK’), “) + ‘) ‘ + @On + CHAR(13)
    + ISNULL((SELECT (
        SELECT CHAR(13) +
             ‘ALTER TABLE ‘ + @object_name + ‘ WITH’
            + CASE WHEN fk.is_not_trusted = 1
                THEN ‘ NOCHECK’
                ELSE ‘ CHECK’
              END +
              ‘ ADD CONSTRAINT [‘ + fk.name  + ‘] FOREIGN KEY(‘
              + STUFF((
                SELECT ‘, [‘ + k.cname + ‘]’
                FROM fk_columns k
                WHERE k.constraint_object_id = fk.[object_id]
                FOR XML PATH(“), TYPE).value(‘.’, ‘NVARCHAR(MAX)’), 1, 2, “)
               + ‘)’ +
              ‘ REFERENCES [‘ + SCHEMA_NAME(ro.[schema_id]) + ‘].[‘ + ro.name + ‘] (‘
              + STUFF((
                SELECT ‘, [‘ + k.rcname + ‘]’
                FROM fk_columns k
                WHERE k.constraint_object_id = fk.[object_id]
                FOR XML PATH(“), TYPE).value(‘.’, ‘NVARCHAR(MAX)’), 1, 2, “)
               + ‘)’
            + CASE
                WHEN fk.delete_referential_action = 1 THEN ‘ ON DELETE CASCADE’
                WHEN fk.delete_referential_action = 2 THEN ‘ ON DELETE SET NULL’
                WHEN fk.delete_referential_action = 3 THEN ‘ ON DELETE SET DEFAULT’
                ELSE "
              END
            + CASE
                WHEN fk.update_referential_action = 1 THEN ‘ ON UPDATE CASCADE’
                WHEN fk.update_referential_action = 2 THEN ‘ ON UPDATE SET NULL’
                WHEN fk.update_referential_action = 3 THEN ‘ ON UPDATE SET DEFAULT’ 
                ELSE "
              END
            + CHAR(13) + ‘ALTER TABLE ‘ + @object_name + ‘ CHECK CONSTRAINT [‘ + fk.name  + ‘]’ + CHAR(13)
        FROM CPADW.sys.foreign_keys fk WITH (NOWAIT)
        JOIN CPADW.sys.objects ro WITH (NOWAIT) ON ro.[object_id] = fk.referenced_object_id
        WHERE fk.parent_object_id = @object_id
        FOR XML PATH(N"), TYPE).value(‘.’, ‘NVARCHAR(MAX)’)), “)
    + ISNULL(((SELECT
         CHAR(13) + ‘CREATE’ + CASE WHEN i.is_unique = 1 THEN ‘ UNIQUE’ ELSE " END
                + ‘ NONCLUSTERED INDEX [‘ + i.name + ‘] ON ‘ + @object_name + ‘ (‘ +
                STUFF((
                SELECT ‘, [‘ + c.name + ‘]’ + CASE WHEN c.is_descending_key = 1 THEN ‘ DESC’ ELSE ‘ ASC’ END
                FROM index_column c
                WHERE c.is_included_column = 0
                    AND c.index_id = i.index_id
                FOR XML PATH(“), TYPE).value(‘.’, ‘NVARCHAR(MAX)’), 1, 2, “) + ‘)’ 
                + ISNULL(CHAR(13) + ‘INCLUDE (‘ +
                    STUFF((
                    SELECT ‘, [‘ + c.name + ‘]’
                    FROM index_column c
                    WHERE c.is_included_column = 1
                        AND c.index_id = i.index_id
                    FOR XML PATH(“), TYPE).value(‘.’, ‘NVARCHAR(MAX)’), 1, 2, “) + ‘)’, “)  + CHAR(13)
        FROM CPADW.sys.indexes i WITH (NOWAIT)
        WHERE i.[object_id] = @object_id
            AND i.is_primary_key = 0
            AND i.[type] = 2
        FOR XML PATH(“), TYPE).value(‘.’, ‘NVARCHAR(MAX)’)
    ), “)
set @SQLScript=@SQL

建立用來移轉帳號的 T-SQL 語法

SELECT    CONCAT(‘CREATE LOGIN [‘, name, ‘] WITH PASSWORD=’, CONVERT(varchar(256),password_hash,1), ‘ HASHED,SID=’,CONVERT(varchar(85),sid,1),’;’)
FROM    sys.sql_logins
WHERE    name IN (‘SQL 自家帳號 1′,’SQL 自家帳號 2’);

突然間 Power BI Report Server 面市了

感謝 Justin Li 今天告知

https://powerbi.microsoft.com/zh-tw/report-server/

image

image

image

image

RS 的過濾條件用 OR

但就介面只能設定 AND,可以透過 VB.NET 設定 OR

image

運算式以 VB.NET 定義 Or 條件

image

值要求 true

image

冷面笑匠,無由地暴怒

完全喪失了耐性,一早,上課前,來聽課的朋友禮貌地詢問問題,但前一刻平靜的自己瞬間冒起滿腔怒火,完全不想回答。

為何要回答問題,因為我是老師。

可不可以不要當老師,我不知道,僅是循著日子的軌跡活著。

僅是如工具般地回答,直覺受者聽懂了一半,只想省去她自己找答案的工,每一步都將會回來問,拿著 RS 終要模仿出 BO。

腦中縈繞著 "談笑有鴻儒,往來無白丁"。

自知自己匠氣十足,絕非鴻儒,但不知自己為何憤怒地視聽者為白丁,畢竟這本來就是教與學,就是師者解惑的天職,不過聞道有先後,術業有專攻地交換。但,我失之於憤怒,失之於無情。憤怒於自己的憤怒,無奈於自己的無奈。

我的對話是如此的無趣,每次教課就磨去些許興味,一點一滴流逝的耐性不知要如何拾回,一攤死水激不起一點浪花。

對大家講著工作經驗累積成的笑話時,自己完全冷漠憤怒。我可以感受到笑匠的孤獨與憤世嫉俗,講過一千次膚淺的笑話,其中有可能是自己的血淚,但一批批無感的受眾簡單地吞食,反射式地發笑。無可欲語地對比,荒謬的畫面在小丑的心底。

 

 

無由地,對被稱為"老師"感到厭煩。施比受更有福,是施者從中找到某種價值時。兩相各自認可不同的價值,在施與受的過程中流動,兩相都是施者與受者。現在,當 "教" 僅止於敘說時,這是個被掏空的過程。

只看到錢

朋友傳來這篇 自願被微軟綁架的台灣政府

從出發點正好說明為何我們只能用微軟的產品,因為作者群並未著力在軟體生態系如何能成功,只圍繞著

  • 花了多少錢,錢的流向為何
  • 為何要依賴微軟提供的某些功能
  • 別人能,我們就應該能

軟體是需要長長久久地活下去,若沒有自給自足的生態系,將發揮不出使用這軟體的好處。若用到一半無以為繼,需要重頭來過,則因為洗掉長期累積的使用者與 IT 共有的需求與經驗,重新打造需等待使用者與 IT 重新找出最佳用法;而後才能發揮系統綜效,這將是更大的損失。畢竟使用者操作軟體時要熟悉到如同呼吸吃飯,不用思考軟體本身才能用它來互動與工作,否則企業團隊將陷於軟體本身造成的混亂。

然而養成生態系千頭萬緒,只看到大家罵 III,卻從未看到如何建立與養成的討論與實例。

除了產品本身外,企業用的系統需要:教育訓練(終端使用者與 IT 兩類)、乙方支援廠家、協力套件開發商、長期穩定的研發與升級維護策略。否則,這項技術可能就曇花一現。而這些生態系上的物種需要市場來相互滋養,不是一筆經費預算的問題。

希望宜蘭縣政府能本著養活 IT 生態系的規劃使用自由軟體,而非省錢的初衷對待軟體,否則將在數年後面對荒蕪的 IT 系統,得再花更多的經費追趕。

打工

未上大學前,小兒迎來高三下的空檔。

小兒抱怨著:

為何所有打工的人只有我要負責那個垃圾桶,我就必須要到 11 點才能離開,正職反而不需要?

為何現在才 Line 我,突然下午 3:00 就要上班,不提前一天通知,我還要畫畢業時,班上要用的看板,我能裝作沒看到 Line 嗎?

念相關科系的打工者才會到前場,我們只能在後場打雜…

我只有淡淡地回了一句:

在工作中你看到值得學的,還是值得抱怨的,決定你的未來。

 

再一次,小兒面臨社會化的關卡。人生中,只有苦難可以刻畫人格,氣度是被迫撐出來的,學不來,也非天生。每吞下一次咬牙切齒,就不再為此煩心。每嘗一次苦,就更理解苦會變淡,而能維持步調走過。不急著脫離,才能靜心觀察,也才有所得。

每一次小兒的抱怨都讓我看到成長的腳步,他帶著自嘲結束抱怨,上班到深夜 12 點回家,翅膀慢慢地硬了。逆境才能認識自己,也才能累積自信,而後能自處。人生終了時,才平靜地歸於平靜,不疾不徐。

在小兒累積對自己的信賴過程中,作為墊腳石的我,只能盼望。

讓生命更為生動

https://www.facebook.com/overdope/videos/10153922949174364/

順遂的生命,混凝土色

生命中的艱困黑色,讓一生的圖騰立體鮮明