Is it possible to write t-sql script to show all changes made to the database rows recently? - tsql

I'm learning a new product of my company and the database is huge.
What I'm doing is to learn feature by feature and through that to understand the codes and the associated database's data/functions/ect.
What I need: To see the change-set made to the database/data-rows recently, e.g. after I create a new user account, I want to see what are the new rows updated/created after I do that.
Is it possible? Please share if it is. Thank you!
Nam.

I would set up a trace with the SQL Server Profiler. In the trace you can see what the client does when you create a new user.

Related

Is there a way to show previous query results in SQL Developer?

I ran a few queries in SQL Developer and closed the query result panel after i looked through the data. I have then deleted the data but now im trying to see if I can find/view the data i viewed somehow?
is there a way to find the data i viewed?
No, as far as I know, SQL Developer has no feature that saves results of previous queries.
Once you close them, they are 'gone.'
But, you can setup SQLDev not to close the results as you execute new queries. Benefit, you have to explicitly close the panel before you 'lose' the results.
Warning: Close these tabs as you can. They tie up potentially both CLIENT and SERVER side resources.
Disclaimer: I work for Oracle and am the product manager for SQL Developer.

Facing problems while moving workbooks between solution environment (Development, Production etc. ) in Tableau Server?

I am working on Tableau Server where I have say, three solution environments viz. Development Staging and Production.
I have created workbooks in Development environment and each workbook use many data sources.
For instance lets say I created the workbook Account Workbook and I have used these two data sources Dev-DataSource1 and Dev-DataSource2. I have other data sources available like Stage-DataSource1, Stage-DataSource2, Dev-DataSource3, Stage-DataSource3 etc.
The problem I am facing is while moving workbooks from Development to Staging environment, the data sources remains the same.
So continuing with the same instance if I move Account Workbook to Staging from Development environment, Account Workbook still uses the same data sources Dev-DataSource1 and Dev-DataSource2. I want it to use the Stage-DataSource1 and Stage-DataSource2 .
This might be a very trivial question or maybe a bad design, but I have created so many workbooks such that creating them again might take loads of time, so please refrain from asking me to recreate those workbooks again. If there is no other way other than that then do tell me.
Thanks in advance
Can you not just edit the data sources, for instance from Dev-DataSource1 to Stage-DataSource1?
I assume they have the exact same structures, field names, etc?
Right click on the data source and click "Edit". When in the data source page, pull in table(s) from
the new datasource and replace the one(s) that are there. If you have joins you may need to recreate them. If you have custom sql you just need to change your sql to point to the new table(s).
You will need to refresh your data sources. It should recognize the fields assuming they are exactly the same as before.
If you need to edit the connection, you can do that as well (if you need to point to a different server, etc.)
Make sure you have a backup of your workbook in case something goes wrong.
It may also be worth your time to look into the Tableau Python document API: https://github.com/tableau/document-api-python
This would allow you to do (some/all?) of what are describing programmatically.

Tableau extracts update

I would like to know if there's a way to automatically update my extracts?
I have a live connection with redshift and use tableau desktop and publish some workbooks on tableau online.
I like to share some reports using extracts and tableau reader and I really need a way to update the extracts everyday
if I understand your question correctly, you should be able to refresh your Tableau Data Extracts by setting up "Refresh Schedules" on Tableau Online. Tableau Online supports variety of Data Sources to set up Extracts instead of using Live Connection.
Check this link on setting up refresh schedules.
Hope this helps!
Yes, you can do set refresh schedule that will help you to update your extract automatically without any manual effort but there are some terms & conditions you have to follow:
For this you have to set your dashboards/workbooks/project in "Extract" mode & not in LIVE.
I personally recommend "extracts" instead of LIVE until the person who is looking for this need REAL TIME updates
Also, you need to set this schedule from Admin's ID (Publisher access) which you use to publish your work from Desktop to Online
Note: You only can choose from lot of options already available
enter image description here

Assign New Leads of Existing Accounts to Account Owner

Salesforce - Apex Trigger for New Leads for Existing Accounts. How?
Hello,
I would like to write an Apex Trigger to check if a new lead's COMPANY or NAME already exists as an ACCOUNT, and therefore assign the new lead to the proper ACCOUNT OWNER.
Is there a formula that anyone can provide me to make this happen?
It would be great if the formula would look for CONTAINS "ACCOUNT NAME" rather than a direct match, for cases where a new lead submits their company name in a format slightly different than our existing ACCOUNT NAME.
Thank you greatly for your help.
I don't think this can be done with just a formula. You will need a trigger, preferably one that calls an apex class to do the work. The class will have to be without sharing if you want to reassign the owner id. You'll have to query account for this.
I don't know if anyone is still following this thread, but a client recently asked me for something similar. The client wanted new Leads to be assigned to the same Owner as an existing Contact with a matching email address. Standard Salesforce Lead Assignment Rules didn't support this, so I implemented it using Process Builder and Visual Workflow. There was no need to write Apex code.
It was straightforward and reasonably quick to do, so I put together a blog post outlining the steps. Hopefully someone will find this useful in future.
https://alearningdiary.com/2017/11/12/assign-a-lead-in-salesforce-based-on-existing-contact-owner/
Brian

Externalizing a datasource for creating content to be used on ios app

I hope that my title is descriptive enough. I am planning on creating a directory application for my town however I would like to to be a fully offline experience.
The idea would be to offer businesses a yearly subscription for listing their business in the directory.
My concept would be to create a web interface where they can pay for their subs and then enter all of the information into a their profile listing that would then be saved into a sql db.
I am wondering if it is then possible to take this sql database and then use it in the application by saving it into the application directory some how.
Basically my question is how could I do something like this? what is the best way to get them to enter their own information then me somehow build that database into the application?
Its not certain that I will even end up doing this but I am just really intrested in how to generate my own content for application like this that I can then use strictly offline.
Any help would be greatly appreciated
In my opinion , need to create some web application that provide information each specific client and client need to sync some update information with server and do caching.
If there is no need to update , use your cache . and If there are something to update . try to decide what is need to update and show them.
hope it helps you