web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics RMS (Archived)

Inserting New Customer on HQ

(0) ShareShare
ReportReport
Posted on by

Mabuhay! Hi again! What would be the best sql query for this one;

I need to insert a new row in the table customer. If I'll use the insert into command with values it will arise an error on no null on ID. So I change my code to select max and +1 on ids but what I've got now is id+1 but I've noticed was the IDs still getting the same value like 1073905737 but different Account Number. Is there any cod ethat I forgot to write?

Code:
insert into  [DBName].[dbo].[Customer]([ID],[AccountNumber]) values((Select max (id)from [Customer]) +1, '000700005951')

Thanks,

Chris

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    depends on your plans for the customer records.  

    At a minimum you need,  ID, HQID, AccountNumber, FirstName, LastName.  

    Then you need GlobalCustomer =1 if this customer will push down to stores,  The default is 0.  

    FirstName and LastName are technically optional, but then you don't know from the HQ Manager which accountnumber is whose account.

  • Community Member Profile Picture
    on at

    Mabuhay Sir Ed,

    Thanks for your reply and for reminding those minumum requirements on adding a row in customer table. With the IDs number do i need to manually add + or is there any code that will lookup for the updated ID and ill just add 1 on it so when i insert new one it will just follow the latest ID?

    Or is there any conflict if Ill just manually add 1 to the ID i see that time even if theres a branch is in connection and they will just auto on what i added?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics RMS (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans