I try to understand the below code to print out all the table. However I have a few statement I am not quite understand can someone help. What I don't understand it the MIN in the select statement and the 'AND' Clause (look like it doing some string comparison with '>'
SET NOCOUNT ON
DECLARE @TableName nvarchar(256)
SET @TableName = ''
WHILE @TableName IS NOT NULL
SET @ColumnName = ''
SET @TableName =
SELECT MIN(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME))
WHERE TABLE_TYPE = 'BASE TABLE'
AND QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) > @TableName