Showing posts with label management. Show all posts
Showing posts with label management. Show all posts

Friday, March 30, 2012

Problems with Timeout expired

Hi

I have a SQL Server database which has a number of tables and views. Using SQL Server Management Studio Express I can open most of the views without a problem. However, some of the views cause an SQL Connection Error but not every time I open them.

Error Source: Net SqlClient Data Provider

Error Message: Timeout expired. The timeout period expired ....

I have looked at the help given for this error but have come to the conclusion that none of the suggested causes are relevant as most views open without a problem. It would appear that I need to increase the timeout value but I can't find where I do that.

It must be simple..

I have just checked that the Execution Time-out in the SSMSE options is set to 0.

Monday, March 26, 2012

Problems with SQL 2005 IDE and Column Names

Hello all.

I'm having problems with SQL 2005 Management Studio not liking some of my column names, even though I believe they are valid when run directly through a SQL query window. An example...

CREATE TABLE [Test](
[ID] [int] NOT NULL,
[The.Name] [nvarchar](50) NULL )

INSERT INTO [Test] ( [ID], [The.Name]) VALUES (1, 'Test')

DELETE FROM [Test] WHERE [ID] = 1

This SQL will execute in the Query window without issue. To see the problem in action...

    Execute the SQL to CREATE the table and INSERT the row Use the Management Studio IDE to Right-Click on the Test table and "Open Table" Highlight the row in the new results window Try to delete the row See the error message: The multi-part identifier "The.Name" could not be bound

It's confusing me because, as far as I am able to determine, the column name is valid SQL and was even created in the IDE. Ultimately I can work around this by either working directly in SQL or simply renaming the column, but both options would be an impact on our project schedule. If anyone could provide some insight it would be greatly appreciated.

Much thanks.

Unfortunately it looks like you have uncovered a bug in Management Studio. I have filed it against the product team.|||

This bug is under consideration for being fixed in sql server 2005 SP2. You can track the bug at

http://lab.msdn.microsoft.com/ProductFeedback/viewFeedback.aspx?feedbackid=05843594-1bcf-4b5b-a51e-cfae51b27007

Problems with Scheduled Emailing on Datasources

I'm trying to set up my report server to send reports by email to my
management team in the company but I'm unable to do so. It seems like the
report server is able to send hyperlinks but not any other format. The error
I receive is strangely these,
"Cannot create a connection to data source 'Datawarehouse'"
"Database 'Datawarehouse' does not exist"
This "Datawarehouse" is a Analysis Service datasource. Below is my
connection string
Connection Type = OLE DB
Connection String
Provider=MSOLAP;Client Cache Size=25;Auto Synch Period=10000;Data
Source=AP5184;Initial Catalog=Datawarehouse
I have no problems accessing the reports from the web browser but why is RS
reporting that the datasource cannot be found? Anyone got any idea?
Any advice is appreciated.has anyone got any advice to this problem?
"Nestor" <n3570r@.yahoo.com> wrote in message
news:O1b3Q7bVFHA.1452@.TK2MSFTNGP14.phx.gbl...
> I'm trying to set up my report server to send reports by email to my
> management team in the company but I'm unable to do so. It seems like the
> report server is able to send hyperlinks but not any other format. The
> error I receive is strangely these,
> "Cannot create a connection to data source 'Datawarehouse'"
> "Database 'Datawarehouse' does not exist"
> This "Datawarehouse" is a Analysis Service datasource. Below is my
> connection string
> Connection Type = OLE DB
> Connection String
> Provider=MSOLAP;Client Cache Size=25;Auto Synch Period=10000;Data
> Source=AP5184;Initial Catalog=Datawarehouse
> I have no problems accessing the reports from the web browser but why is
> RS reporting that the datasource cannot be found? Anyone got any idea?
> Any advice is appreciated.
>
>

Problems with Rights in MS SQL Server Management Studio Express

Hi all!

I'm a beginner in SQL server admin and have just set up SQL Server 2005 in a Vista environment. So far so good! What I've got a problem with now is to get rights set up properly in the MS SQL Server Management Studio Express sw. If I try to add another database or add a new login and such, the results is all the time insufficent priviledges.

CREATE DATABASE permission denied in database 'master'. (Microsoft SQL Server, Error: 262) for instance.

SQL is SP2, all else is up to date too

Really would appreciate som help on this

Olof

hi Olof,

please verify the the account/SQL Server login you are using has enought permissions to create new databases, specifically "Create any database" permission..
log in as a member of system administrators server role or "sa" login, select the Security->Logins node... select the appropriate login, rx click->Properties.. in the "Securables" tab, press the [add] button, select the "the Server:your instance" radio.. in the "Explicit permissions for instance_name" grid, grant "Create any database" to the required login(s)..

regards

|||

Hi again!

I found the tabs u mentioned, came in where the explicit rights where and set create db on my user. Effectiv rights lists all the rights. Still I can't create a db as I don't have rights in the masterdb it says. If I go back to the explicit rights afterward, nothing is set on my user, even though it went well entering them earlier.....

This seems strange. My account is as system admin and login shows automatically login as SQLEXPRESS. If I use login with user my accound (as normal admin in the system) it says that it's not a trusted account: The user is not associated with a trusted SQL Server connection

I'm really lost here and will be thankful for any more hints.

Thanks in advance

Olof

|||

Hi Olof,

Windows Vista introduced a new security feature called User Account Control. Because of UAC, programs will no longer recognize your membership in Builtin\Administrators and will only see you as a normal user. Normal users do not have permission to create databases in SQL Server. You can use the provisioning tool described in this blog post to give yourself the appropriate permissions in SQL Express for use on Vista.

Mike

Problems with Rights in MS SQL Server Management Studio Express

Hi all!

I'm a beginner in SQL server admin and have just set up SQL Server 2005 in a Vista environment. So far so good! What I've got a problem with now is to get rights set up properly in the MS SQL Server Management Studio Express sw. If I try to add another database or add a new login and such, the results is all the time insufficent priviledges.

CREATE DATABASE permission denied in database 'master'. (Microsoft SQL Server, Error: 262) for instance.

SQL is SP2, all else is up to date too

Really would appreciate som help on this

Olof

hi Olof,

please verify the the account/SQL Server login you are using has enought permissions to create new databases, specifically "Create any database" permission..
log in as a member of system administrators server role or "sa" login, select the Security->Logins node... select the appropriate login, rx click->Properties.. in the "Securables" tab, press the [add] button, select the "the Server:your instance" radio.. in the "Explicit permissions for instance_name" grid, grant "Create any database" to the required login(s)..

regards

|||

Hi again!

I found the tabs u mentioned, came in where the explicit rights where and set create db on my user. Effectiv rights lists all the rights. Still I can't create a db as I don't have rights in the masterdb it says. If I go back to the explicit rights afterward, nothing is set on my user, even though it went well entering them earlier.....

This seems strange. My account is as system admin and login shows automatically login as SQLEXPRESS. If I use login with user my accound (as normal admin in the system) it says that it's not a trusted account: The user is not associated with a trusted SQL Server connection

I'm really lost here and will be thankful for any more hints.

Thanks in advance

Olof

|||

Hi Olof,

Windows Vista introduced a new security feature called User Account Control. Because of UAC, programs will no longer recognize your membership in Builtin\Administrators and will only see you as a normal user. Normal users do not have permission to create databases in SQL Server. You can use the provisioning tool described in this blog post to give yourself the appropriate permissions in SQL Express for use on Vista.

Mike

Friday, March 23, 2012

Problems with remote conexion

Hi all,
I have installed SQL SERVER 2005 EXPRESS but i cant do a remote login
with SQL Server Management Studio Express. I have deactivated Windows
XP firewall in the SQL SERVER side and I have activated tcp/ip
connections. Which can be the problem?
Thanks all(dagato2@.terra.es) writes:
> I have installed SQL SERVER 2005 EXPRESS but i cant do a remote login
> with SQL Server Management Studio Express. I have deactivated Windows
> XP firewall in the SQL SERVER side and I have activated tcp/ip
> connections. Which can be the problem?

First of all, deactivating the Windows firewall sounds like a bad idea. You
may have to open the ports on which SQL Server listens, or list the
machine you are connecting from as an exception.

Next, I will have to ask you for clarification. On which machine have you
installed SQL Express? On which machine have you installed Mgmt Studio
Express? To which server instance do you try to connect?

Keep in mind that by default SQL Express installs as a named instance, so
if you install SQL Express on a machine named DAGATO2, you should connect
to DAGATO2\SQLEXPRESS.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Erland Sommarskog ha escrito:

> (dagato2@.terra.es) writes:
> > I have installed SQL SERVER 2005 EXPRESS but i cant do a remote login
> > with SQL Server Management Studio Express. I have deactivated Windows
> > XP firewall in the SQL SERVER side and I have activated tcp/ip
> > connections. Which can be the problem?
> First of all, deactivating the Windows firewall sounds like a bad idea. You
> may have to open the ports on which SQL Server listens, or list the
> machine you are connecting from as an exception.
> Next, I will have to ask you for clarification. On which machine have you
> installed SQL Express? On which machine have you installed Mgmt Studio
> Express? To which server instance do you try to connect?
> Keep in mind that by default SQL Express installs as a named instance, so
> if you install SQL Express on a machine named DAGATO2, you should connect
> to DAGATO2\SQLEXPRESS.

I found the problem, I didnt have enabled sql browser.
Thanks for the answer.|||(dagato2@.terra.es) writes:
> I found the problem, I didnt have enabled sql browser.

Yeah that one as well! Thanks for posting back! Maybe one day I will
be able to remember all things that can go wrong with connection!

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspxsql

Tuesday, March 20, 2012

Problems with Management Studio Express

Hi,

I have two problems with Sql Management Studio Express. I've installed it to be able to upload/attach my Sql Server Express (that came with the Visual Web Developer Express download) to the real Sql Server 2005 at my web host.

1. When I start the application, that is Sql Management Studio Express, I get the following message:

***********************************************''

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.IOException: Det går inte att skapa en stabil underordnad nyckel till en temporär överordnad nyckel. ("It's not possible to create a lower key to a temporary upper key")

at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck, RegistrySecurity registrySecurity)
at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey)
at Microsoft.SqlServer.Management.UI.ConnectionDlg.RegisteredServersUtils.CreateKeyValueIfNotExist(String regPath, String keyName)
at Microsoft.SqlServer.Management.UI.ConnectionDlg.RegisteredServersUtils.RegisterLocalInstancesIfFirstTimeUser()
at Microsoft.SqlServer.Management.UI.ConnectionDlg.ConnectionDialog.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
------------
Microsoft.SqlServer.Express.AppIDPackage
Assembly Version: 9.0.242.0
Win32 Version: 9.00.2047.00
CodeBase:file:///C:/Program/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.Express.AppIDPackage.DLL
------------
Microsoft.SqlServer.Express.VSIntegration
Assembly Version: 9.0.242.0
Win32 Version: 9.00.2047.00
CodeBase:file:///C:/Program/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.Express.VSIntegration.DLL
------------
Microsoft.VisualStudio.Shell.Interop
Assembly Version: 7.1.40304.0
Win32 Version: 7.0.4054
CodeBase:file:///C:/WINDOWS/assembly/GAC/Microsoft.VisualStudio.Shell.Interop/7.1.40304.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Shell.Interop.dll
------------
Microsoft.VisualStudio.OLE.Interop
Assembly Version: 7.1.40304.0
Win32 Version: 7.0.4054
CodeBase:file:///C:/WINDOWS/assembly/GAC/Microsoft.VisualStudio.OLE.Interop/7.1.40304.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.OLE.Interop.dll
------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
------------
Microsoft.SqlServer.Express.SqlTDiagM
Assembly Version: 9.0.242.0
Win32 Version: 9.00.2047.00
CodeBase:file:///C:/Program/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.Express.SqlTDiagM.DLL
------------
Microsoft.DataWarehouse.SQM
Assembly Version: 9.0.242.0
Win32 Version: 9.00.2047.00
CodeBase:file:///C:/Program/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.DataWarehouse.SQM.DLL
------------
Microsoft.SqlServer.Instapi
Assembly Version: 9.0.242.0
Win32 Version: 9.00.1399.00
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SqlServer.Instapi/9.0.242.0__89845dcd8080cc91/Microsoft.SqlServer.Instapi.dll
------------
Microsoft.SqlServer.Express.ObjectExplorer
Assembly Version: 9.0.242.0
Win32 Version: 9.00.2047.00
CodeBase:file:///C:/Program/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.Express.ObjectExplorer.DLL
------------
Microsoft.SqlServer.Express.ConnectionDlg
Assembly Version: 9.0.242.0
Win32 Version: 9.00.2047.00
CodeBase:file:///C:/Program/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.Express.ConnectionDlg.DLL
------------
Microsoft.SqlServer.Express.RegSvrEnum
Assembly Version: 9.0.242.0
Win32 Version: 9.00.2047.00
CodeBase:file:///C:/Program/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.Express.RegSvrEnum.DLL
------------
Microsoft.SqlServer.Express.SqlWorkbench.Interfaces
Assembly Version: 9.0.242.0
Win32 Version: 9.00.2047.00
CodeBase:file:///C:/Program/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.Express.SqlWorkbench.Interfaces.DLL
------------
Microsoft.VisualStudio.TextManager.Interop
Assembly Version: 7.1.40304.0
Win32 Version: 7.0.4054
CodeBase:file:///C:/WINDOWS/assembly/GAC/Microsoft.VisualStudio.TextManager.Interop/7.1.40304.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.TextManager.Interop.dll
------------
Microsoft.SqlServer.Express.SqlMgmt
Assembly Version: 9.0.242.0
Win32 Version: 9.00.2047.00
CodeBase:file:///C:/Program/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.Express.SqlMgmt.DLL
------------
Microsoft.SqlServer.Express.SQLEditors
Assembly Version: 9.0.242.0
Win32 Version: 9.00.2047.00
CodeBase:file:///C:/Program/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.Express.SQLEditors.DLL
------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
------------
Microsoft.SqlServer.Express.ConnectionInfo
Assembly Version: 9.0.242.0
Win32 Version: 9.00.2047.00
CodeBase:file:///C:/Program/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.Express.ConnectionInfo.DLL
------------
EnvDTE
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.42 (RTM.050727-4200)
CodeBase:file:///C:/WINDOWS/assembly/GAC/EnvDTE/8.0.0.0__b03f5f7f11d50a3a/EnvDTE.dll
------------
Microsoft.SqlServer.Express.CustomControls
Assembly Version: 9.0.242.0
Win32 Version: 9.00.2047.00
CodeBase:file:///C:/Program/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.Express.CustomControls.DLL
------------
Microsoft.SqlServer.Express.SqlEnum
Assembly Version: 9.0.242.0
Win32 Version: 9.00.2047.00
CodeBase:file:///C:/Program/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.SqlServer.Express.SqlEnum.DLL
------------
Microsoft.NetEnterpriseServers.Express.ExceptionMessageBox
Assembly Version: 9.0.242.0
Win32 Version: 9.00.2047.00
CodeBase:file:///C:/Program/Microsoft%20SQL%20Server/90/Tools/Binn/VSShell/Common7/IDE/Microsoft.NetEnterpriseServers.Express.ExceptionMessageBox.DLL
------------
Accessibility
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

******************************************************************

Why do I get this and what should I do to avoid it? I've installed Atlas and tried out some AJAX components from Telerik, but I haven't done anything else sppoky to the machine (Windows XP Home, SP2). If I click Continue, I cn still open Sql Management Studio Express, but get this error code occasionally.

2. I have my db in the folder VWD suggested, that is My Documents>My websites>the website's name, but I can't seem to navigate to there. Instead the Object Explorer is stuck in my computer's topnode somewhere. What should I do? It seems strange to me that these things don't fit together if that's the case. Or has this to do with the problem stated above? I admit I know little about this, having previously worked with Access and MySql only.

Please help me out! An additional note: I don't particularily want this app anyway, just a convenient and reliable way to attach my db to the web host's Sql Server. Is there an easier way (or maybe this is easy but just not working ;-) )?

Thanks for any replies,

Pettrer

Your error is saying Windows Forms so I don't know but you could ask your hosting company backup and restore permissions so you can just backup and restore. The other option modify the code in the thread below to the info you get from the hosting compaby so attach your database. And if you are having probelm with all of the above with Express test drive the full version just right click at the top of Management studio to register the Express. Hope this helps.

http://www.microsoft.com/sql/downloads/trial-software.mspx

http://forums.asp.net/thread/977493.aspx

|||

Hi,

Thanks for all of your suggestions, but actually I'm only trying out the Management Studio locally for now (the error appeared the first time I opened it). I think I'll try to re-install it and see if it works better...

Pettrer

|||

It did! ;-)

P

Saturday, February 25, 2012

Problems with adding database samples

I have installed the documentation and samples and the management studio for sql 2005 express edition, but when trying to work through the samples, I get this error message, for some reason I can't include the Adventure works db. Whatn I'm I not doing right? Please can someone help!


1> SELECT name from sys.databases
2> Go
name

--

master

tempdb

model

msdb


1> CREATE DATABASE [AdventureWorks] ON
2> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.mdf' ),
3> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.ldf' )
4> FOR ATTACH ;
5> GO
Msg 153, Level 15, State 1, Server YOUR-V7OY5L24PG\SQLEXPRESS, Line 2
Invalid usage of the option AdventureWorks in the CREATE/ALTER DATABASE statemen
t.
1> USE [master]
2> GO
Changed database context to 'master'.
1> CREATE DATABASE [AdventureWorks] ON
2> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.mdf' ),
3> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.ldf' )
4> FOR ATTACH ;
5> GO
Msg 153, Level 15, State 1, Server YOUR-V7OY5L24PG\SQLEXPRESS, Line 2
Invalid usage of the option AdventureWorks in the CREATE/ALTER DATABASE statemen
t.
1> select name from sys.databases
2> go
name

--

master

tempdb

model

msdb


(4 rows affected)
1>

Your create database statement is slightly wrong. If you look at the syntax it is

create database <dbname> ON (Name=<logical name for file>, filename='<filename>')

LOG ON (Name=<logical name for file>, filename='<filename>')

You have combined the logical name for file and filename and ommitted the name and filename keywords.

|||

I am trying to learn SQL 2005 and I am working throught the Microsoft SQL Server 2005 Implementation and Maintenance Training Kit.

I have partitoned out my hard-drive into several partitons.

C,G,H,I,J and K.

Created Sales_Data folders in G,H,I drives

I ran the following code in MSSM Studio:

CREATE DATABASE Sales
ON
PRIMARY
(NAME = 'G:\Sales_Data\SalesPrimary.mdf'
SIZE = 50MB,
MAXSIZE = 200,
FILEGROWTH = 20),
FILEGROUP SalesFG
( NAME = SalesData1,
FILENAME = 'H:\Sales_Data\SalesData1.ndf'
SIZE = 200MB,
MAXSIZE = 800,
FILEGROWTH = 100),
( NAME = SalesData2,
FILENAME = 'H:\Sales_Data\SalesData2.ndf'
SIZE = 400MB,
MAXSIZE = 1200,
FILEGROWTH = 300),
FILEGROUP SalesHistoryFG
( NAME = SalesHistory1,
FILENAME = 'H:\Sales_Data\SalesHistory1.ndf'
SIZE = 100MB
MAXSIZE = 500,
FILEGROWTH = 50)
LOG ON
(NAME = ArchLog1,
FILENAME = 'I:\Sales_Data\SalesLog.ldf',
SIZE = 300MB,
MAXSIZE = 800,
FILEGROWTH = 100)

I am getting the following error message:

Msg 153, Level 15, State 1, Line 5

Invalid usage of the option SIZE in the CREATE/ALTER DATABASE statement.

Any idea as to why it will not except the syntax for the size option? ny help will be greatly appreciated.

|||Just do a basic check. You miss comma before SIZE option.

CREATE DATABASE Sales
ON
PRIMARY
(NAME = 'G:\Sales_Data\SalesPrimary.mdf', <-Here
SIZE = 50MB,
MAXSIZE = 200,
FILEGROWTH = 20),
FILEGROUP SalesFG
( NAME = SalesData1,
FILENAME = 'H:\Sales_Data\SalesData1.ndf', <-Here
SIZE = 200MB,
MAXSIZE = 800,
FILEGROWTH = 100),
( NAME = SalesData2,
FILENAME = 'H:\Sales_Data\SalesData2.ndf', <--Here
SIZE = 400MB,
MAXSIZE = 1200,
FILEGROWTH = 300),
FILEGROUP SalesHistoryFG
( NAME = SalesHistory1,
FILENAME = 'H:\Sales_Data\SalesHistory1.ndf', <--Here
SIZE = 100MB, <--And here
MAXSIZE = 500,
FILEGROWTH = 50)
LOG ON
(NAME = ArchLog1,
FILENAME = 'I:\Sales_Data\SalesLog.ldf',
SIZE = 300MB,
MAXSIZE = 800,
FILEGROWTH = 100)


Thanks,
Zuomin

Problems with adding database samples

I have installed the documentation and samples and the management studio for sql 2005 express edition, but when trying to work through the samples, I get this error message, for some reason I can't include the Adventure works db. Whatn I'm I not doing right? Please can someone help!


1> SELECT name from sys.databases
2> Go
name

--

master

tempdb

model

msdb


1> CREATE DATABASE [AdventureWorks] ON
2> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.mdf' ),
3> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.ldf' )
4> FOR ATTACH ;
5> GO
Msg 153, Level 15, State 1, Server YOUR-V7OY5L24PG\SQLEXPRESS, Line 2
Invalid usage of the option AdventureWorks in the CREATE/ALTER DATABASE statemen
t.
1> USE [master]
2> GO
Changed database context to 'master'.
1> CREATE DATABASE [AdventureWorks] ON
2> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.mdf' ),
3> (AdventureWorks = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\
< AdventureWorks>.ldf' )
4> FOR ATTACH ;
5> GO
Msg 153, Level 15, State 1, Server YOUR-V7OY5L24PG\SQLEXPRESS, Line 2
Invalid usage of the option AdventureWorks in the CREATE/ALTER DATABASE statemen
t.
1> select name from sys.databases
2> go
name

--

master

tempdb

model

msdb


(4 rows affected)
1>

Your create database statement is slightly wrong. If you look at the syntax it is

create database <dbname> ON (Name=<logical name for file>, filename='<filename>')

LOG ON (Name=<logical name for file>, filename='<filename>')

You have combined the logical name for file and filename and ommitted the name and filename keywords.