I did Migration process and I didn't get error but I am missing my database and table in sql. VS not transferring the data to sql - database-migration

Hi I am the beginner developer, I am trying to send my data to sql from VS and I did Migration process. in packing manager console I wrote enable-migration and now I got configuration file also and after than I changed the value from false to true and wrote update-database I am not getting error its just says
PM> update-database
Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
No pending explicit migrations.
Running Seed method.
and when I checked sql there is no my database also any tables
I am trying to make travel website and there are some page exist and I got some models files of them and I guess I need to create connection between sql and vs I had the code in vstudio but when I try to create database and tables with my datas in studio, its not happening

Related

Importing to SQL Mysql instance

I'm importing data from Storage to SQL GCP (MySql datacloud). When I select the .sql file and the database there is an error message: Sorry, there’s a problem. If you entered information, check it and try again. Otherwise, the problem might clear up on its own, so check back later.
I'm trying using only one catalog table and I have the same mistake. Could you help me? please
Have you created the database before?
It seems that the problem might be with the sql file, that file is a sql dump?
The normal process for migrating to CloudSQL would be:
Create the instance, if your source will be (MySQL) you need to select MySQL.
Create database
Select the database, IMPORT
Select from sql file, and select the file
You need to have permissions for creating an instance and database.
Are you able to input correct parameters like (correct GCS path, valid file, correct database name and table)? Please note that for compressed (.gz file) and sql (dump) file, SQL format should be selected instead of CSV.

Auto Create statistics in Azure SQL DW

In Azure SQL Datawarehouse i just used the below tsql code to enable auto statistics creation.The command ran successfully , but when i checked in database properties under option tab Auto Create Statistics is till set to False.
ALTER DATABASE MyDB SET AUTO_CREATE_STATISTICS ON;
Please let me know if i'm missing here something. I have the db_owner access for the database also.
I'm guessing that you are using SQL Server Management Studio.
I was able to reproduce the symptom by turning off and on auto_create_statistics.
The issue appears to be that the database metadata is cached in SSMS. Right-click the database name and select "Refresh" before selecting "Properties". Using this method I got the correct setting for auto_create_statistics showing up each time.
My tests were done using SSMS 17.7
(The need to refresh the database metadata can also occur when adding or removing tables, columns, etc)
You can also query sys.databases, the is_auto_create_stats_on column.

Given a DB Instance how can I add SQL code into my database?

I just started using AWS and created a DB Instance. I expected a option to modify its contents/structures of the sql tables but couldn't find anything
If it was SQL Server, you would uses SQL Server Management Studio to attach to the database and modify it just like you would locally - for MySQL you would need to use the equivalent UI Tool and attach to the DB and do the same.

Django switch from sqlite3 to Postgresql issues

I've recently changed the database server on my project from sqlite3 to Postgresql and I have a few questions that I hope will give an answer to my issues.
I understand that switching from sqlite to Postgres implies that I create the new database and the tables inside it, right? I've done that but I haven't seen any new files created in my project to show me that the database I've made is visible. (Btw, I've changed the database name in settings.py)
I probably should mention that I'm working in a virtual environment and I would like to know if that affects my references in any way. I've tried to import the tables in Django to try and count the number of records in a table but I get the error: "No module named psdemo". (psdemo is my database name and i'm trying to import the table with:
from ps.psdemo import Product
where ps is my application, psdemo is my database and Product the table in the database.
In conclusion I'm trying to get access to my database and tables but I can't manage to find them. I repeat, there is no new database file in my project or in my virtual environment (I've searched thoroughly) but if I use a terminal connection I can connect to my virtual environment and change directories to get to the application folder then if I connect to the Postgresql server I can create the database, the tables and can Insert into them, make queries etc, but I cannot access them from the Django code.
I understand that switching from sqlite to Postgres implies that I create the new database and the tables inside it, right? I've done that but I haven't seen any new files created in my project to show me that the database I've made is visible. (Btw, I've changed the database name in settings.py)
All you have to do with postgres is create the database. Not the tables. Django will create the tables, and anything else it thinks are useful, once you call syncdb.
You won't have any new files in your project like you did in sqlite. If you want to view your database, you should download and install pgadminIII (which I would recommend in any event)
I probably should mention that I'm working in a virtual environment and I would like to know if that affects my references in any way. I've tried to import the tables in Django to try and count the number of records in a table but I get the error: "No module named psdemo". (psdemo is my database name and i'm trying to import the table with:
Here, you import models via normal python syntax and it then references your tables. Each model should represent a single table. You define your models first, and then call
python manage.py syncdb
In conclusion I'm trying to get access to my database and tables but I can't manage to find them.
See above, but you should definitely read about postgres installation from the postgres docs, and read the psycopg2 docs as well as the Django docs for setting up a postgres database.
I understand that switching from sqlite to Postgres implies that I
create the new database and the tables inside it, right? I've done
that but I haven't seen any new files created in my project to show me
that the database I've made is visible. (Btw, I've changed the
database name in settings.py)
Database files are not created in the project directory with postgresql. They are created in the database server data directory (like /var/lib/postgres it depends on the distribution). You should generally query it through a PostgreSQL client that connects to the PostgreSQL server rather than messing with the files directly.
You can for example run command:
manage.py dbshell
As to your first issue, see #jpic's answer.
On your second issue, your database is not a package, and you do not import models from your database. If you were able to import your models correctly before you made any changes, change your import statements back to how they were.

How can I install a shared data source with no credentials in SSRS

I'm using SQL Server 2005 with Reporting Services. I have many reports installed, some using shared data sources and some not; some go to web services, some to sql server databases, and now I'm trying to connect to a DB2 database.
I have successfully created a shared data source and report in Visual Studio 2005. I can pull data just fine and display it on my report in the designer. I am now trying to install the report and datasource through the ssrs web service (the same way I have for all other reports).
The problem is that most of our data sources use Integrated Security, and for this data source I am using 'Credentials are not required' since they are listed in the connection string. Here's my install code:
Dim definition As New ServiceProxy.DataSourceDefinition
definition.ConnectString = connectionStringIncludingUsernameAndPassword
definition.Extension = "OLEDB"
definition.CredentialRetrieval = ServiceProxy.CredentialRetrievalEnum.None
ServiceWebService.CreateDataSource(dataSourceName, containingFolderFromRoot, True, definition, Nothing)
This also works fine and gives no errors, and appears to create the datasource properly in ssrs. But when I go to run the report I get this error:
The current action cannot be completed
because the user data source
credentials that are required to
execute this report are not stored in
the report server database.
(rsInvalidDataSourceCredentialSetting)
My report is properly connected to my data source, and my data source is properly set to credentials not required, so it is all the same as it is inside Visual Studio. I'm out of ideas.
The problem was several fold:
the user name and password were listed in the connection string instead of inside the server
the db2 connect software installed on the report server was out of date (8 instead of 9)
the user group 'DB2Users' did not have any members
After correcting these problems, the report works!