Delete customer using SQL Query

Does anyone know of any SQL statement that will remove a customer from the database? I am very familular with SQL querys, I just want to be sure that using DELETE Customer FROM Customer WHERE AccountNumber = 'xxxxxxxx'

if anyone knows of a proper way to delete a customer using SQL query without causing horrible side effects down the road such as mismatched indexes, etc... Any input or suggestions would be greatly appreciated. Thank You.

Reply to
Andy Miller - Teknor, Inc.
Loading thread data ...

I think that the proper syntax would be: DELETE * from Customer WHERE AccountNumber = 'XXXXXXXXXXXXX'

Before you go and run that query, though... Why use a query? There's a Delete button on the customer find/list window.

Does this customer have any history? If there are transactions associated with the account, I'd advise against deletion.

Is it a duplicate customer? There is a KB article on merging duplicate accounts. It's a series of queries that merge the purchase history, A/R, etc. Once the accoutns are merged, you can delete (query or otherwise) the unused account.

Tom

"Andy Miller - Teknor, > Does anyone know of any SQL statement that will remove a customer from the

Reply to
Terrible Tom

Does anyone know of any SQL statement that will remove a customer from the database? I am very familular with SQL querys, I just want to be sure that using DELETE Customer FROM Customer WHERE AccountNumber = 'xxxxxxxx'

if anyone knows of a proper way to delete a customer using SQL query without causing horrible side effects down the road such as mismatched indexes, etc... Any input or suggestions would be greatly appreciated. Thank You.

Reply to
Jeff

Well Mr. Terrible Tom, (comic name, always liked it.)

Because of that customer merge SQL statements that Microsoft provided, i am also wanting any information of how to delete a customer using SQL. I have created a Visual Basic program that inputs the 2 account numbers that need to be merged, 1 account number is the main account number, the other account number will be the customer that will be deleted from store operations. You input the 2 account numbers, push a button, and the customers are merged. right now i am having to manually delete the unused customer using the delete button in store ops. I would like to include in this visual basic program to just delete the customer for me.

DELETE Customer FROM Customer WHERE AccountNumber = 'xxxxx' does remove the customer. the customer that will be deleted will not have any purchase history, will not have any account history or > I think that the proper syntax would be:

Reply to
Andy Miller - Teknor, Inc.

I'd be interested in a copy of your executable - especially if you have one without the delete customer step. I'm in an HQ environment, so I don't want the stores deleting customers - I'll issue a 601 from HQ after the merged accounts have sync'd with HQ.

How do you tell the VB program which server/DB to connect to?

Tom

"Andy Miller - Teknor, > Well Mr. Terrible Tom, (comic name, always liked it.)

Reply to
Terrible Tom

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.