SQLcomplete doesn't update after database was added - sql-server-2008

I've started using the SQLcomplete refactoring tool for SQL Server Management Studio. It appears that every time I add a new database to my instance it doesn't update the SQLcomplete tool with the new schema for that database.
Anybody know how to get around that so it works?

Have you tried pressing Ctrl+Shift+R? This refreshes the cached schema, and can be done any time there is a schema change--which includes adding new databases.

Related

Delete "orphaned" SSIS catalog

Not sure I am referring to this correctly, but we seem to have an "orphaned" or rogue Integrated Service Catalog, SSISDB, with a database SSISDB on an azure managed instance
We were testing SSIS options a few months ago including creating it in data factory. I know that's when it was created but the Azure-SSIS integration runtime is not in the data factory that is listed in
SELECT [property_name]
,[property_value]
FROM [SSISDB].[catalog].[catalog_properties]
The data factory is there but there is no Integration Runtime or any reference to SSISDB in there.
How do we delete the catalog?
Do we have to delete the entire data factory to remove this?
Edit: I have already dropped the SSISDB database to see if it helps, it didn't so restored it. the database itself is not the problem.
Answering this so if someone else has the same issue
I renamed the database, had several errors trying to reconnect, for some reason the server tries connecting to SSISDB. But I finally got in & the catalog was gone. So though probably dropping DB might work in normal circumstances, for some reason on our Azure managed Instance dropping the db did not remove the catalog. Maybe it would have after a while, I don't know, but when I initially dropped it, the catalog didn't go anywhere for hours. and kept getting login errors for explicitly specified database 'SSISDB', I thought it broke something so I restored it.
So if dropping the database doesn't fix it, restore it, rename it wait a few minutes for SSIS catalog to drop, then drop the database.

Migrate Table Data Only from MSSQL to MySQL

Been tasked with moving a code first database from MSSQL to MySQL. After a few hours of kung fu, I was able to get the asp.net core project to properly deploy all migrations to mysql. Now I need to migrate the data inside of the existing mssql tables. I saw posts mentioning MySQL Migration Toolkit but that appears to be old. Also attempted to do so with MySQL Workbench and DBLoad's Data Loader but haven't had any luck.
Table structure is pretty simple with incremental integer keys + the usual crap with asp.net core identify framework (GUID). Just need to keep that consistent during the migration. What is the best way to migrate the data now that the table structure is setup in MySQL? Any recommendations would be greatly appreciated!
Update: Some more details...
I attempted a direct migration of the database from MSSQL to MySQL using MySQL WorkBench and DBLoader. But failed on the ASP.net Identity tables big time plus other issues. .net core api took a huge dump in multiple places so that idea is out.
From that point, I migrated the api controller over to mysql and then had to fix a myriad of issues related to mssql fks being too long and a few other issues.
So at this point, the controller works on mysql. I just need to dump all of the data into MySQL and keep the FKs consistent.
I have had a few thoughts with it such as CSV export>import and/or trying a few other things. Any recommendations?
You can use Data Export wizard built-in with SqlServer Management Studio (task -> Export Data)
or use SSIS package to migrate data.
Tried MySQL Workbench, DBLoad from DBLoad.com etc to migrate the data directly and they all failed.
So ended up finding a "solution"...
First off, I modified the ASP.net Core project with:
//services.AddDbContext<ApplicationDbContext>(options =>
// options.UseSqlServer(
// Configuration.GetConnectionString("DefaultConnection")));
services.AddDbContext<ApplicationDbContext>(options =>
options.UseMySql(
Configuration.GetConnectionString("DefaultConnection")));
Then went to Package Manager Console and ran: update-database
This created all of the tables in MySQL.
Then opened up Microsoft SQL Management Studio. Right clicked on the database Tasks > Generate Scripts. Saved everything to one file with Advanced option Schema and Data selected.
Then opened the db script in Notepad++ and applied the following edits using Replace with Extended Search Mode enabled:
GO -> blank
[dbo]. -> blank
[ -> blank
] -> blank
)\r\n -> );\r\n
\r\n' -> '
DateTime2 -> DATETIME
After edits were made in Notepad++, I removed all of the SET, ALTER and CREATE related stuff from the text file and then copied all of the insert lines into MySQL Workbench in order to ensure foreign keys were already populated before that table's data was inserted. Thank goodness there were no Stored Procedures to deal with! What a pain in the tucus!
Also on a side note, the app is hosted on Azure. Spent a couple of hours fighting the API not connecting to the database. This was not apparent at first as the app was fake throwing a 404 error to Postman. When I first attempted to wire up the API controllers to the MySQL DB, I entered the database connection string into Azure's App Service Configuration. It didn't work at all even though running the app locally worked fine. Ended up finding another post on this here site mentioning to get rid of the database connection string out of the App Service > Configuration window. Worked like a champ after that. All of the data with its auto incremented keys linked up without issue.
I am very pleased with the results and hope I never have to go through this process again! It is always a nice feeling to know an app now runs on a completely open source infrastructure. Hope this helps someone. Good luck.

How to properly setup a MYSQL database with JAVAFX intellij?

Ok so Im am still very new to javafx and intellij. I am working on a little project of my own right now and all I am trying to build is a simple calendar just like apple's version or google's. I figured this would be a good exercise for me to get to know the Intellij IDE better and JavaFX.
Here is the problem that I seem to be stuck with for a couple days now. In my application, a user has the ability to create a new event which contains many properties such as "event name", "first name", "last name" etc.. Now all the information is stored in a shall we call it "NewEvent" Node. Here lies the problem I am facing. I am trying to save the data locally on the clients computer however I am not sure how to begin. I have browsed around and I have found this thing called MYSQL that is supposed to do just that. I was hoping you guys could help me out here on how I should set this up.
Here is what I've done so far.
Downloaded MYSQL v5.7
Downloaded MYSQLWorkbench
Created a Database called "event" with all the properties contained in the Node
Somehow added the MYSQL database to intellij
Created a dialog where if the user clicks save, all the information is stored in a node.
To my understanding in order to access the data stored in the MYSQL table, shouldnt the "data file" be saved in my project folder? I have no clue where this is located. Also how would I gain access to database in order to edit it dynamically. Like adding a new row to the database.
I have looked up online with many different searches but they all seem to be using NetBeans and they are mostly outdated. I found it really hard to find information from start to finish. All I want to do is to store data locally and to access it. I expect to have a largely populated database, seeing as no one actually deletes an event once its over so what I was told is that MYSQL is capable of handling huge data. Hence my choice to go along with it.
I have done a little Android Application last summer so I am a little familiar with MYSQL, however I remember saving the data onto a table on the clients phone.
MySQL isn't an embedded database. Only the libmysqld is embeddable.
You can integrate JavaFx application with any database. HSQLDB or H2 would be more appropriate, since they do not need an installation on the client machine, and can be configured to save the data file on any location.

How to migrate production data with collapsed rails migrations

What would be potential strategies to getting the old data into a new db structure? One strategy we are thinking of is to write some ruby which executes some sql on a per table basis.
Since this is a one time task(I am preconceiving things here), you might want to have two databases, one old and one created new, from fresh migration. And write a ruby script to copy data as you want from old to new database.
It will help retain the old database and hence the downtime associated with creating new db and reimporting data from dump. You can use your old code until data is migrated and as soon as data migration to new db completes, update the code and restart the server. Voila! whole lot of data migration with no down time! :)
To summarize what I am suggesting:
Keep the old database around, don't recreate and reimport to it
Craete a new databse from fresh migration
create and run the ruby script to copy data from old database to new one
update the application code, which works with new databse
restart the server for new database to kick in

LINQtoSQL Not saving to database,but changes show in app

Hey all, I have a linq app using C# express2008 and sqlserver express 2005 (mdf file connection)
I followed the regular dml generation and vanilla datacontext. However i created a repository class to manage the Linq stuff.
In using the functions, selecting data works fine, updating data works in the app.But when i check the data in the tables, nothing has changed.Needless to say, when i close the app, also no change.
I used SQL profiler to see what was being sent to sqlserver express, nothing showed up.
What could be my issues?
Are you calling SubmitChanges() on the DataContext?
No primary key, or no column(s) in the L2S model marked as primary key member(s)..?
Ok... found 'a' soln.
1. changed (forced) default connection string from looking at a file to an instance of sql serverĀ (using database instead of file)
2. Attached file to sql server express..and renamed the db.
Ran app again and everything works. Only thing is..the dml still uses the old connection string..so any mods to tables have to be done in sqlserver.
This is just my quicky patch, anyone care to provide a more elaborate view?