Is it possible to open .mdf and .sdf database types in the same Sql Sever Management Studio session?
I have tried, and it obviously did not work. I am guessing I either have something configured wrong or they are not compatible. I can open each up separately of course using the appropriate database provider when opening SSMS.
I was just hoping there was a way or maybe some other MS tool, plug in or app I don't have that will allow them to work together.
I was hoping to use TSQL to populate the Compact Db but it appears I need to code up an app or something to do this. Any suggestions on porting data to compact?
Use my free Visual Studio add-in "SQL Server Compact Toolbox", lets you move data and schema from SQL Server to Compact in a single click
Related
I have a database project in Visual Studio 2017. Our database project is managed just like any other library of code where multiple developers can update the project as necessary. To ease the pain of deployments, I have built a custom deployment task in our TFS 2018 (vNext) Build process that is a powershell script that calls sqlPackage.exe. SqlPackage compares our compiled database project (*.dacpac file) to our target database (in Dev, QA, etc.). I have the custom step configured so that it will write the expected changes to disk so I have a record of what was changed, then sqlPackage runs a second pass to apply the changes to the intended target database.
My DBA enabled the Query Store in our SQL 2016 Database. During my sqlPackage deployment, one of the initial steps is to turn the query store off, this makes my DBA unhappy. He wants the ability to compare pre and post deployment changes but if the query store gets turned off, we lose the history.
I have tried several of the switches in the documentation (https://msdn.microsoft.com/en-us/library/hh550080(v=vs.103).aspx#Publish%20Parameters,%20Properties,%20and%20SQLCMD%20Variables) but I can't seem to find the magic parameter.
How do I stop SqlPackage from turning off the query store?
My current script:
sqlPackage.exe /Action:Script /SourceFile: myPath\MyDatabaseName.dacpac" /OutputPath:"myPath\TheseAreMyChangesThatWillBeApplied.sql" /TargetConnectionString:"Integrated Security=true;server=MyServer;database=MyDatabase;" /p:DropObjectsNotInSource=false /p:DropPermissionsNotInSource=false /p:DropRoleMembersNotInSource=false /p:BlockOnPossibleDataLoss=True /Variables:"CrossDatabaseRefs=CrossDatabaseRefs
Is there a better way? I am surprised that I had to write a custom TFS Build Task to do this. Which makes me think that I might be doing it the hard way. (But this has worked pretty well for me for the last several years). I love database projects, I love that they enforce references and ensure that we don't break other objects when a column is dropped (for instance).
Any insight would be greatly appreciated.
Either disable the scripting of database properties using /p:ScriptDatabaseOptions=false, or update the database properties in the project to reflect the desired Query Store settings.
To set the Query Store settings in the project, right-click the database project in Solution Explorer and open Properties. From there, in the Project Settings tab find the "Database Settings..." button. In the Database Settings dialog, click the Operational tab and scroll down to find the Query Store settings.
Apparently, all we needed to do was add a post deployment script to re-enable the Query Store. Hope this helps someone out there...
USE Master
ALTER DATABASE [MyDbName] SET QUERY_STORE = ON
all...
Is there a way of reverse engineering in code first if there has been a minor change by someone within SQL management studio.
The equivalent in the EDMX file would be when you double click on the edmx file and right click and update from the database and it updates your model.
the reason i ask is there is alot of sql changes through SQL management studios and I dont know how I would consistently update my model.
thanks
You can reverse engineer selected objects and then add them back to your models and context. https://msdn.microsoft.com/en-us/library/jj200620.aspx
In my *.mdb file I have a macro with an action that runs TransferText and gives me an Error Number of 2950 which according to Microsoft means that the document is not trusted, as far as I know it is trusted! It's located in the Trust Center Trusted Locations.
Is there an explanation point next to the Action causing this in the macro whose tooltip reads This action will not be allowed if the database is not Trusted.
I already tried running a compact and repair on it, what could be causing this?
Method 1: Enable the database for the current session
When you use this method, Access 2007 enables the database until you close the database. To enable the database for the current session, follow these steps:
On the Message Bar, click Options.
In the Microsoft Office Security Options dialog box, click Enable this content, and then click OK.
Note You must repeat these steps every time that you open the database.
Check here: https://support.microsoft.com/en-us/kb/931407
The problem can be as simple as not having first established an ODBC connection. I was getting this macro error (2950), and I ended up reading all the support threads, getting nowhere.
Then it struck me to install our ERP client first --which is the front-end for the database I was trying to access ...with Access.
Doing this established an ODBC configuration, so now when I opened my Access file, an ODBC prompt opened up before I even got to any of the functions that were triggering the error. In hindsight, I could have passed on installing the ERP client, and just went to the ODBC settings in Windows, and pointed a connection to the SQL table.
In my case there was a naming conflict. The macro in turn called a VBA function, and I had inadvertently named the function with the same name as the module it was in. They were both named "RobertsReport". Once I changed the name, everything worked as expected.
Tip: As troubleshooting steps, try running the macro solo by double-clicking on it. If you can, copy only the line that generates the error to a new macro to test it by itself, and of course include any preceding commands it may need to run properly. Once I did this it greatly narrowed down the problem until the lightbulb came on over my head.
I was getting started with JDBC and I was using the video mentioned here: http://www.youtube.com/watch?v=kxi-H7359LA
Although he is good at the start, he becomes confusing towards the middle.
Referring to the video:
I have a 32bit Office 2010
32bit JDK and JRE
I downloaded the AccessDriverEngine.exe for 32bit
Then I went to Control Panel and searched for ODBC
Then I clicked on the SystemDSN tab and there are no drivers there
Am I or not supposed to be seeing drivers there?
AFAIK from doing some Visual Basic, you have to add it there after you create a .mdb file containing your various tables. (Questions under the image)
Questions
1. Have I done the steps correctly to get started with JDBC?
2. I have to create a database in Access first, right?
3. Whatelse do I do if I want to use Eclipse IDE to start coding? Like what paths, etc do I set?
You need to use 32-bit ODBC as well. Check out this link:
http://sqlblog.com/blogs/john_paul_cook/archive/2010/03/16/32-bit-odbc-on-windows-server-2008-r2.aspx
I think you'll be able to work through your other questions once you overcome this hurdle.
Is it possible to save a form in VBA as .exe file and then run it.
No, not natively.
There are some ways to emulate an EXE:
Excel: 3rd party tool that claims to be able to compile an workbook to an EXE: DoneEx XCell Compiler. You can also create an automatic marco, Auto_Open, to run when the workbook is opened.
Access: Microsoft used to have a way of delivering an Access database as an executable (the name of the tool escapes me) so you could deploy your database to desktops that didn't have Access installed, but I don't think they offer this anymore. You could convert you MDB to an MDE and set the startup properties to hide the database window and menus and such to emulate an EXE, but your users will need to have Access installed.
Word: You can pass the /m switch to Word on startup with the name of a macro to run.
I think there is at least 2 way
move the code into visual basic 6 and compile it or use visual studio tool for office and see what you can do.
if these 2 solutions is a no no for you, then you are out of luck
No. VBA is an addon to applications to support "scripting" in the form of VB.
So unless your application supports a way to save the internal script as en external EXE, you are out of luck.
I think DoneEx still needs Excel installed, it just bootstraps something to the xls file, or bootstraps that to something and wraps it up as an exe???/..
as I think this does.
http://cpap.com.br/orlando/XLtoExeMore.asp
But at least the second one if free!
I have not tested on PC's with out office.
what is it you are trying to accomplish there may be a work around another way?
thanks
Ross