A slide rail assembly is configured to be detachably mounted to a first post and a second post by a first bracket and a bracket device. The bracket device includes a second bracket, a hook, and a locking element. The hook is connected to the second bracket. The locking element is operatively engaged with the second bracket for abutting against the hook in order to hold the hook at a close position relative to the second post. When the first bracket is detached from the first post, and the locking element is operatively disengaged from the second bracket, the locking element no longer abuts against the hook.