Showing posts with label learn. Show all posts
Showing posts with label learn. Show all posts

Friday, March 23, 2012

Problems Creating Database on SQL Srvr. 2005 Ent. Edtn.

Posted - 12/17/2006 : 07:23:22


Hi,

I have just started to learn SQL Server 2005, and am currently using the MCTS SQL Server 2005 Self-Paced Training Kit. I am literally at the very start, and already seem to have hit a snag and can't figure it out. From browsing here in the past I recall people here seemed quite clued up, and I was hoping someone might be able to assist.

I am using SQL Server 2005 Ent. Edtn. (trial) on Win XP Pro (SP2). I am basically trying to run a sample script copied from book to create a database and primary, secondary and log files. Whilst I have the theory down, and thought I understood the SQL (have used other DBMSs in the past, MySQL/ACCESS etc.) I am getting an error when trying to run the following code when connected to the default instance on my PC. The code I am trying to run is:

create database Sales

ON

primary

(name = SalesPrimary,

filename = E:Sales_Data\SalesPrimary.mdf,

size = 50mb,

MAXSIZE = 200,

filegrowth = 20),

Filegroup SalesFG

( name = SalesData1,

filename = F:\Sales_Data\SalesData1.ndf,

size = 200mb,

maxsize = 800,

filegrowth = 100),

( name = SalesData2,

Filename = F:\Sales_Data\SalesData2.ndf,

Size = 400mb,

Maxsize = 1200,

Filegrowth = 300),

Filegroup SalesHistoryFG

( name = SalesHistory1,

filename = F:\Sales_Data\SalesHistory1.ndf,

size = 100mb,

maxsize = 500,

filegrowth = 50)

LOG ON

(name = Archlog1,

Filename = G:\Sales_Data\SalesLog.ldf,

size = 300mb,

maxsize = 800,

filegrowth = 100)

I find I get the following error message:

Msg 102, Level 15, State 1, Line 5
Incorrect syntax near 'E'.
Msg 132, Level 15, State 1, Line 16
The label 'F' has already been declared. Label names must be unique within a query batch or stored procedure.
Msg 132, Level 15, State 1, Line 22
The label 'F' has already been declared. Label names must be unique within a query batch or stored procedure.

Anyone have any ideas? Your help is greatly appreciated!

Thanks,

Will

Someone found the problem with the above SQL query, and it was line 5 missing the \ after E: E:\Sales_Data\SalesPrimary.mdf

I have corrected that, however, now getting the message:

Msg 5133, Level 16, State 1, Line 1

Directory lookup for the file "E:\Sales_Data\SalesPrimary.mdf" failed with the operating system error 3(error not found).

Msg 1802, Level 16, State 1, Line 1

CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

Anyone have any ideas?

|||

Hi,

that will work if and only if you have drives E , F and G

and you have created the folder (subdirectory) in each drive needed by the create

database command

for more information visit books online search for "create database"

that's a nice book anyway.

create database Sales

ON

primary

(name = SalesPrimary,

filename = E:\Sales_Data\SalesPrimary.mdf, < this is the physical location of the data

thats drive E: on forlder sales_data - SalesPrimary.mdf, is the physicla filename

you can change that to

C:\mydata1\salesprimary.mdf if you dont have drive E: make sure that "mydata1" folder exist in the drive. use explorer to create it or dos command c:\md mydata1

size = 50mb,

MAXSIZE = 200,

filegrowth = 20),

to simulate the exercise use

c:\mydata1; c:\mydata2; c:\mydata3... and c:\mylogs just make sure the folder exisit in drive c:

thanks,

joey

|||

Hi Joey,

Thanks for your response. I did have those drives available (e,f,g) and the subfolders required. However, I created them as shared folders mapped to respective volumes. I think the problem there is the way the SQL Server permissions. I tried as you suggested, with just the C: drive and it worked no problem. I don't know why SQL can't find the volumes though... will have to investigate that further.

Thanks,

Will

|||

hi,

It should be physical drives or a SAN. you can't create those things on

shared folders or mapped network drives

please see these links:

http://msdn2.microsoft.com/en-us/library/ms176061.aspx

http://msdn2.microsoft.com/en-us/library/ms190257.aspx

regards,

joey

|||

Hi,

you *could* create them on network drives, but this is not recommended, see this thread for more details:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1029560&SiteID=1&mode=1

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

now i know. trace flag 1807. still not it is not recommended

thanks jens

Friday, March 9, 2012

PROBLEM: Grouping tasks: Connections disappear ?

Guys,

anyone seen this before?

I've just finished me lovely big package.. decided to tidy it up and make it look nice...
(when will I ever learn?)

So I selected a few tasks, right clicked and selected "group". Named the group.....

And now all the connectors between the tasks in the group have disappeared.... tried ungrouping.. still not there...

The package still runs fine... the tasks are executed in the right sequence and all that... but the connectors are jut not visible...

If I try to recreate the connector I get an error dialog saying "Cannot create connector. Only one workflow can exist between the same two executeables.". So they must still exist...

It'd be ok to leave it as it is I suppose.. if I didn't now need to modify the precedence constraint on one of the connectors.... and I can't actually select the feckin connector..

Any suggestions? Any way to refresh the display? Have already exited the environment and come back in.. will try rebooting machine now anyway...

PJ

I've seen problems like this before. Sometimes moving the tasks about makes them reappear. If not, you might be stuck.

In my opinion its a bug.

-Jamie

|||

They're back!

Phew..

I started copying and pasting new versions of the tasks... thinking I could delete the old ones and reconnect the new ones...

And after the first copy and paste... the connections reappeared...magic!

Suppose its good to have a note about this somewhere in the forums for anyone else that comes on this problem...

Now I'm off to get this thing into Sourcesafe (which I should have done from the start)

Thanks Jamie,

PJ