Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

append record from the same table , change customer field based on parameter Expand / Collapse
Author
Message
Posted Monday, August 11, 2014 3:02 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, September 3, 2014 12:50 PM
Points: 7, Visits: 30
test
Post #1602078
Posted Monday, August 11, 2014 3:11 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 11:36 AM
Points: 21,741, Visits: 15,432
Can you provide sample data and table structures so we can actually provide a working query for you?



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1602080
Posted Monday, August 11, 2014 3:28 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, September 3, 2014 12:50 PM
Points: 7, Visits: 30
table design arcustomer

[Customer] [char](7) NOT NULL,
[Name] [char](30) NULL,
[ExemptFinChg] [char](1) NULL,
[Salesperson] [char](3) NULL,
[CustomerClass] [char](2) NULL,
[Salesperson,] [char](2) NULL,
[TermsCode] [char](2) NULL,
[Area] [char](2) NULL,
[Branch] [char](2) NULL

two parameters would be provided sx_customer_code and parent_customer_code

data sample

Customer Name ExemptFinChg Salesperson CustomerClass Branch Area TermsCode
AB11153 anna mira N A02 T3 AB AL G
AB10154 alex johnson N CXM T3 AB AL G
AB11155 South Mall Y A02 T3 AB AL P
Post #1602091
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse