Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This article "<a href="http://www.databasejournal.com/features/mssql/article.php/1443521/Copy-Text-or-Image-into-or-out-of-SQL-Server.htm" rel="nofollow noreferrer">Copy Text or Image into or out of SQL Server</a>" could help:</p> <p>You could integrate the TEXTCOPY command line tool in a stored procedure:</p> <pre><code>CREATE PROCEDURE sp_textcopy ( @srvname varchar (30), @login varchar (30), @password varchar (30), @dbname varchar (30), @tbname varchar (30), @colname varchar (30), @filename varchar (30), @whereclause varchar (40), @direction char(1)) AS DECLARE @exec_str varchar (255) SELECT @exec_str = 'textcopy /S ' + @srvname + ' /U ' + @login + ' /P ' + @password + ' /D ' + @dbname + ' /T ' + @tbname + ' /C ' + @colname + ' /W "' + @whereclause + '" /F ' + @filename + ' /' + @direction EXEC master..xp_cmdshell @exec_str </code></pre> <p>You'll have to change/extend it a little in order to read the created file into the other database.</p> <p>As <a href="https://stackoverflow.com/users/5190/vinko-vrsalovic">Vinko</a> writes in the comment to this answer, hold in mind that this requires enabling xp_cmdshell in the surface area configuration.</p> <p><strong>Description of TEXTCOPY:</strong></p> <p><em>Copies a single text or image value into or out of SQL Server. The value is a specified text or image 'column' of a single row (specified by the "where clause") of the specified 'table'.</em></p> <p><em>If the direction is IN (/I) then the data from the specified 'file' is copied into SQL Server, replacing the existing text or image value. If the direction is OUT (/O) then the text or image value is copied from SQL Server into the specified 'file', replacing any existing file.</em></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload