Nice programing

Management Studio 기본 파일 저장 위치

nicepro 2021. 1. 7. 21:19
반응형

Management Studio 기본 파일 저장 위치


새 쿼리 창을 엽니 다. SQL을 작성하십시오. 스크립트를 저장하면 다른 이름으로 파일 저장 대화 상자가 열리지 만 항상 프로파일 디렉토리의 동일한 기본 위치에 있습니다. 내 기본 파일 위치를 설정하는 방법이 있습니까? ... 1980 년대의 앱을 사용했던 것처럼?

도구 | 옵션에서 쿼리 결과에 대한 기본 위치를 지정할 수 있습니다. 새 쿼리 (텍스트 편집기)에도 동일한 것이 필요합니다. 레지스트리에서 위치 변경을 시도했지만 SSMS가 변경 사항을 덮어 썼습니다. 어떤 제안?

( http://www.eggheadcafe.com/software/aspnet/30098335/management-studio-default.aspx 에서이 답변되지 않은 질문을 보았고 동일한 질문이 있었으므로 여기에 다시 게시했습니다)


나는 이것이 오래된 질문이라는 것을 알고 있지만, 적어도 SQL 2005에서 이것을 올바르게 수행하는 방법을 설명하는 링크를 찾았습니다. 이후 버전에서도 작동 할 것이라고 생각하십시오.

내 프로젝트 폴더 변경

설정은 폴더 .vssettingsXML 파일에 My Documents\SQL Server Management Studio\Settings저장됩니다. 이 파일을 변경하기 전에 SSMS를 닫아야합니다. SSMS는 응용 프로그램을 닫을 때 SSMS에 기록하고 변경 사항을 덮어 씁니다. My Projects폴더 를 변경하려면 다음 줄을 찾고 있습니다.

   <PropertyValue name="ProjectsLocation">%vsspv_user_documents%\My
   Projects</PropertyValue>

내부 값은 My Projects폴더 의 위치입니다 . 값을 변경하기 만하면 다음에 SSMS를 열 때 My Projects폴더가 매핑됩니다.


지금은 5 년이 지났지 만 SSMS 버전에 대해서는 언급하지 않았으므로 SSMS 2012 및 SSMS 2014에 대한 업데이트를 추가 할 것이라고 생각했습니다. 1 단계는 버전마다 다르며 나머지는 동일합니다.

SSMS 2012

  1. C : \ Program Files (x86) \ Microsoft SQL Server \ 110 \ Tools \ Binn \ ManagementStudio \ Extensions \ Application을 찾습니다.

SSMS 2014

  1. C : \ Program Files (x86) \ Microsoft SQL Server \ 120 \ Tools \ Binn \ ManagementStudio \ Extensions \ Application을 찾습니다.

둘 다 (계속)

  1. 텍스트 편집기 (예 : 메모장)로 ssms.application.pkgdef를 엽니 다.
  2. DefaultProjectsLocation 값 변경
  3. "DefaultProjectsLocation"= "$ MyDocuments $ \ SQL Server Management Studio"
  4. 파일 저장

이 출처 덕분에 : http://www.networksteve.com/forum/topic.php/How_to_change_the_default_query_save_location_in_SSMS/?TopicId=41425&Posts=0


확인하기 위해 여기에서 레지스트리 위치를 업데이트 했습니까?

HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\90\Tools\Shell

HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\90\Tools\Shell\General\ProjectLocationEntries

간단한 해결 방법은 원하는 저장 위치에 대한 바로 가기를 만드는 것입니다. SSMS \ Projects 디렉터리에 바로 가기를 배치합니다. 저장할 때 하단의 "모든 파일 ( . )"을 선택한 다음 바로 가기를 두 번 클릭합니다.

이상적이지는 않지만 빠르고 간단한 해결 방법입니다.


해결 방법으로 스크립트를 저장하려는 위치에 SQLServerScripts 유형의 새 프로젝트를 만들 수 있습니다.

그런 다음 솔루션 탐색기에서 쿼리 폴더를 마우스 오른쪽 단추로 클릭하여 지정한 위치에 새 스크립트를 만듭니다.

말이 되나?

SQL Server의 프로젝트 및 솔루션에 대한 자세한 내용은 다음을 참조하십시오.

http://msdn.microsoft.com/en-us/library/ms173803.aspx

건배,


대안은 NTFS 연결 지점을 만드는 것입니다.

Systinternals Suite 사본을 가져 오면 junction.exe가 필요하며 다른 것들은 유용합니다.

명령 줄에서 다음을 실행합니다.

junction.exe "c:\MyStuff" "c:\Documents and Settings\Stephen.Turner\My Documents\SQL Server Management Studio"

퍼팅 귀하의 내 문서 경로.

c : \ MyStuff 디렉토리가 생성되고 찾아 보면 모든 파일이 표시됩니다. 복사본이 아니라 심볼릭 링크이며 두 경로 모두 동일한 파일을 참조합니다.


나는 이것 중 어느 것도 운이 없었습니다. 내 해결책은 .bat 파일을 사용하여 새 empty.sql 파일을 만든 다음 여는 것입니다. 그런 다음 SSMS에서 '외부 도구'를 사용하여 배치를 재결합했습니다. 그것을 클릭하면 새 타임 스탬프가 찍힌 .sql 파일이 열립니다. 나는 각 '프로젝트'에 하나씩 사용합니다.

.bat 파일 만들기

set fName=newQuery%date:~4,2%_%date:~7,2%_%date:~10,4%_%time:~1,1%_%time:~3,2%_%time:~6,2%.sql
copy _queryBlank.sql %fName%

After searching for this topic for last 3hours, i finally got the way to do this: Changing the My Projects folder location (and other settings) in SSMS


the registry changes did not work for me. i just put a shortcut to the network folder I wanted to use in the Mgnt Studio default save path.


This post shows one way.

But, its, registry based, solution still has a gap... When one saves a newly created query (in my SSMS 2008 setup I open it on startup), he has to click "Projects" on the left, as save dialog opens in the standard ...\Documents\SQL Server Management Studio\Projects.


  1. In Object Explorer, right-click on your server and click Properties.

  2. In the left panel on that Properties page, click the Database settings tab.

  3. In Database default locations, view the current default locations for new data files and new log files. To change a default location, enter a new default pathname in the Data or Log field, or click the browse button to find and select a pathname.

NOTE: After changing the default locations, you must stop and start the SQL Server service to complete the change.


A low tech but quick solution is to simply create a shortcut in the default folder to the one where you want to save your scripts/results/etc.... It's one extra click but involves no messing with settings or the registry.


The easiest solution for me was to change the folders in the registry (tested with SQL Server 2014)

Make sure to close SQL Server Management Studio before

  1. Launch regedit.exe
  2. Browse to Computer\HKEY_CURRENT_USER\Software\Microsoft\SQL Server Management Studio\xx.0 (where xx is your version)
  3. Change the different locations path you see in there
  4. Start Management Studio and try to open a file, the default directory will be yours

However, the only problem I still have is with the Save... if I create a new Query and save, it still ends up by default under /Documents/SQL Server Management Studio but if you click on the 'SQL Management Studio' link on the left you will go directly into your directory.


You can create a symbolic link using mklink.

  1. Delete the existing project folder (copy existing files to preferred location first): rmdir "C:\Users\user\Documents\SQL Server Management Studio\SSMS Projects).
  2. Create symlink to your preferred location (example a onedrive folder): mklink /j "C:\Users\user\Documents\SQL Server Management Studio\SSMS Projects" "C:\Users\user\OneDrive - Company\SSMS Projects"

The /j options specifies a hard link that makes it appear as though the file or folder actually exists at that location. When you try to open a file in SSMS the folder should now look like this:

Example Hard Link In SSMS


The installation location for SSMS 18 has changed, along with the location of the configuration file that controls the default file save location. The file that needs to be edited is now located at the following path:

C : \ Program Files (x86) \ Microsoft SQL Server Management Studio 18 \ Common7 \ IDE \ Extensions \ Application \ ssms.Application.pkgdef

  1. 실행중인 SSMS 18 인스턴스를 모두 닫습니다.

  2. 관리자 권한으로 실행되는 텍스트 편집기로 ssms.Application.pkgdef를 엽니 다.

  3. DefaultProjectsLocation의 값을 원하는 기본값으로 변경합니다.

    • "DefaultProjectsLocation"= "C : \ My \ Preferred \ Save \ Location"
  4. 파일을 저장하고 SSMS를 다시 시작하십시오.


내게 도움이 된 것은 DefaultFileOpenLocation의 레지스트리와 값을 편집하는 것이 었습니다.

HKEY_USERS\S-1-5-21-1428394981-1396028598-1721912238-1000\Software\Microsoft\SQL Server Management Studio\18.0_IsoShell

레지스트리 편집기 스크린 샷 :

참조 URL : https://stackoverflow.com/questions/651535/management-studio-default-file-save-location

반응형