Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
amitranjan
Starting Member
45 Posts |
Posted - 2011-03-14 : 06:33:59
|
| hi,I just want to know , if its possble to return empty row, in case if the query is returning no row. I need if there is no row in the output, then the output result will get changed to table with one row, having all columns blank.amit Ranjan |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-03-14 : 07:45:05
|
| I guess you could do somethign like thisIF NOT EXISTS(Select * from yourTable)SELECT null,null,null,...JimEveryday I learn something that somebody else already knew |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2011-03-14 : 07:53:35
|
| Alternatively:SELECT Col1, Col2 FROM table WHERE ...UNION ALLSELECT NULL, NULLBut this will return the NULL row regardless of the other query so ti will have to be filtered out in the front end.- LumbagoMy blog-> http://thefirstsql.com/2011/02/07/regular-expressions-advanced-string-matching-and-new-split-function-sql-server-2008-r2/ |
 |
|
|
|
|
|