SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Utter noob. please advise.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ShaneAvent
Starting Member

1 Posts

Posted - 11/08/2013 :  11:00:02  Show Profile  Reply with Quote
I need to set up a test database, i have never really done anything like this.

I have been given a txt file to put into a query, I was told all i need to do is install an instance of sql express and execute this query but when i did, it gave me a lot of errors, beginning with AssistedSales database doesn't exist, so i found a section in the code that has "CREATE DATABASE [AssistedSales] ON PRIMARY" but it was half way down the file, i put this first in the query, and the errors changed to what you see in the image.

can anyone tell me if this is just completely wrong and i have been given a fools errand or am i missing something. Oh and also, even though the create database is at the top and i no longer receive the error about it not existing, it still doesn't get created in the left pane.


After i altered it.




Before i altered it. this is how it was given to me and told it would sort itself out...


TG
Flowing Fount of Yak Knowledge

USA
6062 Posts

Posted - 11/08/2013 :  11:08:10  Show Profile  Reply with Quote
>>I was told all i need to do is install an instance of sql express and execute this query
Unless you were hired as a DBA I would just copy the errors into a reply and send it back to the person that provided it.

If you need help fixing the errors then post the original script here - not as an image but as text within code tags:
[code ]
...
[ /code]


Be One with the Optimizer
TG
Go to Top of Page

sz1
Constraint Violating Yak Guru

United Kingdom
443 Posts

Posted - 11/13/2013 :  06:30:08  Show Profile  Reply with Quote
What permission have you set yourself on the server?
You first need to set yourself up as sysadmin permissions to install objects. Security - New User - YourName - set permissions to sysadmin for the account. Try script again!

SZ1
Please help me to enable me to help others!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000