SQL 2014 windows 10 - sql-server

This alert appears, when I want to open any (.sql-) file where I want to create new database or new query.
Class not registered.
Looking for object with CLSID
{D8CB03CB-A124-4E7F-9EB2-788F351367A2}

Related

Crystal Report Designer: Retrieve query from broken SQL link

I have some problem with SAP Crystal Report. We have just upgraded the server, to the new server. Since the server did run in tandem with old server, we had to give it another name.
The problem, is that crystal report would not function at all to the new server. It saved the connection to old server at the rpt file, and refuses to change the connection. All properties were grayed out, and cannot be changed to new connection.
So I made a new connection, and wanted to copy the SQL query to the new connection. But when I click on View Command or Edit Command, nothing happened.
Any idea on how to transfer existing rpt to the new server?
I ended up creating dummy server with name as old server. Doesn't need to have same table or anything, just dummy SQL server. The query suddenly works, albeit errors, but I can copy them all to new report

Not able to run sql-script for database in Visual Studio

I am trying to learn MVVM Pattern for WPF Applications in Visual Studio.
To this end I am doing an online course, which provides the source code for the course project under the following address:
https://github.com/briannoyes/WPFMVVM-StarterCode
I downloaded the project code and opened the project in Visual Studio.
So far so good.
Then I am supposed to create an empty database and run the ZzzDatabaseGen.sql. file, which was also provided under the above-mentioned link.
So I did the following steps:
Choose "Project"
Choose "Add New Item"
Select "Service-based Database"
In the Name area, I typed: Zza.mdf
Choose Add
Then I opened the file ZzzDatabaseGen.sql and executed it.
I receive an error message telling me that the database "Zza" doesn't exist.
What do I have to do to create a database, connect it to my project and be able to run the ZzzDatabaseGen.sql script so that all the tables are created?
Before running the script file you have to create the database in your SQL Server instance.
So, for example, using the SQL Server Object Explorer in VS you can access all your local SQL Server Express instances.
Here, you can select the desired instance and click "New query".
To create a database for your purpose you can simply run this code:
CREATE DATABASE [Zza] ON PRIMARY
( NAME = N'Zza', FILENAME = N'\Zza.mdf')
LOG ON
( NAME = N'Zza_log', FILENAME = N'\Zza_log.ldf')
GO
Of course you have to write the correct path to the mdf file you would like to create.
After that you can run the ZzzDatabaseGen.sql script to create the tables and insert all the data.
Right-click on the Service-based database file (Zza.mdf) that you created in the Solution Explorer in Visual Studio and choose "Open". This should bring up the Server Explorer (View->Server Explorer).
Then you right-click on the Zza.mdf node in the server explorer and choose "New query". You should then be able to run the queries in the query window.
Press the green play arrow once you have pasted in the queries from the ZzzDatabaseGen.sql script.

Can't perform a new query in Visual Studio against a database

I have successfully created a sample server-based database in Visual Studio 2015 Community Edition with settings in Tools>Options>Data Tools>Data Connection under SQL Server Instance Name set to 'SQLEXPRESS'. However, upon performing a new query against the database, it displays this error:
Msq 208, Level 16, State 1, Line 1
Invalid object name 'Recipe'.
My query is this:
SELECT * FROM Recipe
My database is named as "Cookbook" with tables Recipe, Ingredient, RecipeIngredient.
When initiating a query, in the Available Databases drop-down menu, the database I have created isn't listed. Is that possible? For Visual Studio to have created a database but not include it in the Available Databases menu?
But creating a database in SQL Server Management Studio is ok. It's in the Available Databases list.
My assumption is that Visual Studio has created a local database instead of a service-based one.
Anyway I am following this guy's tutorial and encountered this error. Please enlighten me. :)
It looks like you need to commit the DB changes. You should see an Update or Commit button at the top bar, click it.

Why doesn't VS show my created database in the 'Select or Enter a Database name' dropdown list?

I created a database named sample in SQL server management Studio 2008 and created a table too. But When I wanted to connect to the created database from the Visual Studio 2010, it did not show my created database.
All I did is I clicked ..
Tools --> Connect to Database --> Selected the server name --> Clicked 'Use Windows Authentication'---> clicked the drop down list of 'Select or enter a database name'.
It dint show my created database sample but showed master, model, msdb, Reportserver, reportserverTempdb, Tempdb.
If I enter the database name, I get the following error:
"This connection cannot be tested because the specified database does not exist or is not visible to the specified user"
What could be the problem and how do I solve it? I am looking forward to solve this problem as soon as possible.
Hope you must have resolved this... otherwise I followed the following steps
Goto SQL Server Object explorer
Add the SQL server - your_pcname\SqlExpress
Add the new database
Create tables into it
Then - try to create the connection; it should show the new database created.
For someone who came here just like me, in my sql server, there was a failed restore attempt of the same database. It said XYZDatabase (Restoring...). The issue got resolved when I deleted that failed restore.
Mention the correct server name of the specific database to which you want to connect.
Open SQL Server > Right click on the database which you want to connect > properties> Click View Connection Properties (In the left side written in blue color)> There is the server name, copy that and paste it in the Connection Server Name in Visual Studio Project on which you want the data.
I hope this helps.

Best (easiest) way to make a SQL Server dump and import that dump in another SQL Server

I would like to achieve a database export (dump) in SQL Server from one server and import that dump in another SQL Server and not necessarily in the same schema name.
For example if I have a database prepared with all the data set for implement a new DB for a new customer, that db is for example named DB_EMPTY
And then I have to setup the same DB on some external server for a customer for example in the schema DB_MY_CUSTOMER
What is the best/simplest way to export (dump) a DB_EMPTY, and import it in DB_MY_CUSTOMER?
Possibly with SQL Server Management Studio?
An easy way would be to use SQL Server Management Studio, in the Object Explorer right click on the database you want to export, select Tasks -> Back Up, then select a destination and file name in the Destination box at the bottom of the dialog. You can play around with the various settings, but you don't need to.
To restore it on another server is basically the opposite, choose Tasks -> Restore -> Database, in the dialog select From Device, then click the browse ellipsis, from there you get a browse dialog, click Add and then navigate to the back up file you created. You can change the databse name in the To database textbox, and control where the files get stored by going to the Options tab and altering the Restore As column entries in the table labelled as Restore the database files as:.
Just in case someone is ending here and noticing "Tasks -> Back up" option does not exists; on recent versions of SSMS ( v18 for example ), you'll need to use "Generate scripts" option and then on "Advanced" select "Schema and Data" on "Types of data to script".
Credits to: http://statmap.co.uk/?page_id=9207
This is called replication : http://databases.about.com/od/sqlserver/ht/distribution.htm
Try to look to the snapshot replication. It is configurable to determine the destination database.

Resources