create procedure sys.sp_MSpad_command (
@cmd nvarchar(4000) output,
@indent int = 0) -- indent for command buffer (for pretty formatting
as
BEGIN
declare
@cnt int
,@num_tabs int
,@num_spaces int
select @cmd = N''
select @num_tabs = @indent / 4
select @num_spaces = @indent % 4
select @cnt = 0
while (@cnt < @num_tabs)
begin
select @cmd = @cmd + N' '
select @cnt = @cnt + 1
end
select @cnt = 0
while (@cnt < @num_spaces)
begin
select @cmd = @cmd + N' '
select @cnt = @cnt + 1
end
END