Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Create database

Author  Topic 

Hinduson
Yak Posting Veteran

69 Posts

Posted - 2014-11-26 : 09:25:03
Please am new to SQL SERVER and am trying to create a database for practise and i keep getting error.

THIS IS MY SYNTAX BELOW AND THE ERROR MESSSAGE I GET.

Create Database EMPLOYEE
ON
( NAME = employee_dat,
FILENAME = 'C:\Program files\Microsoft sql
server\MSSQL10.HINDU\MSSQL\Data\Employee_data.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5)
LOG ON
(NAME = Employee_log,
Filename = 'C:\Program files\Microsoft sql
server\MSSQL10.HINDU\MSSQL\Data\Employee_log.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB)
GO


Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "C:\Program files\Microsoft sql
server\MSSQL10.HINDU\MSSQL\Data\Employee_data.mdf" failed with the operating system error 123(The filename, directory name, or volume label syntax is incorrect.).
Msg 1802, Level 16, State 1, Line 1
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

Best Regards.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-11-26 : 12:26:42
You have a hard return in your path. When I copied/pasted it, it shows up just like this:

C:\Program files\Microsoft sql
server\MSSQL10.HINDU\MSSQL\Data

Note that I did not hit return after "sql". Remove the hard return: C:\Program files\Microsoft sql server\MSSQL10.HINDU\MSSQL\Data

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Hinduson
Yak Posting Veteran

69 Posts

Posted - 2014-11-26 : 16:15:57
Thanks Tkizer, But am confused what you mean by HARD RETURN. Can you please explain and an example of how you think i should go about this. Please

Am very greatful

Best Regards.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-11-26 : 16:20:43
I showed in my post what I think the issue is, but here you go. Don't edit it.

Create Database EMPLOYEE
ON
( NAME = employee_dat,
FILENAME = 'C:\Program files\Microsoft sql server\MSSQL10.HINDU\MSSQL\Data\Employee_data.mdf',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5)
LOG ON
(NAME = Employee_log,
Filename = 'C:\Program files\Microsoft sql server\MSSQL10.HINDU\MSSQL\Data\Employee_log.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB)
GO

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-11-26 : 16:21:12
Yours:
C:\Program files\Microsoft sql
server\MSSQL10.HINDU\MSSQL\Data

Mine:
C:\Program files\Microsoft sql server\MSSQL10.HINDU\MSSQL\Data

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-11-26 : 16:21:49
If that doesn't work, then you'll need to verify the path: C:\Program files\Microsoft sql server\MSSQL10.HINDU\MSSQL\Data

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Hinduson
Yak Posting Veteran

69 Posts

Posted - 2014-11-26 : 16:24:31
Oh my God. It worked like Magic. I wish you are my teacher. But can you tell me where i went wrong and why i kept having the errors?

I really appreciate

Best Regards.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-11-26 : 16:25:38
Because the path can't have a line feed or carriage return in it, what I called a hard return, basically hitting "ENTER" on the keyboard. You hit enter in the middle of the path, likely so it wasn't off the screen. You can't do that.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Hinduson
Yak Posting Veteran

69 Posts

Posted - 2014-11-26 : 16:26:46
Ook Thank you very much Brother, May God bless you.

Best Regards.
Go to Top of Page

Hinduson
Yak Posting Veteran

69 Posts

Posted - 2014-11-26 : 16:29:16
Am sorry i just checked. You are a sister. Lol. Thanks alot Sis.

Best Regards.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-11-26 : 16:39:00


Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -