When clicked the 'View -> SQL History' in the Oracle SQL Developer, there will be a small flat window popped up and placed at the end of the whole window. And in this flat window, all my recent queries that have been executed are displayed there. How can I delete these SQL history records in this flat window? Thanks in advance.
I have just observed that there is a clear history button available which can be used to either delete specific query by selecting one or all by selecting all using ctrl+A.
P.S. I didn't try to delete or validate it as I want to keep my history.
Each "history query" is saved as an XML file. It is located (on MS Windows) in a (hidden - set the Explorer to view hidden files!) folder whose name is e.g.
C:\Users\littlefoot\AppData\Roaming\SQL Developer\SqlHistory
Go in there and delete its contents.
I need to change the destination of an SSRS report in Visual Studio 2010 so that when I deploy it, it goes to the correct folder. There appear to be about 6 or 10 places where I can change options, I just cannot seem to find the right place to change these deployment options.
On this particular report, there are two subreports. I would like to deploy these two reports to a separate (subfolder) under the folder which contains the main report. I assume that the changes I make in #1 are for SSRS, not for a particular report (is that correct). If so, I will need to change the path for those subreports as well.
Once I have the reports deployed to the correct folders, how do I change the path to these subreports in the Visual Studio report designer? Right now, the reports render properly in the report designer, but when I go to the report server and run the main report, the subreports do not render properly.
I expect this report, along with its sub-reports to render properly from the report server.
You can only change the deployment path in the project properties, so this affects all reports. I did try to setup a similar scenario to what you want bit to be honest it was more trouble than it was worth.
What I ended up doing was having all subreport names start with an underscore and then running a quick bit of t-sql to hide them. I don't have access to the server now but the t-sql is something like
USE ReportServer
UPDATE dbo.Catalog SET Hidden = 1 WHERE LEFT(Name, 1) = '_'
The other way you can do this is to dump all the reports in the same folder but don't give users access to it. Then Create a new folder and add linked reports in there that point back to the original versions, you can do this using the Web Portal (report manage in older versions). It's a pain as you have to do each report individually. You could probably write a script to create the catalog items for you but I've not tried that so can't comment on how easy that would be.
So, saving the subreports to a different folder was straight forward, once I figured out where the project properties were located. Once I deployed those to subreports, all I had to do was change the path to those subreports in the design view of the main report.
Right click on the sub-report, select subreport properties and enter the full path to the sub-report.
I am using a SQL Database project in Visual Studio 2010 to create a database from existing DDL files that we use in our solution. All of the DDL files are stored in our source control for example in the Project\DB\DDL folder. When I add these files to my SQL Database project by right clicking the tables folder and selecting the 'Add -> Existing Item' option it copies all of the files to the project directory structure (\SqlDbProject\Schema Objects\Schemas\dbo\Tables).
What I would like to do is link to the 'real' source file so that if another developer changes that source file I can pick it up in my SQL Database project and build the DB from the current table definition. Is there an option to do that or does the SQL database project always copy the file over to it's directory structure?
As a side note what I would also really like to be able to do is detect error's in the DB creation process when something was put into a DDL incorrectly and halt the automated build process and report the error. Thanks in advance!
You will notice, when you add the file, that the Add button has a dropdown option; select Add as Link.
I am using advanced version of Visual Studio 2010 and using database projects. There's a feature of exporting database schema as partial project (which creates *.files output file), but it is triggered manually by the developer (you need to right-click on the project and select Export as partial project). I would like to automatize this process, meaning that the output file is created each time I modify the database, I build it OR I close the solution.
I tried creating a macro, which executes a DTE command Project.VSDBExportAsPartialProject, but sometimes it fails with an exception AND it shows a Save as dialog box, which I would like to avoid. Maybe the idea is to add it to the post-build event, but I don't know how to execute DTE commands from there.
To sum up, all I need is to automatically refresh the *.files output file located in fixed path without any user interactions.
Is it possible?
How do I update a Linq to SQL .dbml file?
There are three ways to keep the model in sync.
Delete the modified tables from the designer, and drag them back onto the designer surface from the Database Explorer. I have found that, for this to work reliably, you have to:
a. Refresh the database schema in the Database Explorer (right-click, refresh)
b. Save the designer after deleting the tables
c. Save again after dragging the tables back.
Note though that if you have modified any properties (for instance, turning off the child property of an association), this will obviously lose those modifications — you'll have to make them again.
Use SQLMetal to regenerate the schema from your database. I have seen a number of blog posts that show how to script this.
Make changes directly in the Properties pane of the DBML. This works for simple changes, like allowing nulls on a field.
The DBML designer is not installed by default in Visual Studio 2015, 2017 or 2019. You will have to close VS, start the VS installer and modify your installation. The LINQ to SQL tools is the feature you must install. For VS 2017/2019, you can find it under Individual Components > Code Tools.
To update a table in your .dbml-diagram with, for example, added columns, do this:
Update your SQL Server Explorer window.
Drag the "new" version of your table into the .dbml-diagram (report1 in the picture below).
Mark the added columns in the new version of the table, press Ctrl+C to copy the added columns.
Click the "old" version of your table and press Ctrl+V to paste the added columns into the already present version of the table.
Delete the dragged table from step 2 and save the .dbml file.
You could also check out the PLINQO set of code generation templates, based on CodeSmith, which allow you to do a lot of neat things for and with Linq-to-SQL:
generate one file per class (instead of a single, huge file)
update your model as needed
many more features
Check out the PLINQO site at http://www.plinqo.com and have a look at the intro videos.
The second tool I know of are the Huagati DBML/EDMX tools, which allow update of DBML (Linq-to-SQL) and EDMX (Entity Framework) mapping files, and more (like naming conventions etc.).
Marc
We use a custom written T4 template that dynamically queries the information_schema model for each table in all of our .DBML files, and then overwrites parts of the .DBML file with fresh schema info from the database. I highly recommend implementing a solution like this - it has saved me oodles of time, and unlike deleting and re-adding your tables to your model you get to keep your associations. With this solution, you'll get compile-time errors when your schema changes. You want to make sure that you're using a version control system though, because diffing is really handy. This is a great solution that works well if you're developing with a DB schema first approach. Of course, I can't share my company's code so you're on your own for writing this yourself. But if you know some Linq-to-XML and can go to school on this project, you can get to where you want to be.
I would recommend using the visual designer built into VS2008, as updating the dbml also updates the code that is generated for you. Modifying the dbml outside of the visual designer would result in the underlying code being out of sync.
There is a nuance to updating tables then updating the DBML... Foreign key relationships are not immediately always brought over if changes are made to existing tables. The work around is to do a build of the project and then re-add the tables again. I reported this to MS and its being fixed for VS2010.
DBML display does not show new foreign key constraints
Note that the instructions given in the main answer are not clear. To update the table
Open up the dbml design surface
Select all tables with Right->Click->Select All or CTRLa
CTRLx (Cut)
CTRLv (Paste)
Save and rebuild solution.
In the case of stored procedure update, you should delete it from the .dbml file and reinsert it again. But if the stored procedure have two paths (ex: if something; display some columns; else display some other columns), make sure the two paths have the same columns aliases!!! Otherwise only the first path columns will exist.
Here is the complete step-by-step method that worked for me in order to update the LINQ to SQL dbml and associated files to include a new column that I added to one of the database tables.
You need to make the changes to your design surface as suggested by other above; however, you need to do some extra steps. These are the complete steps:
Drag your updated table from Server Explorer onto the design surface
Copy the new column from this "new" table to the "old" table (see M463 answer for details on this step)
Delete the "new" table that you just dragged over
Click and highlight the stored procedure, then delete it
Drag the new stored procedure and drop into place.
Delete the .designer.vb file in the code-behind of the .dbml
(if you do not delete this, your code-behind containing the schema will
not update even if you rebuild and the new table field will not be included)
Clean and Rebuild the solution (this will rebuild the .designer.vb file to include all the new changes!).
Use Visual Studio 2019 open DBML files in graphic designer to update DBML files.
when not working:https://developercommunity.visualstudio.com/t/dbml-files-not-opening-in-graphic-designer-in-vs-2/1659675
Just for the record