Retrieve records from table without timestamp column in SQL Server - sql

I am using AWS RDS SQL Server as my DB. I have a few tables without a timestamp column and need to query those tables for data inserted within the last hour or so. I can't add extra columns, create trigger or change source in any way. Change Tracking (CT) feature of SQL server seems the way to go but I wanted to know is there any other way.

Related

How can I get the modified table name(any table in db) and it's modified value without using triggers in SQL Server?

I am creating database snapshot for reporting(creating a common demoralized table from normalized tables), for which I need to enter normalized tables modified values at the same time when the table modify. I want a common solution for this. Same is achievable using triggers but I am looking for some other generic solution which will work with any table change. Is there any other way in SQL server by which I can achieve the same?

SQL Server tracking changes in data coming from Oracle link

I have a SQL Server table that I create by selecting from an Oracle view using a database link. The Oracle database is fully wrapped and comes from an external vendor.
The table has a text field for the current month's update. It doesn't have any dates or IDs. When I run the procedure to get the data I don't have any idea if the value has been the same for the last few months or had been updated, I have no idea when it was updated. I thought of going through the query row by row and detecting if the value is there and if it isn't, insert a new row with a creation date. This will provide a monthly row with any updates, keeping the older updates linked to the correct date. Maybe. I'm no expert and couldn't think of a way. Would this break? How would you solve my problem?
I don't have DBA rights in any databases.

Best way for block SQL table records in SQL Server

I have SQL Table in SQL Server like this:
In this table there are old records (Last year).
I should use this table again.But old records to be blocked (No operation taken on them (Select,Update, Delete)).
I can't modify design table and add another field like locked or date or add new table for handle operations.
Is this possible in SQL Server?
It would be very helpful if someone could explain best solution for this problem.
Thanks.

Periodically store data from a PostgreSQL table to SQL Server 2005 table (with the same schema)

I have a PostgreSQL database that stores real-time data from sensors in a specific table (every 30sec).
What I want to do, is to get periodically the data from the remote PostgreSQL database (for instance every 30sec) and store them in SQL Server 2005 to manipulate them locally. I don't care about having the two databases with duplicate tables. Actually this is what I want to achieve!
So far, I have as Linked Server the PostgreSQL to SQL Server and I can query and retrieve the sensor data. However, I prefer to store them in my SQL Server for performance reasons.
Solution so far:
Make select openquery statements with the linked PostgreSQL and insert the results to my table in SQL Server. Repeat this periodically and store fresh data only (e.g. with a larger timestamp).
I assume that my proposed solution is not ideal. I want to know what are the best practices to achieve this synchronization between the two databases.
Thank you in advance!
If you don't want to write your own code(implementations) to do that you can use SymmetricDS to synch the table from postgreSQL to MSSQL .

Delete column in SQL Server after a period from creation

I am working with sensitive/private files stored in SQL Server as VarBinary(MAX). Is there a way to tell the database or nHibernate to nullify the column after a period of time after its creation.
Make sure to put a timestamp column on the table, then set up a SQL Scheduled Job with a query to delete those rows periodically based on that time.
Absolutely not
Imagine the fun when SQL Server decides to change data apparently on it's own because the code monkey fluffed setting up whatever mechanism would be used...
You could (off top of my head):
Encrypt the columns
Schedule a clean up (SQL Agent job, a config table)
Don't use SQL Server for the files themselves, just store paths/links