Jenna Fischer revealed during an episode of the Office Ladies podcast that the original script had her vomiting on the bar, when she's drunk and sitting next to Jim. The Chili's personnel who were overseeing the production (as the episode took place at a Chili's location, albeit fictional) were concerned as to what repercussions that might have on their brand and filming shut down as Greg Daniels and Mindy Kaling scrambled to find an alternative to that scene - which ended up being Pam falling off the stool, and subsequently being banned from Chili's due to her disorderly behavior. The manager also explicitly clarified that Pam had been sneaking drinks and was not over served by the staff.
Greg Daniels has said that The 40-Year-Old Virgin (2005) was a huge part of the process where the show went from being promising but very erratic in Season 1 to a huge hit that would win the Best Comedy Series Emmy in 2006 and run for seven seasons after that. The reason for this is that Steve Carell's performance in Judd Apatow's film gave them a guide for how to make Carell's Michael Scott into a more nuanced and likable character (even as Michael was not intended to be, and wasn't, as nice or good a person as Carell's Andy character from the film). One of the major problems with Season 1 was that Michael Scott was often mean or menacing, and keying into Carell's other work helped re-calibrate Michael Scott into more of a well-meaning person who was still often ridiculous and/or incompetent.
Chili's public relations department was unhappy that Pam was shown getting drunk at their restaurant and wanted the producers to remove the Chili's name from the episode. To assuage them, the writers added a line from a Chili's employee, saying that Pam had violated their rules by taking drinks off other tables and was now banned from the franchise.
Greg Daniels previously considered using the plot from this episode for the pilot, but decided it was a "very risky thing to do", so he made the pilot a direct adaption of the first episode of the British version.
According to B.J. Novak, all of the Chili's servers were played by real-life employees of Chili's. One of them had a crush on John Krasinski, which made him uncomfortable. Steve Carrell and hair stylist Kim M. Ferry played a prank on Krasinski, in which they gave him a note asking for a date and pretended that it was from the server.