How to remove trailing spaces from SQL Server logical filename?
- by Luke Girvin
I'm dealing with a server running SQL Server 2000 SP1, and the logical filenames for one of the databases appear to contain trailing spaces. That is, this query:
select replace(name, ' ', 'X')
from sysfiles
Returns the expected names plus a long string of Xs.
How can I deal with this? I've tried running ALTER DATABASE... MODIFY FILE using the name (with and without spaces) and get an error message telling me the file does not exist.