I think you are best off uninstalling SQL Server and starting over. If you have databases where you want to keep data, you can copy the .mdf and .ldf files to a safe place. Although the uninstall will not delete any user databases, as I recall. You will loose logins, jobs etc that are in the system databases.
Lost connection with the program due to the transfer of SQL Server from drive C to drive D
I wanted to free up space for drive C and moved the SQL Server folder to drive D, after that the program that works only at the expense of the server stopped connecting to it, after transferring it back to drive C, the connection was not restored. Question - do I need to completely reinstall SQL Server or somehow restore the connection of the program with the server?
SQL Server | Other
-
Erland Sommarskog 121.9K Reputation points MVP Volunteer Moderator
2022-01-20T22:44:34.397+00:00
2 additional answers
Sort by: Most helpful
-
Erland Sommarskog 121.9K Reputation points MVP Volunteer Moderator
2022-01-18T22:47:50.13+00:00 Well, you cannot just move the folder and expect everything to be working. If you want to move the entire installation, you will need to uninstall and reinstall.
But in many cases it is sufficient to move the database - after these are the ones that take up space. You do that with ALTER DATABASE db MODIFY FILE. Then you stop SQL Server, move the files yourself to the new location and then start SQL Server.
It seems now that right now you have a non-working installation of SQL Server. Since we don't know exactly what steps you took, it can be difficult to get things back to normal.
You talk about some "program" what program is that? Can you connect with SQL Server Management Studio? If you look in SQL Server Configuration Manager, is the server running?
-
CathyJi-MSFT 22,396 Reputation points Microsoft External Staff
2022-01-19T01:10:58.897+00:00 Hi @MaxSIN ,
>moved the SQL Server folder to drive D
Which folders? And how did you move them? We can’t give you a better help when we do not have access your environment, so suggest you describing your issue more clearly.
> I wanted to free up space for drive C and moved the SQL Server folder to drive D
As Erland mentioned, we usually move data and log files of SQL server to free drive space. This operation will not affect your SQL server connection.
You can follow below steps to move data or log files user databases;
- Move data and log files of database to new location. ALTER DATABASE database_name MODIFY FILE ( NAME = logical_name, FILENAME = 'new_path\os_file_name' );
- Set database offline; ALTER DATABASE database_name SET OFFLINE;
- Move the file or files to the new location.
- Set database online;
- Verify new files location of database;
FROM sys.master_files
WHERE database_id = DB_ID(N'<database_name>');
Please refer to MS document Move Database Files or the blog SQL Server Move Database Files Step By Step to get more information.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".