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 |
AdamWest
Constraint Violating Yak Guru
360 Posts |
Posted - 2010-05-26 : 09:21:58
|
HI I have a Silverlight app, now the data gets there via a standard stored proc and web data service.One of the fields in the data is NULL and thus Silverlight is crashing on that customer.My question is, can I in the SQL, change the status of this field, say I make it all zeros or something like that?Thank you,Adam |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-05-26 : 09:28:33
|
selectisnull(your_col,'00000') as your_colfrom table No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
AdamWest
Constraint Violating Yak Guru
360 Posts |
Posted - 2010-05-26 : 09:35:30
|
OK so in the current sp, I put your select as a second select?USE [care]GO/****** Object: StoredProcedure [dbo].[SpendAnalyzer] Script Date: 05/26/2010 09:34:02 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER PROCEDURE [dbo].[Spendwatch] @customername varchar(50) = NULL AS BEGIN SET NOCOUNT ON; SELECT Department, Price As Expense, Quantity, Customer as CUSTNAME, item_name as Description, Date_Created AS DateCreated, Category, Category as USCATVAL, Budget, po as InvoiceNum FROM dbo.V_Dashboard_expenses WHERE Date_Created >= DATEADD (YYYY, - 2, GETDATE()) AND Date_Created <= GETDATE() AND LTrim(RTrim(Customer)) = @customername ORDER BY date_Created DESC END |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-05-26 : 09:41:21
|
No.For example if the problem is with the column po in your query thenuse isnull(po,'00000') as InvoiceNuminstead ofpo as InvoiceNum No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
AdamWest
Constraint Violating Yak Guru
360 Posts |
Posted - 2010-05-26 : 09:48:40
|
Thank you very much Web Fred!quote: Originally posted by webfred No.For example if the problem is with the column po in your query thenuse isnull(po,'00000') as InvoiceNuminstead ofpo as InvoiceNum No, you're never too old to Yak'n'Roll if you're too young to die.
|
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-05-26 : 09:58:27
|
welcome No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
|
|
|
|
|