Revolving around the core of technology
| Document ID: | 5204 | 
|---|---|
| Subject: | Special Comments in WinSQL | 
| Creation date: | 3/16/18 11:28 AM | 
| Last modified on: | 3/16/18 11:28 AM | 
| Comment | Description | 
|---|---|
-- wn_NamedQuery | 
	Specifies a name for a Named Query. This value is useful when you try to save a named query. | 
-- wn_PageTitle | 
	Specifies a name for current Query Page.  
	 | 
-- wn_SaveToCSV | 
	Saves the results of a SELECT query to a text file in CSV format. This comments takes a file name as parameter representing
	the path for the output file. 
	
	 For Example 
		-- wn_SaveToCSV C:\Temp\Customer.csv
select FirstName, LastName, sum(Cost) as TotalOrderValue 
from Customer INNERT JOIN Orders
    ON Customer.ID = Orders.ID
where state = 'NJ'  
		 | 
-- wn_SaveTabDelimited | 
	
	Similar to CSV, this comment saves the output of a SELECT query to a tab-delimited file. 
	
	 For Example 
		-- wn_SaveTabDelimited C:\Temp\Sample.txt
select FirstName, LastName, sum(Cost) as TotalOrderValue 
from Customer INNERT JOIN Orders
	ON Customer.ID = Orders.ID
where state = 'NJ'  
		 | 
-- wn_SaveToHTM | 
	
	Similar to CSV, this comment saves the output of a SELECT query to a HTML file. 
	
	 For Example 
		-- wn_SaveToHTM C:\Temp\Sample.htm
select FirstName, LastName, sum(Cost) as TotalOrderValue 
from Customer INNERT JOIN Orders
	ON Customer.ID = Orders.ID
where state = 'NJ'  
		htmlHead.txt file in
	the DataFolder
	 | 
-- wn_SaveInsertStatements | 
	
	Saves INSERT INTO statements based on a SELECT query.
	
	 For Example 
		-- wn_SaveInsertStatements C:\Temp\Sample.sql,CustomerOrders
select FirstName, LastName, sum(Cost) as TotalOrderValue 
from Customer INNERT JOIN Orders
	ON Customer.ID = Orders.ID
where state = 'NJ'  
	
		This comment takes two parameters: 
 Each parameter is separated by a comma. A table name will be assigned based on the name of the file if the second parameter, table name, is omitted.  | 
-- wn_ShowColumnInfo | 
	
		Displays the metadata for a SELECT query. 
	
		 For Example 
		-- wn_ShowColumnInfo
select *
from dbo.Customer c
where Dop >= GetDate() - 1 
		
		 | 
-- wn_TabTitle | 
	
	
	This is a convenient way to specify a title for the tab in the grid. This becomes useful if you need to save the contents of a result grid.
		 For Example 
		-- wn_TabTitle One Day Cust
select *
from dbo.Customer c
where Dop >= GetDate() - 1
 
	
		 | 
Posted by George Soulis on 9/21/18 2:03 AM
Do you have a helpful tip related to this document that you'd like to share with other users?