Reads data from the string into the argument locations given by each format argument.
xp_sscanf {string OUTPUT, format}
[, argument [,...n]]
0 (success) or 1 (failure)
xp_sscanf returns this message:
The command(s) completed successfully.
Execute permissions default to the public role.
This example uses xp_sscanf to extract two values from a source string based on their positions in the format of the source string.
DECLARE @filename varchar (20), @message varchar (20)
EXEC xp_sscanf 'sync -b -fauthors10.tmp -rrandom', 'sync -b -f%s -r%s',
@filename OUTPUT, @message OUTPUT
SELECT @filename, @message
Here is the result set:
-------------------- --------------------
authors10.tmp random
xp_sprintf | System Stored Procedures (General Extended Procedures) |