The network packet size configuration option in SQL Server is used to set the package size (in bytes) to be used when communicating with SQL server. The size can be set on the server side as well as on some of the client side libraries. The default packet size set by Microsoft SQL Server is 4,096 bytes. This article discusses some of the issues that you need to be aware of when making changes to this setting.
As mentioned in the following note in Books Online topic on this option, we recommend that you do not change this value unless you are certain that it will improve performance.
Note: |
---|
Do not change the packet size unless you are certain that it will improve performance. For most applications, the default packet size is best. |
The network packet size on the server side can be configured using network packet size configuration option.
For more information on how to control this setting from a client net library refer to the following table:
Client library | Option | Default |
SSPROP_INIT_PACKETSIZE | 0 (use server side) | |
PacketSize | 8000 | |
SQL_ATTR_PACKET_SIZE | Use server side | |
SSPROP_INIT_PACKETSIZE | 4096 | |
setPacketSize(int packetSize) | 8000 |
Note: The current documentation for Sqlclient incorrectly states the default Packet Size for Sqlclient connections as 8192. This will be corrected in a future refresh of Books Online.
The network packet size of a client connection can be determined by monitoring the Audit Login event or the ExistingConnection event in SQL Profiler. The Integer Data data column contains the network packet size.