Incorrect syntax near drive letter when wanting to move tempdb database
I have these commands in the query window - Use master GO Alter database tempdb modify file (name=tempdev,filename=’g:\tempdb.mdf’) GO Alter database tempdb modify file (name=templog,filename=’f:\templog.ldf’) However, there are red syntax error underscores beneath the g: and the f: The filenames look ok to me (but I'm a SQL novice) when compared with the output from the below - Use Master Go exec sp_helpfile name fileid filename filegroup size maxsize growth usage tempdev 1 C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\tempdb.mdf PRIMARY 8192 KB Unlimited 10% data only templog 2 C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\templog.ldf NULL 768 KB Unlimited 10% log only Please would someone be able to suggest why this may be ? Thanks
April 20th, 2011 2:40pm

Hello, I have needed my magnifying glass to see it; you didn't used a apostrophe ' , you used a single quotation mark ´ instead. ,filename=’g:\tempdb.mdf’) => ' Olaf Helper * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich tglich Blog Xing
Free Windows Admin Tool Kit Click here and download it now
April 21st, 2011 3:07am

Olaf, please accept a big thanks for spotting that. I pasted the new character into the query and it looks good. I can't run it until next week though as I need to submit a new change request. As it happens, not only did I paste the command in from a colleague's e-mail (I'm not a DBA), I also pasted in several examples from web articles which were also wrong, using the same wrong character.
April 21st, 2011 3:57am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics