Formats and stores a series of characters and values in the string output parameter. Each format argument is replaced with the corresponding argument.
xp_sprintf @string OUTPUT, format [, argument]...
where
This example uses the @string parameter to send an INSERT statement. The actual value of @string will contain 'INSERT table1 VALUES(1, 2).'
DECLARE @string varchar (255) EXEC xp_sprintf @string OUTPUT, 'INSERT INTO %s VALUES (%s, %s)', 'table1', '1', '2'
Execute permission defaults to the public group.
xp_sscanf |