0

/t5/coldfusion-discussions/sql-add-blank-row-to-result/td-p/772119
Mar 17, 2009
Mar 17, 2009
Copy link to clipboard
Copied
Hi,
I currently use a temporary table to add a blank row to the top/beginning of my query results. I'm moving to MS SQL stored procedures and wanted to know if it's possible to add a blank row right into my SQL so I can eliminate the temporary table solution.
Any thoughts on this are appreciated!
cfwild
I currently use a temporary table to add a blank row to the top/beginning of my query results. I'm moving to MS SQL stored procedures and wanted to know if it's possible to add a blank row right into my SQL so I can eliminate the temporary table solution.
Any thoughts on this are appreciated!
cfwild
TOPICS
Database access
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Mar 18, 2009
Mar 18, 2009
Hi,
Thanks for the insight. It worked perfectly! For anyone looking for just a blank row insert "above" the query results, here was the final code:
SELECT Category
FROM Syndicated
UNION
SELECT ''
ORDER BY Category
Again, thanks for the help!
Thanks for the insight. It worked perfectly! For anyone looking for just a blank row insert "above" the query results, here was the final code:
SELECT Category
FROM Syndicated
UNION
SELECT ''
ORDER BY Category
Again, thanks for the help!
Valorous Hero
,
/t5/coldfusion-discussions/sql-add-blank-row-to-result/m-p/772120#M71807
Mar 17, 2009
Mar 17, 2009
Copy link to clipboard
Copied
> wanted to know if it's possible to add a blank row right
into my SQL so I can eliminate
> the temporary table solution
You could use a union to merge your blank row with your other results and order it so the blank sorts on top. But why do you need a blank row? It sounds like mixing user interface code with database code ..
> the temporary table solution
You could use a union to merge your blank row with your other results and order it so the blank sorts on top. But why do you need a blank row? It sounds like mixing user interface code with database code ..
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/coldfusion-discussions/sql-add-blank-row-to-result/m-p/772121#M71808
Mar 17, 2009
Mar 17, 2009
Copy link to clipboard
Copied
Hi,
Thanks for responding.
I fashioned this up, but I'm throwing an error:
SELECT S.Category
FROM Syndicated S
UNION '<HI>'
ORDER BY S.Category
Thoughts on getting this to work in tsql?
cfwild
My problem is that I'm binding this to the cfselect, the bind doesn't allow the queryposition above|below functionality to work. So I'm forced to a). temp table (which is working fine) or b). investigate adding into the sql. Thanks!
Thanks for responding.
I fashioned this up, but I'm throwing an error:
SELECT S.Category
FROM Syndicated S
UNION '<HI>'
ORDER BY S.Category
Thoughts on getting this to work in tsql?
cfwild
My problem is that I'm binding this to the cfselect, the bind doesn't allow the queryposition above|below functionality to work. So I'm forced to a). temp table (which is working fine) or b). investigate adding into the sql. Thanks!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Valorous Hero
,
/t5/coldfusion-discussions/sql-add-blank-row-to-result/m-p/772122#M71809
Mar 17, 2009
Mar 17, 2009
Copy link to clipboard
Copied
You have to use SELECT with the string literal
SELECT Category
FROM Syndicated
UNION
SELECT '<HI>'
ORDER BY Category
SELECT Category
FROM Syndicated
UNION
SELECT '<HI>'
ORDER BY Category
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/coldfusion-discussions/sql-add-blank-row-to-result/m-p/772123#M71810
Mar 18, 2009
Mar 18, 2009
Copy link to clipboard
Copied
Hi,
Thanks for the insight. It worked perfectly! For anyone looking for just a blank row insert "above" the query results, here was the final code:
SELECT Category
FROM Syndicated
UNION
SELECT ''
ORDER BY Category
Again, thanks for the help!
Thanks for the insight. It worked perfectly! For anyone looking for just a blank row insert "above" the query results, here was the final code:
SELECT Category
FROM Syndicated
UNION
SELECT ''
ORDER BY Category
Again, thanks for the help!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

