How can i read the registry for the default backup directory for my local [b]SSAS [/b]instance?in a SQL Server, if i'm building dynamic queries, i can read the registry of the instance and get it's default backup directory:now i need to do the same for the SSAS instance on the same machine.i'm building a cursor that backs up my SSAS databases, but i'd like to put them in the "right" folder, instead of hard coding it.[code]/*--Results:E:\SQLBackups\*/DECLARE @BackupDirectory NVARCHAR(MAX)--@BackupDirectory DECLARE @RegResults TABLE([VALUE] VARCHAR(512),[DATA] VARCHAR(1024)); INSERT INTO @RegResults([VALUE],[DATA]) EXECUTE [master].dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer', N'BackupDirectory'; SELECT @BackupDirectory = ISNULL([DATA],'') FROM @RegResults; IF LEFT(REVERSE(@BackupDirectory),1) <> N'\' SELECT @BackupDirectory = @BackupDirectory + N'\';SELECT @BackupDirectory AS BackupDirectory[/code]
↧