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 |
|
sg2255551
Constraint Violating Yak Guru
274 Posts |
Posted - 2009-02-28 : 04:58:52
|
| hiCast(COALESCE(s.ProdID,null) as nvarchar(100)The ProdID is a GUID datatype and how do i replace a 0 instead of null? I need to return as int. Thanks |
|
|
trellend
Starting Member
9 Posts |
Posted - 2009-02-28 : 05:42:28
|
| IsNUll(s.ProdId, 0) |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-02-28 : 06:06:37
|
A GUID cannot display a single 0 due to it's nature.DECLARE @Sample TABLE ( ProdID UNIQUEIDENTIFIER )INSERT @SampleSELECT NEWID() UNION ALLSELECT NULLSELECT ProdID, COALESCE(CAST(ProdID AS VARCHAR(36)), '0') AS PesoFROM @Sample E 12°55'05.63"N 56°04'39.26" |
 |
|
|
sg2255551
Constraint Violating Yak Guru
274 Posts |
Posted - 2009-02-28 : 09:35:20
|
| Thanks |
 |
|
|
|
|
|