Thursday, January 22, 2009

SQL Server 2008 Error: SetParent Falied for DataFile

When creating a SQL 2008 database through SSMS, I wanted to add a File for the new FileStream type. I kept getting an error dialog box stating:
TITLE: Microsoft SQL Server Management Studio
------------------------------

SetParent failed for DataFile 'test'.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink? 
ProdName=Microsoft+SQL+Server
&ProdVer=10.0.1600.22+((SQL_PreRelease).080709-1414+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.
   FailedOperationExceptionText
&EvtID=SetParent+DataFile&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

Value cannot be null.
Parameter name: newParent (Microsoft.SqlServer.Smo)
The Microsoft help link came up empty and so did a Google search. I had been previously using a SQL script to create the database, but this time I was determined to make it work through the GUI. I found the problem was that I didn't go to the FileGroup tab first and add a FileStream FileGroup.