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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 SP with first blank row

Author  Topic 

eugz
Posting Yak Master

210 Posts

Posted - 2008-01-31 : 16:48:01
Hi All.
I would like to modify my SP that first row will blank when it populate combobox:
create procedure sp_Test
as
SELECT
t.Test_Id
,LName+', 'FName as Name
,1 as used
FROM dbo.v_Employee t
left outer join dbo.Orders o
on t.Test_id = o.Order_Id

Thaks.

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2008-01-31 : 16:59:30
You should use your client code to do presentation stuff like that. You can insert items into a combo box with your vb/c#/ javascript / whatever
If you really wanted to do it with SQL, and it's a hack I nobody is going to recommend it, you could do a UNION
i.e.

SELECT 0 AS Test_id, '' as Name, 1 as Used
UNION
SELECT
t.Test_Id
,LName+', 'FName as Name
,1 as used
FROM dbo.v_Employee t
left outer join dbo.Orders o
on t.Test_id = o.Order_Id


Damian
"A foolish consistency is the hobgoblin of little minds." - Emerson
Go to Top of Page
   

- Advertisement -