Share via

Connection application to DB

2022-10-13T03:54:53.947+00:00

can we configuration in 3 hours just one user connection to DB

Azure SQL Database
SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories


3 answers

Sort by: Most helpful
  1. Shivam Kumar 541 Reputation points
    2022-10-13T23:01:50.697+00:00

    Hi @Candra Gustaman (PT Indo Human Resource)

    Alright here is my guess and if you are asking how to keep user connection alive for 3 or more hours even if user logs out of windows session for example to take a backup which runs for 4 or 5 or more hours, you can create a sql agent job and add the code/query to take backup in a step and run this job which will keep running until the task gets completed.

    Regards,
    Shivam

    Was this answer helpful?

    0 comments No comments

  2. Erland Sommarskog 134.7K Reputation points MVP Volunteer Moderator
    2022-10-13T21:36:35.027+00:00

    And if you are asking how to terminate a connection that has been active for three hours, you could set up an Agent job that runs every five minutes or so, and then kill processes that have been around for a long time.

    However, I don't think this is a very good idea.

    Was this answer helpful?

    0 comments No comments

  3. Olaf Helper 47,621 Reputation points
    2022-10-13T05:07:35.083+00:00

    You post is not very clear.
    If you mean to grant an access for a Windows/SQL login only for 3 hours, then create the login and a SQL Server job, which disables the login after 3 hours.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.