Software Metering Console View – Part 2

Today, we will take our base query and extend it just a bit by clean up by giving each column at title.

There are 3 basis ways to do this.
1) use a single quotes to encapsulate the title ‘’
2) use square brackets []
3) single word after the column

To muddy the waters even farther you can use each of the above with or without the AS statement.

I have highlighted each line of the query below to show each of the different ways to add a title to the query.

Green is for a single word
Yellow is for single quotes
Blue is for square brackets

SELECT
 MPR.ProductName AS Name,
 MPR.OriginalFileName AS ‘Original File Name’,
 MPR.FileName [File Name],
 MPR.FileVersion Version,
 MPR.LanguageID AS [LanguageID] ,
 MPR.SourceSite ‘Site’,
 MPR.ApplyToChildSites [Apply to Child Site],
 MPR.Enabled as ‘Enabled’,
 MPR.SecurityKey as ‘Rule ID’
FROM
 v_MeteredProductRule MPR

As you can see from the above query mixing and match style is difficult to follow. I prefer to always use the single quotes with the “AS” command.

SELECT
 MPR.ProductName AS ‘Name’,
 MPR.OriginalFileName AS ‘Original File Name’,
 MPR.FileName AS ‘File Name’,
 MPR.FileVersion AS ‘Version’,
 MPR.LanguageID AS ‘LanguageID’,
 MPR.SourceSite AS ‘Site’,
 MPR.ApplyToChildSites AS ‘Apply to Child Site’,
 MPR.Enabled AS ‘Enabled’,
 MPR.SecurityKey AS ‘Rule ID’
FROM
 v_MeteredProductRule MPR

 

Leave a Reply

Your email address will not be published. Required fields are marked *