Viewing 5 posts - 16 through 20 (of 20 total)
USE dba
GO
CREATE TABLE u_apppreferences (
NAME VARCHAR(500)
,val VARCHAR(500)
);
DECLARE @name AS VARCHAR(500),@VAL AS VARCHAR(500);
SET @name = 'Manual';
SET @val = '-53';
IF NOT EXISTS (
SELECT 1
FROM u_apppreferences
WHERE NAME = @name
AND val =...
July 6, 2016 at 11:58 am
Are you using Try-Catch for handling the errors?
Remember the 'TRY' will immediately jump to the CATCH when there is an error.
Then, when you're in the CATCH, and if...
July 5, 2016 at 1:29 pm
I did combine your both queries using CTE. Yes, union will also work, but CTE is much faster and efficient.
June 27, 2016 at 11:00 am
;with PurchaseCTE as (
select
tblP.Product_Code,
tblC.DescriptionLanguage_1,
sum(tblPIID.QtyReceived1
+ tblPIID.QtyReceived2
+ tblPIID.QtyReceived3
+ tblPIID.QtyReceived4
+ tblPIID.QtyReceived5
+ tblPIID.QtyReceived6
+ tblPIID.QtyReceived7
+ tblPIID.QtyReceived8
+ tblPIID.QtyReceived9
+ tblPIID.QtyReceived10
+ tblPIID.QtyReceived11
+ tblPIID.QtyReceived12
+ tblPIID.QtyReceived13
+ tblPIID.QtyReceived14
+ tblPIID.QtyReceived15
+ tblPIID.QtyReceived16
+ tblPIID.QtyReceived17
+...
June 27, 2016 at 10:08 am
with MSCTE as (
select
tblP.Product_Code,
tblC.DescriptionLanguage_1,
sum(tblPIID.QtyReceived1
+ tblPIID.QtyReceived2
+ tblPIID.QtyReceived3
+ tblPIID.QtyReceived4
+ tblPIID.QtyReceived5
+ tblPIID.QtyReceived6
+ tblPIID.QtyReceived7
+ tblPIID.QtyReceived8
+ tblPIID.QtyReceived9
+ tblPIID.QtyReceived10
+ tblPIID.QtyReceived11
+ tblPIID.QtyReceived12
+ tblPIID.QtyReceived13
+ tblPIID.QtyReceived14
+ tblPIID.QtyReceived15
+ tblPIID.QtyReceived16
+ tblPIID.QtyReceived17
+...
June 27, 2016 at 8:14 am
Viewing 5 posts - 16 through 20 (of 20 total)