<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def if_sqlserver_disable_constraints(session: SqlASession, tablename: str) -> None: """ If we're running under SQL Server, disable constraint checking for the specified table while the resource is held. Args: session: SQLAlchemy :class:`Session` tablename: table name See https://stackoverflow.com/questions/123558/sql-server-2005-t-sql-to-temporarily-disable-a-trigger """
  # noqa
    engine = get_engine_from_session(session)
    if is_sqlserver(engine):
        quoted_tablename = quote_identifier(tablename, engine)
        session.execute(
            "ALTER TABLE {} NOCHECK CONSTRAINT all".format(
                quoted_tablename))
        yield
        session.execute(
            "ALTER TABLE {} WITH CHECK CHECK CONSTRAINT all".format(
                quoted_tablename))
    else:
        yield