Updating Departments and Categories

How can I batch update Departments and Categories?

I've got a couple thousand records I want to update, and don't want to do it one by one :-)

thanks

Gary

Reply to
Gary
Loading thread data ...

I have some items at this time have no department and no category. I'd like to be able to assign them all to a single department.

Reply to
Gary

Lx?M1RÃ@ E{?â?ÎôI? ã?-{5ñJ°+ÇcNìC·ûwõßÓ)?ª-X9V???´mñ?¸0*s®p?Ñ«[Y±È?ì?éö¥ééÈ LR6@|??e?2zþ?¸ #çq+?!Ró K?ËÄMsø?Í_^©¬÷?bÎÏMs?Óa?û?n!g?áîIÂT"ÚÃ6xT

Reply to
Derek

Not sure what you mean by a batch update? What do you need to change?

Reply to
Jason Hunt

Ok, you'll need to run some SQL queries. To run a query, go to Administrator, then Connect to the database (under the File menu), then go to the Query menu and select New. Type the query under the SQL tab, and press F5 to execute it. Then go back to the SQL tab and replace it with the next query, then F5 again.

As always, make sure you do a backup before performing any of these queries, just incase something goes wrong.

First, what is the department you want to assign these items to? (I'm assuming all items without a department will be assigned to a single department) You will need to find the database ID for this department. "SELECT [ID],Name FROM Department" will give you a list of departments and their ID's. Now you have your Department ID.

Next, if you want to assign a category as well, you will need to find the Category ID. "SELECT [ID],Name FROM Category WHERE DepartmentID=#", replacing # with the Department ID you just got. Now you can find the Category ID.

Now to update the Items. For example lets assume the Department ID is 3 and the Category ID is 8, the query would be "UPDATE Item SET DepartmentID=3, CategoryID=8 WHERE DepartmentID=0".

Hope this helps.

Reply to
Jason Hunt

Reply to
Gary

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.