Shrink Database Log

I am trying to run the following script to shrink down our log file.  

Use AIRT
GO
backup log AIRT with truncate_only
GO
DBCC SHRINKFILE (GPSAIRTLog, EMPTYFILE)

and I receive the following error.

Could not locate file 'GPSAIRTLog' for database 'AIRT' in sys.database_files. The file either does not exist, or was dropped.

I have ran the following script to check the files

select * from sys.database_files

These are my results.......
1      9BB88248-A693-4BA1-BA06-477541ACF1EE      0      ROWS      1      GPSAIRTDat.mdf      D:\GPdata\GPSAIRTDat.mdf      0      ONLINE      353896      -1      20      0      0      0      1      0      NULL      NULL      NULL      NULL      5439000036835400237      4E169688-AE76-41D2-AD6F-F8C991C19F24      2008-11-13 16:22:43.027      NULL      NULL      NULL      NULL      NULL
2      D43F4590-0428-42A8-8F89-8FB46D8E697C      1      LOG      0      GPSAIRTLog.ldf      D:\GPdata\GPSAIRTLog.ldf      0      ONLINE      6330824      268435456      25      0      0      0      1      0      NULL      NULL      NULL      NULL      NULL      NULL      NULL      NULL      NULL      NULL      NULL      NULL

Im stumped.

LVL 1
Dynamics_GirlAsked:
Who is Participating?
 
Dynamics_GirlConnect With a Mentor Author Commented:
Use AIRT
GO
backup log AIRT with truncate_only
GO
DBCC SHRINKFILE ('GPSAIRTLog.ldf', EMPTYFILE)
0
 
Daniel WilsonCommented:
Your logical name includes the .MDF or .LDF -- which is unusual.  Please try:

DBCC SHRINKFILE (GPSAIRTLog.log, EMPTYFILE)

Open in new window

0
 
Dynamics_GirlAuthor Commented:
No Go
It says

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '.'.
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
Dynamics_GirlAuthor Commented:
I tried this and if gives me the same error

Use AIRT
GO
backup log AIRT with truncate_only
GO
DBCC SHRINKFILE ('GPSAIRTLog.log', EMPTYFILE)
0
 
Daniel WilsonConnect With a Mentor Commented:
what about

DBCC SHRINKFILE ([GPSAIRTLog.log], EMPTYFILE)

Open in new window

0
 
grayeCommented:
Now that  you've successfully shrunk the log file, you might consider reading the following article on how to use periodic log backups to prevent  this from happenign again.....
http://home.hot.rr.com/graye/Articles/SQL_LogMaintenance.htm 
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.