Tag: location

How to find/modify SQLServer Agent logfile location?

To get the location of SQLServer Agent log file, the log file is called SQLAGENT.out DECLARE @oem_errorlog nvarchar(255) EXECUTE master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\SQLServerAgent', N'ErrorLogFile', @oem_errorlog OUTPUT, N'no_output' PRINT @oem_errorlog Sample Output: C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLAGENT.OUT To modify location and name of SQLServer Agent logfile USE [msdb] GO EXEC msdb.dbo.sp_set_sqlagent_properties @errorlog_file=N'C:\temp\SQLAGENT.OUT' GO To recycle SQLServer Agent … Continue reading How to find/modify SQLServer Agent logfile location?

How to move tempdb database files and user databases to new location?

Using the steps below one can change the location of the datafiles in SQLServer for user databases and tempdb. 1) First find the current location of the filename and name: select name, filename from sys.sysfiles name filename ------------------ ----------------------------------- tempdev C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\tempdb.mdf templog C:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\templog.ldf 2) Run the ALTER … Continue reading How to move tempdb database files and user databases to new location?