Re: AdventureWorks scripts
- From: "Mike Wachal \(MSFT\)" <michael.wachal@xxxxxxxxxxxxx>
- Date: Fri, 17 Jul 2009 12:22:18 -0700
Hi Jason,
Regarding permissions you should verify that the user you're looking into has at least CREATE DATABASE permissions, but for you're purposes you'll probably have CONTROL SERVER which includes the other. You can do this in SSMS as follows:
1. Expand the Security node.
2. Expand the Logins node.
3. Assuming you're using Windows Security (default for Express) right click on the name of your Windows account and open Properties.
4. Verify that the Login is a member of the SysAdmin Server Role.
5. If you are not a member of SysAdmin, check your specific permissions at the Server level to see if you have CREATE DATABASE, which you can do from the Securables page of the Property dialog by clicking Search and following the path from there.
If you cannot see your account, or you you get permission errors when you attempt the steps above, then you likely don't have the appropriate permissions to create a database (running the scripts will fail as well if this is the case). You will need to determine what user is a member of the SysAdmin role and login as that user to give yourself appropriate permissions. If you're working with SQL Server 2008, you would have configured this during installation of SQL Server and it is likely the same user as the person who did the installation. If you're working with SQL Server 2005, it's likely any member of the Windows Administrators group.
If you have the appropriate permissions, then John is likely on the correct path and you should continue down that path to a resolution.
--
Regards,
Mike Wachal
Program Manager
This posting is provided "AS IS" with no warranties, and confers no rights
"John Bell" <jbellnewsposts@xxxxxxxxxxx> wrote in message news:0475E10B-6FF9-4EE2-996B-64C9F376F5E6@xxxxxxxxxxxxxxxx
Hi.
As you are restoring to a SQLExpress instance you probably need to use the the MOVE option as
the directory "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\" probably doesn't exist but
"C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA" will exist. For the RESTORE command see http://msdn.microsoft.com/en-us/library/ms186858.aspx for SSMS see information about the options tab http://msdn.microsoft.com/en-us/library/ms188223.aspx
Judging by the directory name this backup is not a SQL Server 2008 version of the database, so you may want to download the adventureworks databases again and re-install them using the installation process. http://msftdbprodsamples.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=18407
John
"Me!" <dummy@xxxxxxxxxxx> wrote in message news:O%23GGQktBKHA.3368@xxxxxxxxxxxxxxxxxxxxxxxThanks, I'd rather attach the db, but I have the following problems:
I have a back-up that I've been trying to restore but When I restore it, I can restore from device, select the file, and see the contents. But after selecting 'restore' I get the following error msg :
------------------------------
Restore failed for Server 'MACBOOKPRO\SQLEXPRESS'. (Microsoft.SqlServer.SmoExtended)
------------------------------
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks.mdf'. (Microsoft.SqlServer.Smo)
Which appears to be permissions related, so when I right click on the shortcut to SQL Server Management Studio and can choose Run As Administrator and try again I get the following error:
CREATE DATABASE permission denied in database 'master'.
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 262)
I told you I wasn't a DBA ! (and now my other sample DBs - northwind, pubs etc. aren't visible), error msg is:-
The server principal "MACBOOKPRO\Administrator" is not able to access the database "Northwind" under the current security context. (Microsoft SQL Server, Error: 916)
Any ideas?
I'm not a DBA as such, just an analyst who queries the data, so a lot of this 'back-ground' SSMS stuff I've no idea about :-)
Many thanks,
Jason
"Gail Erickson [MS]" <gaile@xxxxxxxxxxxxxxxxxxxx> wrote in message news:eShs0YmBKHA.4984@xxxxxxxxxxxxxxxxxxxxxxxYou can find the installation script and data files (csv) here: http://msftdbprodsamples.codeplex.com/SourceControl/changeset/view/27902
Once you've downloaded all the files, you'll need to modify the instawdb.sql script to point the BULK INSERT statements to the correct location of the csv files.
Frankly, attaching the database files is much easier. If you can tell us what problems you're having, we can probably help you.
--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
Download the latest version of SQL Server 2005 Books Online from http://technet.microsoft.com/en-us/sqlserver/bb428874.aspx
Download the latest version of SQL Server 2008 Books Online from http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
"Jason" <ThisisaDummyEmailAddress@xxxxxxxxxxxx> wrote in message news:h3o8tu$44o$1@xxxxxxxxxxxCan anyone advise me where I can find the create/insert scripts for AdventureWorks. I'm habving problems with installing a .msi and attaching to the mdf, but know the scripts will be ok but I can't find them.
many thanks, Jason
- Follow-Ups:
- Re: AdventureWorks scripts
- From: Jason
- Re: AdventureWorks scripts
- References:
- AdventureWorks scripts
- From: Jason
- Re: AdventureWorks scripts
- From: Gail Erickson [MS]
- Re: AdventureWorks scripts
- From: Me!
- Re: AdventureWorks scripts
- From: John Bell
- AdventureWorks scripts
- Prev by Date: Re: Join Performance Question
- Next by Date: Re: Replay Trace Profiler files with T-SQL code
- Previous by thread: Re: AdventureWorks scripts
- Next by thread: Re: AdventureWorks scripts
- Index(es):
Relevant Pages
|