There was necessary to find out where is located primary file for current database and then to get just directory where the file was located.
DECLARE @PATH nvarchar(max) SELECT @PATH = LEFT(filename, LEN(filename) + 1 - CHARINDEX('\', REVERSE(filename))) FROM master.dbo.sysaltfiles WHERE db_name(dbid) = db_name() AND name = 'PrimaryFileName'
No comments:
Post a Comment