SQL Server 2008 has filtered indexes that allow this but they are not available in 2005. In SQL Server 2005 you can create an indexed view with definition
CREATE VIEW dbo.Foo
WITH SCHEMABINDING
AS
SELECT bar
FROM dbo.baz
WHERE bar IS NOT NULL
Then create a unique clustered index on that.
CREATE UNIQUE CLUSTERED INDEX ix ON dbo.Foo(bar)