Get Cannot find column [SchemaName]. when trying to add Table to imported SSAS project - ssas

After importing my SSAS project from the prod environment into visual studios, it seems that I can't add any new tables to the datasource view.
This is the error msg I get:
"TITLE: Microsoft Visual Studio
------------------------------
Cannot find column [SchemaName].
Any idea what is wrong and how i can fix it?
using SSAS 2008 and connecting to Sybase IQ 15.2.

I was able to resolve this one but what all I understood was it is a Visual Studio bug.
I re-installed the Visual Studio and it worked fine. I got this idea because I was able to do the same thing, without any errors, from another server (a different system basically).
So, you can try that.
P.S. All the best.

Related

Can't create a simple SQL Test

I'm trying to get just basic unit testing on an SQL database through a Visual Studio project.
The first thing I tried was just creating a simple .Net Core Unit Testing library.
Then I added an SQL Test, and it couldn't link to the SqlDatabaseTestClass`. Looking around, this is a fairly ubiquitous issue, but I found an obscure comment at the bottom of https://developercommunity.visualstudio.com/content/problem/29842/database-unit-test-project-does-not-build-in-visua.html that said that it's probably a linking issue.
So I created a .Net Framework Unit Test project. Now that has no option to add an SQL Test.
So I found an article that says that I should try creating an SQLDatabase https://www.codeguru.com/csharp/.net/net_data/create-sql-server-database-unit-tests-using-visual-studio.html
But then I got an error that The server version or database compatibility level is not supported. Import Database in VS 2015 SQL Server Database Project
The solution to that was to go to the SQL Server Object Explorer and right click on the DB and create an SQL project by right clicking on the Database. And that worked! Finally I have a project with database tables.
But now when I right click on a stored procedure, I don't get the option to create a unit test.
I figured it out.
Open the View -> SQL Object Explorer in the top menu bar in Visual Studio 2017. Make sure it's the Object Explorer and not the Server Explorer. These instructions presuppose that you have your connections setup properly.
Right-click on your database and click Create New Project. Make sure the directory is correct because it wasn't for me.
After the database imports, go to your Error List and resolve all those errors. Now you should be able to right-click on a stored procedure in either the SQL Server Object Explorer and select Create Unit Tests.
Allowing Visual Studio to do all the heavy lifting sorted me out.

Can't get SQL code working on Visual Studio

With the exception of a little HTML/Javascript, I've always used C++ on Visual Studio C++ 2010. I have an internship next week that will involve the use of SQL and .Net. I'm currently reading a book on SQL and it instructs us to go to its website to download code so that we can practice. The website is here: http://forta.com/books/0672336073/ I downloaded the one labeled "Microsoft SQL Server" which is basically two .sql files. One creates a simple database and the other one populates it.
However, for the life of me I cant figure out how to do it on Visual Studio 2010 or 2013 (I downloaded the full version of 2010). If anyone knows how to get these file to run on either VS version I would be very happy. I'm used to just hitting the green arrow button in Visual Studio C++ 2010, which I believe is execute. Obviously it isnt working for my sql code.
On VS 2013 I created a new "SQL Server Database Project". I then added two new "Application Role" items for the two .sql files. Now after clicking the "SQL" tab and "Execute" I get error messages about duplicate objects/keys, which I assume means the database is already created...but how do I view it? At one instance I mustve hit the right combination of buttons because I was able to view my database in a table format.
Thanks for any suggestions!
In visual studio go to view and select sql server, (see image) then click the + symbol and connect to the server installed on your machine (if its not yet listed)

Visual Studio 2013 SQL Query and View Designer not appearing

Not sure why the Query and View Designer is not appearing as per
http://msdn.microsoft.com/en-us/library/vstudio/ms172013.aspx
It's an ASP.net project with database in the AppData folder, and a connection using SQL 2008 Express.
If it helps the connection string is:
Data Source=.\SQLEXPRESS;AttachDbFilename="C:\folders...\App_Data\database.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True
If I open the project in VS2012 (where I've worked on this project for some time), find a table, right click, new query, I get the nice interactive visual design tool.
If I open the project in VS2013 (just installed) and do the same, blank page named SQLQuery1.sql and a basic connection to SQL Express (ie. master, model, etc.)
MS page tells me Tools / Options / Visual Database tools - but this doesn't exist on my installation!
Am I missing something?
Also tried with blank project, added App_Data and a new database (so using LocalDB), added a table, right click, new query - exactly the same blank file.
I have been having the same problem and think I have found the solution.
When you are adding the connection to the Database, in the Add Connection Dialog.
Click 'Change...' next to the Data source
Dialog opens showing 'Change Data Source'
You probable have selected 'Microsoft SQL Server' and then below that there is a drop down where you can select:
.NET Framework Data Provider for OLE DB
.NET Framework Data Provider for SQL Server (This is probably selected by default)
try changing to the OLE DB connection.
Click OK, and then complete the rest of the connection on the 'Add Connection' dialog.
I have then found that using the database works as it did in VS2012 and as you are describing above.
Was searching for a solution to a similar issue. Unable to use Query Designer for a local mdf file database. This is what I found...hope it helps someone.
Reading the comments here (http://social.msdn.microsoft.com/Forums/sqlserver/en-US/ed4675d3-aa84-47db-bdf5-f852355409e6/query-designer-not-displaying-in-visual-studio-2013?forum=ssdt).
According to the moderator of that forum question (Kevin Cunnane of Microsoft), "in Visual Studio 2013 the query designer and database diagram features are no longer available from the Server Explorer. If you wish to keep using the query designer, the only other workaround for now is to access it from SSMS. "
My current workaround is to use Visual Studio 2012 Server Explorer to view data and write queries for a local MDF file. And to use Visual Studio 2013 for everything else.
I have researched about 5 minutes how to run a query in Visual Studio. At the end I found this:
Even though i followed same steps , It did not work at once it gave some error and Studio closed. It was problem at my end and unknowingly it got sorted out on its own.
This component is called "SQL Server Data Tools". You can download it from MSDN. I found this page simply by googling "vs2013 ssdt". It seems that what TsugaSoft posted is true, however you still can install this component separetely... And it also works for Visual Studio 2012.

SQL Server 2008 Management studio - can't see tables, can run queries

Well, I have a database running on shared hosting and have successfully connected to it. However, i cannot see the database but when i run i.e.
SELECT * FROM Item
Item is a table in it, i get correct result.
Further more, when connected via Visual Studio 2010 with the same credentials, i see it.
Ive had this issue before and resolved it by applying the current Service Pack to SSMS
It looks like a bug in Microsoft SQL Server Management Studio. See https://connect.microsoft.com/SQLServer/feedback/details/387616/tables-node-does-not-show-all-schemas-in-ssmse-2008

References/walkthroughs for maintaining database schemas with Visual Studio 2010?

I have Visual Studio 2010 Beta 2 and SQL Server 2008 installed. I'm working with a populated database and want to modify various column types. SQL Server Management Studio requires me to drop tables to do this, and get pretty finicky given my moderate level of knowledge of SQL Server.
However, I heard the new database project type supports changing the database schema to the desired format and it will handle creating and running all the scripts to implement the changes.
I've created a VS2010 database project using the existing database as the source, but so far haven't had much luck figuring out the appropriate method to make the changes without getting an error.
As a result, I'm looking for any reference info I can find on using VS2010's capabilities in this area. Any suggestions?
write scripts instead of using the gui. You can use alter table for instance to change a column. Never use a GUI of any kind to create a change to a database table.
Here's a walk through of the new VS2010 "Deploy-SQL" tab in the properties page of web application projects.