isnull

Write a SQL Query to replace values and include all the Dates.

Well I have this - Table DimDate- Date Table Employee- Id,Name,Points,Date Now the Employee table has points for everyday unless they did not come...so the Date does not have all the Dates entries... I mean for e.g in a week he did not come for 2 days the Employee table has only 5 rows...so I have this dimdate table which has all t...

!is_null() not working as expected

dispatch_address_postcode isn't mandatory and it will still run even if it's blank: if (!is_null($_POST['personal_info_first_name']) && !is_null($_POST['personal_info_surname']) && !is_null($_POST['personal_info_email']) && !is_null($_POST['personal_info_telephone']) && !is_null($_POST['dispatch_address_country'...

ISNULL equivalent for empty fields

Is there something like ISNULL() OR COALESCE() but not that checks for null value but for an empty value. for example: SELECT cu.last_name, cu.first_name, cu.email, hu.email FROM (SELECT DISTINCT c.first_name, c.last_name, c.email, c.household_id, h.head_of_household_id FROM rd_customers c JOIN rd_households h ON c.household_i...

SQL Server 2008 Optimize FULL JOIN with ISNULL statements

HI All I was hoping someone could help me improve a query I have to run periodically. At the moment it takes more than 40 minutes to execute. It uses the full allocated memory during this time, but CPU usage mostly meanders at 2% - 5%, every now and then jumping to 40% for a few seconds. I have this table (simplified example): CRE...

Select statement with in ISNULL

I am writing a stored procedure and within this procedure I am using isNULL. If the value is null I want to use a select statement as the replacement value is this even possible? IF ISNULL(@v_FilePrefix, (SELECT @v_FilePrefix = TransactionTypePrefix FROM [ConfigTransactionType] WH...

Stored procedure call with an ISNULL in the assignment. Invalid Syntax?

Above the call to this stored procedure is another call to a different stored procedure. The first procedure will assign something to @NewIdentifier if it needs to, otherwise I need to use the default SaleId. exec myStoredProc @SaleId = ISNULL(@NewIdentifier, @SaleId) It works if I do it this way declare @Id int set @Id = ISNULL(@New...