<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									MS SQL - Nội dung diễn đàn				            </title>
            <link>https://forum.sapb1.vn/community/mssql/</link>
            <description>Chuyên trang về hệ thống ERP SAP Business One</description>
            <language>en-US</language>
            <lastBuildDate>Sun, 22 Nov 2026 22:54:24 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Query thông tin hệ thống tài khoản kế toán (Chart of accounts)</title>
                        <link>https://forum.sapb1.vn/community/mssql/query-thong-tin-he-thong-tai-khoan-ke-toan-chart-of-accounts/</link>
                        <pubDate>Mon, 20 Apr 2026 23:44:54 +0000</pubDate>
                        <description><![CDATA[select &quot;Levels&quot; &#039;Level&#039;, &quot;AcctCode&quot; &#039;AccountCode&#039;, &quot;AcctName&quot; &#039;AccountName&#039;, &quot;ActCurr&quot; &#039;AccountCurrency&#039;, &quot;Finanse&quot; &#039;CashAccount&#039;, &quot;CfwRlvnt&quot; &#039;CashFlowRelevant&#039;, &quot;BlocManPos&quot; &#039;BlockManualPos...]]></description>
                        <content:encoded><![CDATA[<blockquote>
<p>select "Levels" 'Level', "AcctCode" 'AccountCode', "AcctName" 'AccountName', "ActCurr" 'AccountCurrency'<br />, "Finanse" 'CashAccount', "CfwRlvnt" 'CashFlowRelevant', "BlocManPos" 'BlockManualPosting'<br />, "LocManTran" 'ControlAccount', "ActType" 'AccountType', "Dim1Relvnt" 'Dim1Relevant'<br />, "Dim2Relvnt" 'Dim2Relevant'<br />from OACT where "Levels"&gt;1</p>
</blockquote>]]></content:encoded>
						                            <category domain="https://forum.sapb1.vn/community/mssql/">MS SQL</category>                        <dc:creator>admin</dc:creator>
                        <guid isPermaLink="true">https://forum.sapb1.vn/community/mssql/query-thong-tin-he-thong-tai-khoan-ke-toan-chart-of-accounts/</guid>
                    </item>
				                    <item>
                        <title>3660716 - SAP Business One supports Microsoft Windows Server 2025</title>
                        <link>https://forum.sapb1.vn/community/mssql/3660716-sap-business-one-supports-microsoft-windows-server-2025/</link>
                        <pubDate>Sun, 19 Oct 2025 12:18:48 +0000</pubDate>
                        <description><![CDATA[Symptom
SAP Business One newly supports Microsoft Windows Server 2025.
Cause
System Enhancement
Solution
System behavior prior to SAP Business One 10.0 SP 2511:
SAP Business One suppor...]]></description>
                        <content:encoded><![CDATA[<h3 id="Symptom" class="section" data-toc-skip="">Symptom</h3>
<p id="__html26"><span class="ph pname">SAP Business One</span><span> newly supports Microsoft Windows Server 2025.</span></p>
<h3 id="Cause" class="section" data-toc-skip="">Cause</h3>
<p id="">System Enhancement</p>
<h3 id="Solution" class="section" data-toc-skip="">Solution</h3>
<p><strong>System behavior prior to SAP Business One 10.0<span> </span><span>SP 2511</span>:</strong></p>
<p><span>SAP Business One supports the following Microsoft operating system versions:</span></p>
<ul id="loioa3f76b099c294630a7b38c2aba1de758__ul_kjz_dpt_vyb" class="ul">
<li class="li">Windows 11</li>
<li class="li">Windows 10</li>
<li class="li">Windows Server 2016</li>
<li class="li">Windows Server 2019</li>
<li class="li">Windows Server 2022</li>
</ul>
<p><strong>System behavior after upgrade to SAP Business One 10.0<span> </span><span>SP 2511</span>:</strong></p>
<p>SAP Business One supports the following Microsoft operating system versions:</p>
<ul id="loioa3f76b099c294630a7b38c2aba1de758__ul_kjz_dpt_vyb" class="ul">
<li class="li">Windows 11</li>
<li class="li">Windows 10</li>
<li class="li">Windows Server 2016</li>
<li class="li">Windows Server 2019</li>
<li class="li">Windows Server 2022</li>
<li class="li">Windows Server 2025</li>
</ul>
<p>Note: For information about the latest platform support matrix of SAP Business One Cloud, see <a class="sapMLnk sapMLnkWrapping sapMLnkMaxWidth" href="https://help.sap.com/doc/011000358700001248352012e/1.1/en-US/B1_Cloud_Platform_Support_Matrix.pdf" target="_blank" rel="noopener">SAP Business One Cloud Platform Support Matrix</a>.</p>]]></content:encoded>
						                            <category domain="https://forum.sapb1.vn/community/mssql/">MS SQL</category>                        <dc:creator>admin</dc:creator>
                        <guid isPermaLink="true">https://forum.sapb1.vn/community/mssql/3660716-sap-business-one-supports-microsoft-windows-server-2025/</guid>
                    </item>
				                    <item>
                        <title>SQL Cách chuyển từ cột sang dòng</title>
                        <link>https://forum.sapb1.vn/community/mssql/sql-cach-chuyen-tu-cot-sang-dong/</link>
                        <pubDate>Wed, 19 Feb 2025 13:58:12 +0000</pubDate>
                        <description><![CDATA[Cách pivot (chuyển từ dòng chuyển thành cột)
1. Tham khảo ở link sau:
2. Sử dụng hàm Pivot trong SQL
SELECT &#039;Actual&#039; &#039;Indicator&#039;,S1.Year, S1.SalesEmployee, 
ISNULL(,0) as &#039;Jan&#039;,
ISNU...]]></description>
                        <content:encoded><![CDATA[<p><strong>Cách pivot (chuyển từ dòng chuyển thành cột)</strong></p>
1. Tham khảo ở link sau:<br />
<p>https://forum.sapb1.vn/community/saphana/cach-pivot-ket-qua-truy-van-trong-sap-hana/#post-154</p>
<p>2. Sử dụng hàm Pivot trong SQL</p>
<pre contenteditable="false">SELECT 'Actual' 'Indicator',S1.Year, S1.SalesEmployee, 
ISNULL(,0) as 'Jan',
ISNULL(,0) as 'Feb',
ISNULL(,0) as 'Mar',
ISNULL(,0) as 'Apr',
ISNULL(,0) as 'May',
ISNULL(,0) as 'Jun',
ISNULL(,0) as 'Jul',
ISNULL(,0) as 'Aug',
ISNULL(,0) as 'Sep',
ISNULL(,0) as 'Oct',
ISNULL(,0) as 'Nov',
ISNULL(,0) as 'Dec'
FROM
(
select Year(T0.DocDate) 'Year', month(T0.DocDate) 'Month', T2.SlpName 'SalesEmployee', T1.LineTotal 'Amount'
from OINV T0 join INV1 T1 on T0.DocEntry=T1.DocEntry
left join OSLP T2 on T0.SlpCode=T2.SlpCode
where T0.CANCELED='N'
union
select Year(T0.DocDate) 'Year', month(T0.DocDate) 'Month', T2.SlpName 'SalesEmployee', -T1.LineTotal 'Amount'
from ORIN T0 join RIN1 T1 on T0.DocEntry=T1.DocEntry
left join OSLP T2 on T0.SlpCode=T2.SlpCode
where T0.CANCELED='N'
) S0
PIVOT (SUM(Amount) FOR month IN

(,,,,,,,,,,,)) S1

Group by S1.Year, S1.SalesEmployee, ,,,,,,,,,,,
Order by S1.Year Asc, S1.SalesEmployee asc
</pre>
197
<p><strong>Cách unpivot (từ cột chuyển thành dòng)</strong></p>
<pre contenteditable="false">select * from 
--convert from column to row
select DocEntry, U_SECode, U_SEName, '1' as 'Month', U_Jan as 'Amount' from 
union
select DocEntry, U_SECode, U_SEName, '2' as 'Month', U_Feb as 'Amount' from 
union
select DocEntry, U_SECode, U_SEName, '3' as 'Month', U_Mar as 'Amount' from 
union
select DocEntry, U_SECode, U_SEName, '4' as 'Month', U_Apr as 'Amount' from 
union
select DocEntry, U_SECode, U_SEName, '5' as 'Month', U_May as 'Amount' from 
union
select DocEntry, U_SECode, U_SEName, '6' as 'Month', U_Jun as 'Amount' from 
union
select DocEntry, U_SECode, U_SEName, '7' as 'Month', U_Jul as 'Amount' from 
union
select DocEntry, U_SECode, U_SEName, '8' as 'Month', U_Aug as 'Amount' from 
union
select DocEntry, U_SECode, U_SEName, '9' as 'Month', U_Sap as 'Amount' from 
union
select DocEntry, U_SECode, U_SEName, '10' as 'Month', U_Oct as 'Amount' from 
union
select DocEntry, U_SECode, U_SEName, '11' as 'Month', U_Nov as 'Amount' from 
union
select DocEntry, U_SECode, U_SEName, '12' as 'Month', U_Dec as 'Amount' from 
</pre>
<p>Minh họa:</p>
196]]></content:encoded>
						                            <category domain="https://forum.sapb1.vn/community/mssql/">MS SQL</category>                        <dc:creator>admin</dc:creator>
                        <guid isPermaLink="true">https://forum.sapb1.vn/community/mssql/sql-cach-chuyen-tu-cot-sang-dong/</guid>
                    </item>
				                    <item>
                        <title>SQL Cách chuyển đổi số nguyên (chuẩn thời gian) sang định dạng HH:MM:SS</title>
                        <link>https://forum.sapb1.vn/community/mssql/cach-chuyen-doi-so-nguyen-chuan-thoi-gian-sang-dinh-dang-hhmmss/</link>
                        <pubDate>Wed, 27 Dec 2023 14:05:59 +0000</pubDate>
                        <description><![CDATA[Để chuyển đổi số nguyên (chuẩn thời gian) sang định dạng HH:MM:SS, ta sử dụng hàm FORMAT như sau
select format(123456, &#039;00:00:00&#039;)
Ví dụ: truy vấn trong dữ liệu của bảng OPRQ (Purchase Req...]]></description>
                        <content:encoded><![CDATA[<p>Để chuyển đổi số nguyên (chuẩn thời gian) sang định dạng HH:MM:SS, ta sử dụng hàm FORMAT như sau</p>
<pre contenteditable="false">select format(123456, '00:00:00')</pre>
<p>Ví dụ: truy vấn trong dữ liệu của bảng OPRQ (Purchase Request)</p>
<p><img src="https://forum.sapb1.vn/wp-content/uploads/2023/12/2023-12-27_Convert-to-time-format.png" /></p>]]></content:encoded>
						                            <category domain="https://forum.sapb1.vn/community/mssql/">MS SQL</category>                        <dc:creator>admin</dc:creator>
                        <guid isPermaLink="true">https://forum.sapb1.vn/community/mssql/cach-chuyen-doi-so-nguyen-chuan-thoi-gian-sang-dinh-dang-hhmmss/</guid>
                    </item>
				                    <item>
                        <title>Cách để truy vấn ngày đầu tiên hoặc ngày cuối của tháng trước trong SQL</title>
                        <link>https://forum.sapb1.vn/community/mssql/cach-de-truy-van-ngay-dau-tien-hoac-ngay-cuoi-cua-thang-truoc-trong-sql/</link>
                        <pubDate>Wed, 20 Dec 2023 11:43:59 +0000</pubDate>
                        <description><![CDATA[Bạn có thể sử dụng câu truy vấn sau:
Ngày đầu tiên của tháng trước:
SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE())-1, 0)
Ngày cuối của tháng trước:
SELECT DATEADD(MONTH, DATEDIFF(MO...]]></description>
                        <content:encoded><![CDATA[<p><span style="vertical-align: inherit"><span style="vertical-align: inherit">Bạn có thể sử dụng câu truy vấn sau:</span></span></p>
<p><span style="vertical-align: inherit"><span style="vertical-align: inherit">Ngày đầu tiên của tháng trước:</span></span></p>
<pre contenteditable="false"><span style="vertical-align: inherit"><span style="vertical-align: inherit">SELECT DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE())-1, 0)</span></span></pre>
<p><span style="vertical-align: inherit"><span style="vertical-align: inherit">Ngày cuối của tháng trước:</span></span></p>
<pre contenteditable="false"><span style="vertical-align: inherit"><span style="vertical-align: inherit">SELECT DATEADD(MONTH, DATEDIFF(MONTH, -1, GETDATE())-1, -1)</span></span></pre>
<p> </p>
<p>Ví dụ minh họa bên dưới chạy câu truy vấn vào ngày 20/12/2023</p>
<p><img src="https://forum.sapb1.vn/wp-content/uploads/2023/12/2023-12-20_SQL-Dateadd-Datediff.png" /></p>]]></content:encoded>
						                            <category domain="https://forum.sapb1.vn/community/mssql/">MS SQL</category>                        <dc:creator>admin</dc:creator>
                        <guid isPermaLink="true">https://forum.sapb1.vn/community/mssql/cach-de-truy-van-ngay-dau-tien-hoac-ngay-cuoi-cua-thang-truoc-trong-sql/</guid>
                    </item>
				                    <item>
                        <title>Cách loại bỏ các ký tự đặc biệt trong SQL</title>
                        <link>https://forum.sapb1.vn/community/mssql/cach-loai-bo-cac-ky-tu-dac-biet-trong-sql/</link>
                        <pubDate>Sat, 16 Dec 2023 03:43:55 +0000</pubDate>
                        <description><![CDATA[Yêu cầu: cần loại bỏ các ký tự đặc biệt trong field text. 
Ví dụ:
Text trước khi được xử lý: &#039;%abc &amp;def #g $h Øi !j (k)&#039;
Text sau khi được xử lý: &#039;abc def g h i j k&#039;
Giải pháp:
DECL...]]></description>
                        <content:encoded><![CDATA[<p><strong>Yêu cầu:</strong> cần loại bỏ các ký tự đặc biệt trong field text. </p>
<p>Ví dụ:</p>
<p>Text trước khi được xử lý: '%abc &amp;def #g $h Øi !j (k)'</p>
<p>Text sau khi được xử lý: 'abc def g h i j k'</p>
<p><strong>Giải pháp:</strong></p>
<pre contenteditable="false">DECLARE @str VARCHAR(400)='%abc &amp;def #g $h Øi !j (k)'
DECLARE @expres  VARCHAR(50) = '%%'

WHILE PATINDEX( @expres, @str ) &gt; 0
SET @str = Replace(REPLACE( @str, SUBSTRING( @str, PATINDEX( @expres, @str ), 1 ),''),'-',' ')
SELECT @str</pre>
<p><img src="https://forum.sapb1.vn/wp-content/uploads/2023/12/2023-12-16_SQL-replace-function.png" /></p>
<p>Nguồn: <a href="https://stackoverflow.com/questions/65086061/how-to-remove-all-special-characters-from-a-column-name-string-using-regular-exp" target="_blank" rel="noopener">Stackoverflow</a></p>
<p> </p>]]></content:encoded>
						                            <category domain="https://forum.sapb1.vn/community/mssql/">MS SQL</category>                        <dc:creator>admin</dc:creator>
                        <guid isPermaLink="true">https://forum.sapb1.vn/community/mssql/cach-loai-bo-cac-ky-tu-dac-biet-trong-sql/</guid>
                    </item>
				                    <item>
                        <title>Cách truy vấn user đang hoạt động trong hệ thống SAP Business One</title>
                        <link>https://forum.sapb1.vn/community/mssql/cach-truy-van-user-dang-hoat-dong-trong-he-thong-sap-business-one/</link>
                        <pubDate>Tue, 21 Feb 2023 13:15:42 +0000</pubDate>
                        <description><![CDATA[Câu query để truy vấn các user hiện đang login và sử dụng hệ thống SAP B1:
Select r.UserCode from dbo.USR5 r
Where r.ClientName = HOST_NAME() and CONVERT(VARCHAR(50), r.DATE ,103) = CONVER...]]></description>
                        <content:encoded><![CDATA[<p>Câu query để truy vấn các user hiện đang login và sử dụng hệ thống SAP B1:</p>
<pre contenteditable="false">Select r.UserCode from dbo.USR5 r
Where r.ClientName = HOST_NAME() and CONVERT(VARCHAR(50), r.DATE ,103) = CONVERT(VARCHAR(50), getdate() ,103) and r.ProcName = 'SAP Business One.exe' and r.Action = 'I'
Group By r.UserCode
Having MAX(time) = Max(r.Time)</pre>
<p> </p>]]></content:encoded>
						                            <category domain="https://forum.sapb1.vn/community/mssql/">MS SQL</category>                        <dc:creator>admin</dc:creator>
                        <guid isPermaLink="true">https://forum.sapb1.vn/community/mssql/cach-truy-van-user-dang-hoat-dong-trong-he-thong-sap-business-one/</guid>
                    </item>
				                    <item>
                        <title>Cách kích hoạt / ngừng kích hoạt cho phép nhiều session khi sử dụng Remote Desktop Service</title>
                        <link>https://forum.sapb1.vn/community/mssql/cach-kich-hoat-ngung-kich-hoat-cho-phep-nhieu-session-khi-su-dung-remote-desktop-service/</link>
                        <pubDate>Fri, 07 Oct 2022 15:08:55 +0000</pubDate>
                        <description><![CDATA[1) Log into the server, where the Remote Desktop Services are installed.
2) Open the start screen (press the Windows key) and type gpedit.msc and open it.
3) Go to Computer Configuration &amp;...]]></description>
                        <content:encoded><![CDATA[<p>1) Log into the server, where the Remote Desktop Services are installed.</p>
<p>2) Open the start screen (press the Windows key) and type<span class="m42_texthighlight"><span> </span>gpedit.msc</span><span> </span>and open it.</p>
<p>3) Go to Computer Configuration &gt; Administrative Templates &gt; Windows Components &gt; Remote Desktop Services &gt; Remote Desktop Session Host &gt; Connections.</p>
<p style="text-align: center"><img src="https://forum.sapb1.vn/wp-content/uploads/2024/08/2022-10-07_RDS1.png" /></p>
<p>4) Set<span class="m42_texthighlight"><span> </span>Restrict Remote Desktop Services user to a single Remote Desktop Services session<span> </span></span>to<span> </span><span class="m42_texthighlight">Disabled</span>.</p>
<p style="text-align: center"><img src="https://forum.sapb1.vn/wp-content/uploads/2024/08/2022-10-07_RDS2.png" /></p>
<p>5) Double click<span> </span><span class="m42_texthighlight">Limit number of connections<span> </span></span>and set the RD Maximum Connections allowed to<span> </span><span class="m42_texthighlight">999999</span>.</p>
<p>Trường hợp muốn ngừng kích hoạt nhiều session thì ở bước 4, chọn Enable.</p>]]></content:encoded>
						                            <category domain="https://forum.sapb1.vn/community/mssql/">MS SQL</category>                        <dc:creator>admin</dc:creator>
                        <guid isPermaLink="true">https://forum.sapb1.vn/community/mssql/cach-kich-hoat-ngung-kich-hoat-cho-phep-nhieu-session-khi-su-dung-remote-desktop-service/</guid>
                    </item>
				                    <item>
                        <title>Cách tăng/giảm font size cửa sổ Query Result trong MS SQL</title>
                        <link>https://forum.sapb1.vn/community/mssql/cach-tang-giam-font-size-cua-so-query-result-trong-ms-sql/</link>
                        <pubDate>Mon, 06 Jun 2022 07:35:31 +0000</pubDate>
                        <description><![CDATA[Trường hợp cần tăng/giảm kích cỡ font của cửa sổ Query Result, vào Tools/ Options/ Environment/ Fonts and Colors. Sau đó chọn Grid Results và thay đổi kích cỡ font.]]></description>
                        <content:encoded><![CDATA[<p>Trường hợp cần tăng/giảm kích cỡ font của cửa sổ Query Result, vào Tools/ Options/ Environment/ Fonts and Colors. Sau đó chọn Grid Results và thay đổi kích cỡ font.</p>
<p><img src="https://forum.sapb1.vn/wp-content/uploads/2024/08/2022-06-06-SQLQueryResult02.png" /></p>]]></content:encoded>
						                            <category domain="https://forum.sapb1.vn/community/mssql/">MS SQL</category>                        <dc:creator>admin</dc:creator>
                        <guid isPermaLink="true">https://forum.sapb1.vn/community/mssql/cach-tang-giam-font-size-cua-so-query-result-trong-ms-sql/</guid>
                    </item>
				                    <item>
                        <title>Cách sửa lỗi &quot;String or binary data would be truncated&quot;</title>
                        <link>https://forum.sapb1.vn/community/mssql/cach-sua-loi-string-or-binary-data-would-be-truncated/</link>
                        <pubDate>Wed, 04 May 2022 16:50:01 +0000</pubDate>
                        <description><![CDATA[Quá trình thao tác dữ liệu ở MS SQL, xuất hiện báo lỗi
&quot;String or binary data would be truncated. The statement has been terminated&quot;.
Nguyên nhân:
Trong khi thiết kế các bảng, có những tr...]]></description>
                        <content:encoded><![CDATA[<p>Quá trình thao tác dữ liệu ở MS SQL, xuất hiện báo lỗi</p>
<p><span>"String or binary data would be truncated. The statement has been terminated".</span></p>
<p><strong>Nguyên nhân:</strong></p>
<p><span>Trong khi thiết kế các bảng, có những trường, cột bạn thiết lập kiểu dữ liệu dạng chuỗi như: NVARCHAR, VARCHAR, CHAR, ... quy định quá ít kí tự nên khi bạn chèn vào dữ liệu có độ dài lớn hơn quy định giới hạn thì sẽ phát sinh ra lỗi này.</span></p>
<p> </p>
<p><strong>Cách khắc phục:</strong></p>
<p><span>Để khắc phục, bạn điều chỉnh là độ dài giới hạn mà bạn thiết kế, hoặc rút ngắn lại dữ liệu của bạn chèn vào. Sau đó thử lại nhé.</span></p>]]></content:encoded>
						                            <category domain="https://forum.sapb1.vn/community/mssql/">MS SQL</category>                        <dc:creator>admin</dc:creator>
                        <guid isPermaLink="true">https://forum.sapb1.vn/community/mssql/cach-sua-loi-string-or-binary-data-would-be-truncated/</guid>
                    </item>
							        </channel>
        </rss>
		