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.

Accessing the Source Codes of the Website in SQL Server

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.

181 Views

Yavuz Selim Kart

I try to explain what I know in software and database. I am still improving myself by doing research on many programming languages. Apart from these, I am also interested in Graphic Design and Wordpress. I also have knowledge about SEO and Social media management. In short, I am a determined person who likes to work hard.

You may also like...

Don`t copy text!