Does original database change in knime - database

When using the database manipulation nodes, does the original database data would change or remain the same?
Can anyone answer please?

If you write to or update the database, the original database will be updated. Read or query operations such as row / column filtering, row sampling, groupby and joiner do not change the underlying database

Related

Modify snowflake database by fill in value from Alteryx

There are some records that are missing values. I would like to modify/fill-in data into snowflake from Alteryx. I would like to modify many records at once.
What is the best way to modify snowflake database from Alteryx:
deleting specific rows and append modified data?
modifying data using sql statement in Alteryx output tool?
clone original table --> create modified table --> replace table?
any other ways?
Sincerely,
knozawa
Use an UPDATE statement in Snowflake. There is no benefit to the other methods that you've suggested. When you run an UPDATE in Snowflake, it is recreating the micro-partitions that those records are contained in regardless. Your other methods would be doing that same operation, but more than once. Stick with UPDATE.

MSSQL Injection extracting column data from another database

I setup a test-bed application vulnerable to mssql injection and i wondered, how do i extract column data from another database? To extract column data from current database we do:
convert(int,(select columnnamegoeshere from tablenamegoeshere))--
and then to enumerate the other column data we do:
convert(int,(select columnnamegoeshere from tablenamegoeshere where columnnamegoeshere not in ('firstentryfromcolumn')))--
But if it's not inside the default database and we want to extract column data from another database, how do we do that? Thanks.
I would do a join... but, to keep it simple for you, here's your code using a different database column:
convert(int,(select columnnamegoeshere from tablenamegoeshere where columnnamegoeshere not in (select top 1 firstentryfromcolumn from otherdb.dbo.otherdbtable)))
It would be better to join the 2 tables together and exclude the records if that's possible... subqueries are usually slower and not the best way to go about it.

How to fetch last added or edited records from SQL Server database?

Currently I'm working on database migration, for this I'm using Pentaho Kettle and Perl scripts.
The migration is from Tumor-registry SQL Server database to CIDER IBM DB2 database.
In this task I want to achieve two objective.
Initial migration: in this I'm migrating all the rows (e.g. 100000) from Tumor-registry (SQL Server) to CIDER (IBM DB2).
Subsequent migration: the Tumor-registry SQL Server database is constantly updating on and off.
It's constantly adding new rows or edits already existing rows.
I have figured out the first step but facing two problems in second step.
a) If Tumor-registry SQL Server database is updated with for example new 10 rows; how can I get those new 10 rows?
b) If already existing 10 rows are updated then how can I get those 10 rows and also want to know which columns are updated.
My Tumor-registry database contain approximately 50 tables.
Any help is greatly appreciated.
Create a new column with TIMESTAMP datatype.This will keep track of the latest edited records in the table.
OR
You can use CHECKSUM function in Sql server.
i think that will provide u a solution by using triger
create triger trigername on tablename
after insert
as
declare #variablename_1 datatype;
select #variablename_1 = column_name from inserted ;
if you want save data in anohter table that last inserted then create an other table
insert into tablename values (#variablename_1);
You could use IBM Change Data Capture, it will take all the DDL and DML in the source database, and replicate them appropiately in the target database.
http://www-01.ibm.com/software/data/infosphere/change-data-capture/
It seems that there are other solutions from other vendors, take a look at: http://en.wikipedia.org/wiki/Change_data_capture

Recommended way of adding daily data to database

I receive new data files every day. Right now, I'm building the database with all the required tables to import the data and perform the required calculations.
Should I just append each new day's data to my current tables? Each file contains a date column, which would allow for a "WHERE" query in the future if I need to analyze data for one particular day. Or should I be creating a new set of tables for every day?
I'm new to database design (coming from Excel). I will be using SQL Server for this.
Assuming that the structure of the data being received is the same, you should only need one set of tables rather than creating new tables each day.
I'd recommend storing the value of the date column from your incoming data in your database, and also having a 'CreateDate' column in your tables, with a default value of 'GetDate()' so that it automatically gets populated with the current date when the row is inserted.
You may also want to have another column to store the data filename that the row was imported from, but if you're already storing the value of the date column and the date that the row was inserted, this shouldn't really be necessary.
In the past, when doing this type of activity using a custom data loader application, I've also found it useful to create log files to log success/error/warning messages, including some type of unique key of the source data and target database - ie. if coming from an Excel file and going into a database column, you could store the row index from Excel and the primary key of the inserted row. This helps tracking down any problems later on.
You might want to consider having a look at SSIS (SqlServer Integration Services). It's the SqlServer tool for doing ETL activities.
yes, append each day's data to the tables; 1 set of tables for all data.
yes, use a date column to identify the day that the data was loaded.
maybe have another table with a date column and a clob column. The date to contain the load date and the clob to contain the file that you imported.
Good question. You most definitely should have a single set of tables and append the data daily. Consider this: if you create a new set of tables each day, what would, say, a monthly report query look like? A quarterly report query? It would be a mess, with UNIONs and JOINs all over the place.
A single set of tables with a WHERE clause makes the querying and reporting manageable.
You might do a little reading on relational database theory. Wikipedia is a good place to start. The basics are pretty straightforward if you have the knack for it.
I would have the data load into a stage table regardless and append to the main tables after. Once a week i would then refresh all data in the main table to ensure that the data remains correct as per the source.
Marcus

database column check PK and overwrite another column

I have a sql server 2008 database, the code (now corrected) has accidently overwrite one column with wrong data about 50,000 rows
The rows might have changed since the backup, but the primary key is intact now I have two database one with correct data in one column and one with incorrect data.
Can anyone help with a script to recover this columns data.
You could use an update statement to copy data from the restored database:
update wrong
set WrongColumn = [right].WrongColumn
from ProductionDb.dbo.Table1 as wrong
join RestoredDb.dbo.Table1 as [right]
on [right].PrimaryKeyCol = wrong.PrimaryKeyCol
Use tablediff that will generate a script for you:
http://msdn.microsoft.com/en-us/library/ms162843.aspx

Resources