Accessing the Source Codes of the Website in SQL Server
Hello everyone,
In this article, I will give information about accessing the source code of the website in SQL Server.
In SQL Server, in some cases, we may want to access the source codes of the website with T-SQL codes.
First, you need to run the codes below and make the necessary adjustments.
EXEC sp_configure 'show advanced options', 1
RECONFIGURE
EXEC sp_configure 'Ole Automation Procedures', 1
RECONFIGURE
After the above codes run successfully, you can access the source codes using the query below.
DECLARE @HTMLContents AS TABLE
(
Contents NVARCHAR(MAX)
);
DECLARE @Request AS INT;
DECLARE @URL AS NVARCHAR(1000) = N'https://posmatik2.isbank.com.tr/LoginPanel.html';
EXEC sp_OACreate 'MSXML2.ServerXMLHTTP', @Request OUT;
EXEC sp_OAMethod @Request, 'open', NULL, 'GET', @URL, 'false';
EXEC sp_OAMethod @Request, 'send';
INSERT INTO @HTMLContents
(
Contents
)
EXEC sp_OAGetProperty @Request, 'responseText';
EXEC sp_OADestroy @Request;
SELECT Contents
FROM @HTMLContents;
When you run the query you will get the following result.
As you can see, we have obtained the Html codes, that is, the source codes of our site.
Good luck to everyone in business and life.