Using the schema compare tool in TFS 2012, it pulls a bunch of SQL objects that says need to be added to the source control project, but they already exist in the source control project with the same name, everything is identical to what it says needs to be added. If I select Add to the item, it wants to add the item with an _1 on the end. How do I get it to recognize that the item already exists and doesn't need to be re-added?
UPDATE: I noticed that, while the objects were listed in Source Control explorer and were in my local Work space, they were not listed in the project in Solution Explorer. I was able to right click the object type I need and Add Existing to add the objects that were in source control that were not listed in Solution Explorer. An arduous process. I still have no idea how the objects in the project can get out of sync with what is in the solution.
Related
When I publish Visual Studio database project targeting SQL Server 2012 it generates script containing drop views and functions statements and then creating these views and functions, although there are no changes in these views and functions in DB project at all comparing to database. How can I disable this behavior?
I would like to have publish output equal to what I get when I generate script after schema compare (project to database), so only affect objects for which there are changes.
Are you absolutely sure that there are no differences? Even a difference in the "NOT FOR REPLICATION" options can cause issues. Do a compare of the live database against your project and see what is different (Tools - SQL - Compare Schema). If there are differences, fix them. Otherwise, you shouldn't be seeing anything to actually change. As Keith noted, check to make sure you don't have the "always re-create" option enabled. That could be giving you trouble, though it doesn't usually drop individual items, but the entire database. You may also want to check collations - if those are different you could have issues.
Make sure the "Always re-create database" option is unchecked in the Advanced publish settings.
Finding the reason for why SSDT thought the scheme was different I think is the first point of call. SQL Scheme compare is your friend here. (In VS under Tools => SQL => New Scheme Comparison...)
Computed column definitions and constraint definitions were definitely candidates, as was potentially column ordering. Ironically I did have one issue with a computed column but it was not the definition, it was the fact that I didn't add NOT NULL to the end of the column definition (which is the default of course) but SSDT saw that as different everytime.
I used this blog post as a basis for creating my SQLite tables.
Using the SQL Server Compact/SQLite Toolbox, I can view the created tables nicely.
However, in order to first create the connection in that tool, I had to locate the SQLite database I had created. I did a hard drive search for it, and found it in:
C:\Users\Clay\AppData\Local\Packages\99129e92-ebeb-4800-a0e5-
d0e43b016009_qtyjefqf75sa6\LocalState\photrax.sqlite
Now how in the world would I know that it was in 99129e92-ebeb-4800-a0e5-
d0e43b016009_qtyjefqf75sa6 (there are many similar Welch-looking folder names beneath C:\Users\Clay\AppData\Local\Packages, so how would I know which one it's in)?
Surely there's a more elegant way to find it than doing a global search.
C:\Users\Clay\AppData\Local\Package is where all your apps store their data and 99129e92-ebeb-4800-a0e5-
d0e43b016009 is most likely your package ID from the appx manifest. You can just use ApplicationData.LocalFolder.Path to get the path.
I'm encountering a very odd problem. Since 2 days I cannot add new tables from my db in the model.
They appear in the list of addable tables, no error are shown at the validation but then, they don't appear in the Entity lists, and they still appear in the "addable" part of the menu.
The problem appears in
We've tried from different computeurs, so it's not a problem of my specific visual studio.
We've tried with other dbs, and the problem doesn't affect them. It affects boths of my prod and developpment dbs though.
We've tried with the exact same credentials to log to the db (not window authentication as we usually do), and the problem remains, so it's not a problem of rights.
We're a bit out of ideas right now :/
Does someone have an idea what it could be?
Thanks
Ok, we've found where it came from.
The table we wanted to add had no PK, and then when we tested we created mock tables without PK.
Once we add a PK the import goes well =)
If you're using a Code First approach then Entity Framework will build the table for you. It looks like you are not using Code First, so you will have create the table in the database. I assume you're using an Entity Data Model (.edmx)? If so, you will create your table in the database, then update your data model (.edmx). If you have not yet created your .edmx file, you need to do that - the .edmx file will contain all your CRUD operations.
What I'm confused about is I'd imagine your code would throw an error if the table did not exist (i.e. if the table represented by your data model didn't map to an actual table in the database, because it doesn't exist). So, the question is, does your table already exist? If it does, then step through the code line by line to find out why your records aren't being saved. If it doesn't exist, then add the table via SQL Server Management Studio (or similar), then open your .edmx file, right click on the layout that comes up, click "Update Model from database".
(This is a follow-up to an answer from an earlier question here.)
I have an Access 2010 database file containing a table with a Before Change Data Macro:
I can open the table in Datasheet View and add rows, and the Data Macro behaves as expected. However, if I open the table in Design View, open the Data Macro for editing, do something trivial like click the [+] beside one of the macro steps to expand the details, and then try to save the "changes" I get the error
The 'LookUpRecord' macro action has an invalid value for the 'Look Up A Record In' argument.
I have also tried to create the macro from scratch in a fresh Access 2010 .accdb and get the same error. I have tested this on three different machines: two machines running 64-bit Access 2010 and one machine running 32-bit Access 2010. All machines are fully patched via Microsoft Update. (That is, they are currently running version 14.0.7106.5003.)
While testing I noted that this appears to be related to an event-driven Data Macro trying to use LookUpRecord to perform a SELECT on the same table to which the Data Macro applies. Performing a SELECT on some other table does not seem to trigger the error.
My questions are:
Can anyone recreate this issue with a patched version of Access 2010?
Can anyone test this with an unpatched version of Access 2010 (e.g., fresh install from an early release) to see if a subsequent patch broke changed something?
Has anyone seen any documentation or Internet chatter to suggest that an event-driven Data Macro for a particular table should (or should not) be able to do a LookUpRecord by performing a SELECT on itself?
Edit -- 2013-12-19 14:10 UTC:
I just tested this with Access 2010 SP1 (14.0.6023.1000) and got the same results.
I think the issue is the table alias. If you open the table out in layout mode (just open the table NOT in design mode). You then get this:
You can now edit the macro freely (such as expand an action) and then save the macro.
I suspect this is an un-intended bug since if the table is opened in design mode then the table is locked and the macro cannot get/check verify the SQL used in the lookup command.
Note that if you JUST PLACE the table name in the macro designer then you have NO problem and this is what 99% of people do in this case.
Most most don't know you can free hand type in SQL here!!!
Upon save the designer attempts to verify the SQL against the table – but the table is locked in design mode. So in a round about way, this is a bug, but few encounter it due to few typing in SQL into that lookup record command.
I would as noted just open up the table by clicking on it and not use design mode to make changes. And note in the above screen shot how the event buttons are separate buttons and easier to hit then when opening table in design mode.
Note that in order to edit the Data Macros directly from Datasheet view the database must have the "Enable design changes for tables in Datasheet view" option enabled:
If that option is not set then the Data Macro buttons are disabled in Datasheet view.
I am receiving a warning from Visual Studio 2010 that every single control in my ASP.net project has a duplicate ID. This is obviously not the case, since I named all hundred or so controls on the page myself, and I made sure not to allow any duplicates. Has anyone else run into this and found a fix?
Thanks
restarting will work occasionally, but often the solution is to right click the "unrendered" control and select 'update'. This does the trick.