Click here to Skip to main content
15,917,859 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to return blank rows from stored procedure in sqlserver.

That means, i always need say 10 records even if the result set has only 5.
Posted
Updated 31-May-12 17:21pm
v2
Comments
db7uk 31-May-12 4:41am    
what have you tried? what is your sql query? Does your table have null values or default values?
Pratika05 31-May-12 5:38am    
SELECT * FROM Table1
But My table has only 5 records but I want to show 10 out of which 5 rows are blank

SQL
SELECT field1, field2, field3, field4 
FROM table 1
UNION ALL
SELECT '', '', '', ''
UNION ALL
SELECT '', '', '', ''
 
Share this answer
 
By design, all SQL statements are optimized to avoid blank result. it is better to handle this scenario in you UI, instead of digging more in to DB procedures.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900