Hi, I have deleted my database by accidentially in sql server 2017 is there is any way to recover it? Thanks.
...Good day!
Need help to SUM and JOIN 2 columns with different tables but do no want to SUM qty and duplicates row result
here's the sample data tables;
Transfer Shipment table;
TransTO - TransFROM - ItemNo - Desc - Desc2 - VariantCode - Qty
Location1 HO Item01 Active Black Variant01 5 <------ Delivery
Location1 HO Item01 Active Black Variant01 5 <------ Delivery
HO Location1 Item01 Active Black Variant01 2 <------ Pull-out
HO Location1 Item01 Active Black Variant01 1 <------ Pull-out
Sales Entry table;
Loc Code - Item No - Variant Code - Qty
Location1 Item01 Variant01 -1 <------ PSales
Location1 Item01 Variant01 -1 <------ PSales
Item Entry table;
Loc Code - Item No - Desc - Desc2- VariantCode- Qty - EntryType - DocNo
Location1 Item01 Active Black Variant01 4 2 ItemAdj0001 <------ PAdj
Location1 Item01 Active Black Variant01 1 2 StrAdj0001 <------ PAdj
Location1 Item01 Active Black Variant01 -1 1 MSales0001 <------ MSales
Location1 Item01 Active Black Variant01 -1 1 MSales0002 <------ MSales
Location1 Item01 Active Black Variant01 -1 3 LocAdj0005 <------ NAdj
Location1 Item01 Active Black Variant01 -1 3 BtqAdj0008 <------ NAdj
SUM and JOIN (the sql query result should be like this)
Loc Code - Item No - Desc - Desc2 -VarCode- Delivery -PAdj- Pull-out - PSales - MSales - NAdj - Total
Location1 Item01 Active Black Variant01 10 5 3 -2 -2 -2 6
here's my sql query code;
...Scenario : User defined function return one table. If that table contains at least one row,one column in the table variable from another sp should get updated.
Should I use cross join on UDF to update table variable?
sql
...Getting error in SQL server stored procedure when executing it:
...