Does socket communication support CLR integration?
For example: I have a PROC created in CLR Integration.It get all the data from a table and just want to send the data to a TCP server.
Team:
CREATE ASSEMBLY TcpClr FROM 'G:\TcpClrTest.dll' WITH PERMISSION_SET = EXTERNAL_ACCESS GO CREATE PROCEDURE SendDataToSrv ( @NAME nvarchar(20) ) AS EXTERNAL NAME TcpClr.[TcpClrTest.TcpSend].SqlProce; GO EXEC SendDataToSrv 'cdc.dbo_Test_CT'
Some code in TcpClrTest.dll :
using (SqlCommand cmd = new SqlCommand("SELECT * FROM tableName", con)) { using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) {
I have exec with the EXEC SendDataToSrv 'cdc.dbo_Test_CT' command EXEC SendDataToSrv 'cdc.dbo_Test_CT' , the table has 100,000 rows and 18 columns. It will cost about 5 minutes. I also copy the same code into a common function, not CLR Integration, it only costs about 30 seconds. TCP Server and SQL Server running on the same computer. If I delete the tcpClient.Write(value) code, just get the data from the table, it will happen quickly.
In CLR integration, all I have to do to improve
c # sql-server sockets sqlclr
zhengkang
source share