I have created a windows service & my service is dependent on the SQL server service. First, SQL started and then my service started when starting PC or restarting PC.>
Go to security tab under your database.
Under security, Click to expand the Users tab.
Find weather NT AUTHORITY\SYSTEM is present.
If not, Right click on users, Click on new user
In new user window, general tab change the user type to windows user.
Select the User name to, NT AUTHORITY\SYSTEM you will have to find it in the Advanced tab, find now, and select system.
Similarly for login name, browse and find NT AUTHORITY\SYSTEM.
And in the membership tab to the left, select all the required boxes and click ok.
Probably this would fix your issue. Hope this helps.