Cloud Database problem while connecting thru SSMS - azure-sql-database

I have created a cloud database and was able to connect successfully thru SSMS.
Now I want to create a table in that.
Henceforth after the successful connection ( in am doing thru SSMS) when I am trying to connect to the database i.e. MyFirstCloudDB database which is available in the Available Databases section of SSMS, I am getting the error message " The database MyFirstCloudDB" is not accessible.
What to do now?
EDIT:
I have success accomplished my work.
But what I have done is that after I logged in to my SQL AZURE platform thru SSMs, first I created a database(say myFirstDB).
Then I logged out. Again I connected and this time Under Options->Connect to Database->I typed myFirstDB and then connected.
After that I created a table and inserted some values.
I have included this paras by thinking that if someone like me face the same problem then they can go ahead with this solution.
Thanks for the great support of Mr. Rob Farley for being with me in this journey and also to all the SO members. This forum is really really great (:
Pls help.

You need to login to your new db as your admin login and create a user for your new login. Then try connecting as the new login again.

Related

Apex - Create DB link

so, I have to make an Application Page with Oracle Apex. It is relatively simple, I only need one table. I tried to connect to it by SQL, but here comes the problem. There is no DB-Link existing.
How do I create a database link. I have Admin rights for Apex and have access to the admin account on the database server, from which I would need the data. Previously the data would be sended by E-Mail to us.
The sending Mailadress is adminname#servername.domain.net, that way I know on which server the database is located
I sadly do not know how the Mail Protocoll works, cause this was created before I started there.
I also do not know where on the server the database is located, all I know is that it is somewhere on the server.
Kind regards
Elias

How to delete a corrupt database from azure sql

I have tried to delete a SQL database from the azure portal. It looks like it has failed part way though. The database doesn't show up under the list of SQL servers in the Azure portal. However if I login to the server through SSMS it is still there. I now can't delete the database or create a new one with that name.
I've tried deleting the database with a query and get an error saying the database doesn't exits. If I try to create it either from the Azure portal or SSMS it gets an error saying it already exists.
I had a similar problem once, with SSL settings, where it would return that it is linked to the app even tho it wasn't, hence I was not able to delete it. After a couple of weeks of back and forward with the support, we removed it through azure resource explorer.
How to:
Once you are logged in, set read/write
In serach box find your resource
Click actions (POST/DELETE) // these should be available now since you have set read/write
Click Delete
Hopefully, this would help anyone who has any corrupted resources in Azure.

Azure - Cannot create SQL database

Every time I try and create a new database and a new server in Azure, I am greeted by this cloud icon
Then when I press ok in the Add data connection tab, I am prompted by this error:
There was an error while creating data connection 'Storage data connection - ma7b51a363647f41'.
I have seen the other SO posts about this error, but none of the solutions such as
Delete all your other database connections and services
Retry the process
work for me.
I have exactly same problem. I try same things and still error appears. I find another solution in my problem, I created new Mobile Apps Quickstart and then i created new DB and data connection successfully. I hope this will help you little bit if you are struggling with app services too.

Cannot login with read-only user to SQL Azure database

I've followed the answer to this question: In SQL Azure how what script can I use to create a read only user
I've completed all the steps successfully on the correct server. However, when I try to login to the Azure database, I'm getting the following error:
Login failed for user 'readerUser'.
This session has been assigned a tracing ID of '(some guid)'.
Provide this tracing ID to customer support when you need assistance.
I've tried this in both my ASP.NET website and in my LINQPad, they both give the same error (with different GUIDs). I am trying to connect to the exact same server as my primary login, which can connect perfectly.
I've also checked sys.sysusers system view and readerUser is there as a login.
What could be the reason?
After trying many combinations (and learning better about users, logins, and roles on SQL Azure) I've figured out the issue:
I was trying to login with readerUser, which is just a database user, and I should instead have logged in with the login instance, hence reader (as followed by the answer at the question that I've linked). I've tried logging in with reader and it worked perfectly: logging in, SELECTing anything I want, but not able to write/alter/delete anything.

Login Failed for user?

I am developing a web app that connects to a SQL 2000 database. Everything works perfectly on my database (which is actually SQL 2008) but when I try to migrate it onto another server (that's actually running SQL 2000) I get some strange errors.
I'm getting Login Failed for the username that the web app uses, so I did my normal troubleshooting steps...
I reset the password to what it should be, made sure the user was mapped to the database it's trying to connect to. I connected to the database through Enterprise manager using the user name and password and was able to run queries. I reset the SQL server.
I'm fresh out of ideas other than there might be a place in my app that the password is for some reason getting changed. Is there anyway to see what password the SQL server is seeing? I just want to narrow down my search a little.
Either that or does anyone have any other suggestions on how I might be able to fix this?
EDIT: Also, the web app CAN talk to the database, it hits the database to get login credentials and it can login with no problems. The error is coming up later in the app when I try to get more information from the database, like parameters for a report or an export location.
Thanks in advance!
First, the problem is not that the login failed for a user. From your description, the login succeeded. However, you stated that you later got an exception when trying to access certain objects. This sounds like an authorization/permissions issue with the database user to which the login is associated and the objects it's trying to access. Have you tried connecting to the database using Enterprise Manager and the same credentials used by the site and executing the identical query as the web application?
Possibly your SQL server isn't set to allow remote connections?
EDIT: or your firewall doesnt have the right ports opened?
EDIT2:
If your web script is on the same server as the SQL server, the only thing that i can think of is that you have specified an incorrect password, of if you referenced the old server by name (even though it was localhost) and you have not updated it. If the web script is on a different server, check your firewall ports and ensure the sql server is set to allow remote connectioins.
EDIT3:
Appologies, i didn't see your update before i posted the last edit (EDIT2). Thomas is right, give that a go.
Not sure how you're doing your migration but you may want to make sure your sql user is not getting orphaned:
From - http://www.fileformat.info/tip/microsoft/sql_orphan_user.htm
First, make sure that this is the problem. This will lists the orphaned users:
EXEC sp_change_users_login 'Report'
If you already have a login id and password for this user, fix it by doing:
EXEC sp_change_users_login 'Auto_Fix', 'user'
If you want to create a new login id and password for this user, fix it by doing:
EXEC sp_change_users_login 'Auto_Fix', 'user', 'login', 'password'
I found the problem!
It was actually some lingering queries I had in the app. I started populating some down downs differently and the queries were never removed, as soon as I took those out the errors stopped popping up.
Still it's strange that this would not effect the app on my machine but on this other machine would cause all kinds of havok.
Thank you all for your help and suggestions, it really helped narrow down the problem. Thomas gets the accepted answer though because his suggestion pointed me in the right direction.