2023年2月1日 星期三

SQL TEXT 資料太長 撈不完整

 [SQL]PRINT 超長的字串 | 亂馬客 - 點部落 (dotblogs.com.tw)

SQL TEXT 資料太長 撈不完整

參考上面網址的方式,用分段print的方式顯示


DECLARE @DYNAMIC_SQL NVARCHAR(MAX) --建立一個超過 4,000 字元的變數 SET @DYNAMIC_SQL = N'select 1 as one, 2 as two, 3 as three' WHILE LEN(@DYNAMIC_SQL) < 4000 BEGIN SET @DYNAMIC_SQL = @DYNAMIC_SQL + CHAR(13) + N'union all select 1 as one, 2 as two, 3 as three' END --一次最多只會PRINT 4,000 個字,所以後面的會被截斷 PRINT '--PRINT ALL' PRINT @DYNAMIC_SQL --要全部PRINT出來需要分開來PRINT --每4,000個字就PRINT出來 DECLARE @START_OFFSET INT DECLARE @LEN INT SET @START_OFFSET = 0 SET @LEN = 4000 PRINT '--PRINT BATCH' WHILE (@START_OFFSET < LEN(@DYNAMIC_SQL)) BEGIN PRINT SUBSTRING(@DYNAMIC_SQL, @START_OFFSET, @LEN) SET @START_OFFSET = @START_OFFSET + @LEN END --再把剩下的給PRINT出來 PRINT SUBSTRING(@DYNAMIC_SQL, @START_OFFSET, @LEN)

2022年9月6日 星期二

 mac os iso 下載

修改VMX檔

smc.version="0"



https://www.imacpc.net/archives/4153

11.0版

https://walker-a.com/archives/6962


12版

https://www.geekrar.com/download-macos-ventura-vmdk-file-for-virtualbox-and-vmware/


2022年2月10日 星期四

IIS Rewrite使用範例說明

 參考網址:https://shiyousan.com/post/635648886502897428


該網址好像怪怪的

我擷取下來放PDF

PDF檔

2021年10月20日 星期三

Windows Server 2016 帳號密碼重置

 參考網頁:2 Ways to Reset Forgotten Windows Server 2016 Password | Password Recovery (top-password.com)


  1. Boot the server from the Windows Server 2016 Installation DVD. When the Setup screen appears, press SHIFT + F10 keys to open Command Prompt.
  2. At the Command Prompt, run the following commands:
    d:
    cd Windows\System32
    ren Utilman.exe Utilman.exe.original
    copy cmd.exe Utilman.exe
    shutdown -r -t 0
  3. The server should now reboot and present the logon screen. Press Windows Key + U or click the Ease of Access button, Command Prompt will pop up and type:
    net user Administrator P@ssword123
  4. Close the Command Prompt and you should now be able to log back onto Windows Server 2016 using the password you have provided in the previous step.


2020年5月5日 星期二

[asp] ASP 連DB by TLS1.2~

ODBC Driver 版本 可以檢查新增移除程式畫面

<%
set cnn2 = Server.CreateObject("ADODB.Connection")
cnn2.Open "driver={ODBC Driver 13 for SQL Server};database=test;server=servername;uid=sa;pwd=0000"

Response.write("abc<br/>def")

sql = "select * from master..spt_values"

set rs= Server.CreateObject("ADODB.RecordSet")
Response.write("<br/>ghi<br/>jkl<br/>")
rs.Open sql,cnn2 ,1,1

Response.write("spt_values rows:"&rs.recordcount&"<br/><br/>")

%>

2020年3月31日 星期二

[C#] 語系編碼

因為原檔案問題,導致必須用iso-8859-15, codepage=28605 才可正確讀出來類似"KROŠLÁK,Ján" 這種字。

但是使用BCP時,使用28605編碼,檔案卻會寫成28601編碼,導致寫入DB後變成亂碼,
所以當讀出後,改使用1252寫成BCP檔。