I’m new to MVC and am building a project in ASP.NET MVC.
In my project I don’t want to delete any saved data from my database, but hide them from the user. I look some giving status to data, but I don’t understand. What is the explanation?
I can explain a common way to do it. This is a quick answer using SQL Server.
Please study SQL first before starting your project. Here is a good place to learn SQL.
I assume the table name is "MyItems":
Add another column to your table
Name it as IsActive (or whatever you want)
Set the data type as bit
You can set either true or false for this column
Write your SQL select query as:
Select * from MyItems where IsActive=1
This will give you all IsActive=true records.
If you want to get hidden records:
Select * from MyItems where IsActive=0
I'm new to SQL queries and need to build a custom report in Microsoft SQL Report Builder 3.0. The data source is a SCCM database. I need help with understanding the best approach to achieve the following:
We need to cross reference if a computer exist in two Views, if so show that name in the report.
InputParameter1 = "Please select a View"
InputParameter2 = "Cross reference with this other View"
If I know the names of the Views beforehand I have a query to get what I need from the SQL server, but I need to create a parameter-based report where you select two Views dynamically and the report cross reference them for you and present which computers exists in both Views.
This is the query I can use for a static result. v_CM_RES_COLL_CMS0020B and v_CM_RES_COLL_CMS000D1 are examples of names of possible Views, until I can solve the parameter issue in Report Builder:
SELECT v_GS_SYSTEM.Name0
FROM v_GS_SYSTEM
WHERE Name0 IN
(SELECT Name from v_CM_RES_COLL_CMS0020B)
AND Name0 IN
(SELECT Name from v_CM_RES_COLL_CMS000D1)
I don't know how to proceed in how to make the above query into a parameter report in Report Builder. Somehow I need to change v_M_RES_COL_CMS00### to what ever the user inputs to the parameters. Does anyone know how? Any help is greatly appreciated.
I've created all courses in moodle and I've uploaded scorms in hidden status.
How do I do to show all scorms from database?
Thanks!
Edit: I want do it in database, because i want do a massive update
If you just want to see the list of Scorm-type activities in the database, you can use the following query:
SELECT * FROM mdl_scorm;
I have a requirement to script all database objects with a specific string in object's Name, Could not find any code snippet to script database objects with search function.
SSMS does not allow for search.
Click on the database name, then select Task, then select Generate Scipts, then Next, select that you want all object scripts or select the objects that you want, then decide where do you want to get the results (in the Advanced tab you can select that you want to have an all data from the database), then Next and Next.
You will have an option to select the object name that you want to have.
Edit: of course if you want to have a dynamic option for solve your problems it's possible, but more complex.
You can get all of your objects with this query:
SELECT *
FROM [Your database name].sys.all_objects
Of course if you want to have just the objects with specific name you can add a "where" statement to get what you need
Than you should write a scripts to get a definitione of each object type. For example in the case of stored procedurę it's quite simple:
sp_helptext [your_stored_procedure_text]
If you want to get the create table script you will need more complex query, but you can find tchem in the net.
Hope this is helpful for you
Does anyone have any idea how to retrieve deleted records data from Apex data loader or otherwise from Salesforce except from the Web service?
Check the documentation: https://na7.salesforce.com/help/doc/en/salesforce_data_loader.pdf
If using the GUI version v20 or above, you'll have the Export All button.
From the Command Line version, the process-config.xml file should have the process.operation attribute value set equal to "extract_all" (the documentation states "Extract All" but that doesn't work).
Using either of these above options will extract soft deleted records, and will allow you to filter on IsDeleted = true or false. (You can include this filter regardless, but without using the above options, IsDeleted=true will always return zero records).
Hope that helps.
P.S. In Apex, it's slightly different. Your SOQL query will be [Select Id from Account where IsDeleted=false all rows] The 'all rows' appendage is the Apex equivalent of 'extract all'.
In Dataloader, use the EXPORT ALL button, not the EXPORT button
This gives you access to deleted & archived records.
You can't. The only way to get deleted records through the API is to use queryAll, and DataLoader doesn't use queryAll ever.
(Sorry for the resurrection here.)
Roll them back with a few lines of Apex code in the System Log. For instance:
Account[] a = [select id from Account where isDeleted=true ALL ROWS];
undelete a;
system.debug(a);
This should work as long as you didn't use emptyRecycleBin() (which will still return query results, but won't allow undelete as the records would now be marked for physical deletion). Take a few of the ids from the USER_DEBUG results for a to confirm that it worked.
Try extract, extract_all, hard_delete.
I hope it's not to late.
There are three ways to do it.
Recycle bin. In recycle bin change the option to all recycle bin. It is like soft delete we can get the record. If you didn't get your record from recycle bin
Workbench. In workbench select soql query and your required object and create a query like this example.
SELECT Id,Name,AccountId,Isdeleted,CreatedDate,StageName
FROM Opportunity where isdeleted =true
in this section we didn't get the record we know the information of the opportunity record.
Dataloader. It also works like workbench and you can retrive the information of the record. Select exportall option and select the required fields and put a filter like is deleted is true.