question

sgonza2975 avatar image
sgonza2975 asked

Adding File to Filegroup

Need some assistance, I'm kind off new in the SQL world and I'm having an issues with adding a file. The following is the code I'm using. I'm getting *msg 5009, level 16 stating one or more files listed could not be found or initialized, furthermore, I get this other msg 5123, lvl 16 stating create file encountered operating system error 5(access denied)* Alter Database Adventureworks2008 Add File (Name = N's AdventureworksFT', FileName = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\AdventureWorks2008 FT.ndf') To Filegroup AWFullTextFG Go
files
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sqlaj 1 avatar image
sqlaj 1 answered
Is there a file group "AWFullTextFG"? It appears in your example there are spaces in the "path".
3 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thats it, just tried it and it matches the above error message. The error message isn't that friendly..
0 Likes 0 ·
Did you check for a space in the "path"? Can you navigate to the folder and create a file simple text file? What account is SQL Server running under? Does that account have permissions? Try a different location. Create a C:\testTemp folder and then try and create the file in that location?
0 Likes 0 ·
I think you misunderstood me, I got it working. But the error that sgonza is experiencing is that he hasn't created the filegroup or it is misspelled.
0 Likes 0 ·
raadee avatar image
raadee answered
Something with the path. I tried the statement it and just changed path to fit my laptop, and that works. So have a look at the path or security for the \Data folder. If you copy the whole path C:\program files\.. (ctrl-c) and paste it in explorer, does that work?
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I copied the entire path from C: and I ran it and it worked. Thank you for the advice.
0 Likes 0 ·
skpani avatar image
skpani answered
This error occurs when you try to use a file in a statement, however this file couldn’t not be found or initialized.Make sure you have created that File group.If file group exists then there might be some problem with path...that worked for me...
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.