If I create a SQL Express database via VS2010, I can create diagrams and this way set foreign key relationships. What's the case in a compact database? There is no such option in Server Explorer for this type of DB.
Yes there is. In Server Explorer, right click the table, select Table Properties, and use Add Relations view. Remember to press the "Add Relation" button to actually add the releation
Walkthrough: Creating a SQL Server Compact 3.5 Database
To create a relationship between the tables created in the previous procedure
In Server Explorer/Database Explorer, expand Tables.
Right-click the Orders table and then click Table Properties.
Click Add Relations.
Type FK_Orders_Customers in the Relation Name box.
Select CustomerID in the Foreign Key Table Column list.
Click Add Columns.
Click Add Relation.
Click OK to complete the process and create the relationship in the
database.
Click OK again to close the Table Properties dialog box.
Related
I have a model in Azure Analysis Services I'm maintaining through Visual Studio.
The user added some fields to the source table in Snowflake, and I need to pull them into the model.
I right-click on the table and select Table Properties, then go into the Power Query Editor.
I refresh the preview, the new columns appear.
I go to Columns->Choose Columns, the new columns are there and already selected since (Select All Columns) was originally checked. I click OK, then Home->Close & Update.
The SQL statement has changed, I see the new columns listed at the end. I click OK.
Nothing happens. The new columns don't appear in the drop-down in the Tabular Model Explorer, and the model doesn't indicate anything changed.
Obviously I'm missing a step here, would appreciate any guidance folks can provide.
Found the issue -- apparently VS didn't like the alias name the editor was adding to the query. When I simplified the alias to a single word, the update took no problem.
I am using SQL Developer for my Oracle DB, wonder why are my shortcut buttons are being disabled (see attached image) while the user acc i logged in has the permission to add/edit/delete rows. I am able to add rows by typing in query. How should I enable them?
And also not able to edit the row using the GUI by clicking on the pencil button.
I created a database project in VS2010, created the connection to my SQL Server 2008 R2 database and I know it's connected because I can write a SQL command and it works. It even auto-suggests table names as I type.
I want to be able to use SSMS-style things like browse table names & stored procedures, right-click on them and do the tasks.
But I'm not even able to see the tables. I have both Solution Explorer and Schema View on the right side and it shows the whole tree, but not a single table under Schemas >> dbo >> tables.
Here's the schema view
And here is the server explorer view after adding the server.
What am I missing?
if i understand you right, Use server explorer you can find it in VIEW tap OR Click
Ctrl + Alt + S
And connect to your server and database it will show every thing on that database
I am attempting to add a connection to an Oracle database through Server Explorer. The 'Test' Connection' is successful, however whenever I go to view the list of tables / schemas, I can only see the one associated with my login.
I realise this sounds silly, but when I use the same login/password through Toad for Oracle, I am still allowed to browse "All Schemas" to find the tables I want.
Is this possible through Server Explorer? Or do I need to find a specific login for the schema I want to access?
Solution (just so it's here and not just on the OTN forums)
Right-click on connection in Server Explorer
Choose filters
Select the "Dispalyed Schemas" row in the property grid (it should be selected by default)
In the Property/Condition/Value fields, click the "..." button for Value
Pick any schemas you want to see and click Ok.
Conversely, instead of using the dialog that appears after clicking the "..." button, you can list the schemas separated by commas in the Value textbox.
Oracle's way of dealing with users and schemas is different from SQL Server's. So I suspect the default Visual Studio behaviour won't work properly with Oracle.
Have you installed the free Oracle Developer Tools for Visual Studio? Find them here. If you do that then you can manually add the other schemas to the filter of your main connection. I found instructions in this OTN forum thread:
"highlight the connection node you
want to moidy and choose filters or
right click on the specific connection
node and choose modify then click on
the filters tab to modify the
filters."
I agree this is clunky, and it should be done automatically. I guess there's a limit to how VS can be extended.
And should I add it to the source code repository?
It is for state persistence for Schema View.
The state of this view is saved locally, there is no need to add it to source code.
The SQL Server project type has a special Schema View window and an extra Data menu item.
Also the Solution Explorer gets two extra buttons: Database Schema View and Reanalyze Project.
When the Schema View is open, 4 menu items under Data|Schema View are activated with the same functionality as 4 of the buttons in the Schema View window (a rather strange button in the Schema View window is the Solution Explorer button to return to the Solution Explorer..)
Note e.g. the External elements and Built in elements menu items in the Schema View window.
When you select Built in elements schema's of built-in db-roles become visible (e.g. db_owner).
When you select External elements schema's defined in different projects may become visible.
Such settings are saved in the schemaview file.