Line Width
gFmtOpt.LineWidth
integer
default: 80
indent size after wrapping for line width
gFmtOpt.LW_WrapTokenIndentSize
integer
default: 2
List item default setting
gFmtOpt.DefaultListFitIntoOne
integer
0: fit into one line
1: one item each line
default: 0
SQL before beautify
CREATE PROCEDURE production.usp_getlist @product VARCHAR ( 40 ) ,
@maxprice MONEY ,
@compareprice MONEY OUTPUT ,
@listprice MONEY OUT
AS
SELECT p.name AS product,
p.listprice AS 'List Price'
FROM production.product p
JOIN production.productsubcategory s
ON p.productsubcategoryid = s.productsubcategoryid
WHERE s.name LIKE @product
AND p.listprice < @maxprice;
select pic_id,pic_name,path
from pic_info a
where pic_id = (
select top 1 pic_id
from pic_info b
where b.pic_category = a.pic_category
order by pic_date desc
)
DECLARE @compareprice money, @cost money
EXECUTE usp_GetList '%Bikes%', 700,
@compareprice OUT,
@cost OUTPUT
IF @cost <= @compareprice
BEGIN
PRINT 'These products can be purchased for less than'
rollback
END
ELSE
PRINT 'The prices for all products in this category exceed '
GO
SQL after beautify
CREATE PROCEDURE production.usp_getlist @product VARCHAR ( 40 ),
@maxprice MONEY,
@compareprice MONEY OUTPUT,
@listprice MONEY OUT
AS
SELECT p.name AS product,
p.listprice AS 'List Price'
FROM production.product p
JOIN production.productsubcategory s
ON p.productsubcategoryid = s.productsubcategoryid
WHERE s.name LIKE @product
AND p.listprice < @maxprice;
SELECT pic_id,
pic_name,
PATH
FROM pic_info a
WHERE pic_id =
(
SELECT TOP 1 pic_id
FROM pic_info b
WHERE b.pic_category = a.pic_category
ORDER BY pic_date DESC
)
DECLARE @compareprice MONEY,
@cost MONEY
EXECUTE usp_getlist
'%Bikes%',
700,
@compareprice OUT,
@cost OUTPUT
IF @cost <= @compareprice
BEGIN
PRINT 'These products can be purchased for less than'
ROLLBACK
END
ELSE
PRINT 'The prices for all products in this category exceed '
GO