How do I automate a Data Flow task in Visual Studio 2015? - visual-studio

I am currently using Visual Studio 2015 (Community Version) and I am trying to automate a data flow task that moves an SQL input into a Flat File output.
I have tested that the task works manually however I cannot find anywhere how to automate the process, any help would be greatly appreciated as I am very new to this, Thanks

You need to schedule a process that triggers your code/DTS. You can use SQL Server Agent, Windows Scheduler or other scheduler software.
If you are working with SSIS and your process is a DTS (I'm guessin it is because you mentioned "Data Flow Task"), then you can execute it using the command line with the dtexec program.
If you are using C#, Visual Basic or another programming language in Visual Studio, make sure to compile it as a Console Application so it generates an .exe file.
Finally schedule your program execution (either dtexec or the call to the .exe) in your scheduler software, with a custom timing (for example everyday at 7am, just weekends, etc.). Make sure to monitor the results afterwards!

Related

How to write and debug a PowerShell module using VIsual Studio Powershell Tools?

I'd like to take advantage of Visual Studio's debugging capabilities when writing PowerShell scripts, especially PowerShell modules. Thus, I have installed the PowerShell tools for Visual Studio. I created a new PowerShell module project - but I can't figure out how to properly run and debug?
When running such a project I'd expect that the module is loaded and all functions are available in the debug window - and that any code execution would stop at break points.
However, I can't manage to run a module that way. In Solution Properties => Advanced => Entry point I can only select ps1 files. I've RTFM at https://docs.poshtools.com/ but didn't find anything about modules. Just to avoid any confusion, I am not developing anything with C# or VB in this project, just pure PS. I have been developing PS before using Visual Studio Code, but as I am more comfortable with Visual Studio 2019 I might be able to use it for PS development as well.
Any suggestions?

Restart Shell Visual Studio

Due to company standards I switched from VS Code to it's bigger brother VS Pro.
When using VS Code while coding with Powershell I do have the possibility to restart powershell (within Code). Easy thing, you close the console and Code asks you whether you want to start a new powershell session.
I need to do so to get my latest changes (within my code) to be activated/effective. How does one do that in Visual Studio (no code)?

Best way of automating a Visual studio build on Windows

I need to build a c++ program in Visual Studio on Windows every 24 hours (I belive this is called a kron job?), and then send an email if it fails. I can't download any software on this machine, so I think I will have to make do with what Windows XP and visual studio has to offer.
I found a VBScript online that sends an e mail, which works fine. Now I need to automate the build.
I though about writing the thing on vbs and setting it in schedueled tasks to run once a day. I don't have any experience with VBs.
Is this a good way of solvig this? Any better ides?
Thanks!
You can use devenv.exe to build a solution or a project.
devenv.exe has several command line switches that could be used to start a build.
For example, to build a Release configuration of a solution file called myworkspace.sln you would do the following - devenv.exe myworkspace.sln /build Release.
Here is the list of command line arguments supported by devenv.exe -
http://msdn.microsoft.com/en-us/library/xee0c8y7(v=vs.80).aspx
For the recurring task to be run every 24 hours, use the Windows Task Scheduler to create a recurring task which runs the devenv.exe command line shown above.
Task scheduler can be found in the Administrative Tools menu or you can run the command taskschd.msc.

How to efficiently write code and debug windows service project in visual studio?

How to efficiently write code and debug windows service project in visual studio? Visual Studio gives
Cannot start service from the command
line or a debugger. A Windows Service
must first be installed (using
installutil.exe) and then started with
the ServerExplorer, Windows Services
Administrative tool or the NET START
command.
when I want to debug my code. It seems to me that it is inefficient to test the code. One has to install a service, start it, attach the debugger, test it, and then uninstall it.
Thanks,
Gil.
As the first comment mentioned there are many other items out there...but I wanted to put a little light on this as well.
You can use a post build event to manage the process of installing after build etc, so that you don't have any effort needed there.
You can use Debugger.Break() to be able to start debugging right away. This way you are not playing the "Attach" game.
These will at least get you going, and help reduce the "pain" you experience.

Running tests as a different user in Visual Studio

I have a program that needs to run as a separate NT user to connect to a SQL Server databases. For running a program itself, this isn't a big deal as I can just right click on it in windows explorer and select run as. Is there any way to run my tests as a different user as well? (it would be nice if I could do so in Visual Studio)
Update: As of right now, I'm just unit testing using the integrated unit testing framework in Visual Studio 2008 Pro. I'm running them just using the "run all tests in current solution" menu option.
There's a command line program "runas", which you can use to run your tests as long as they are standalone programs. I'm not sure how exactly to integreate it with your tests, as I may need a bit more information on how you run them.
This method will ask you to enter your password.
You could absract and mock the mechanism that determines the current user. This would allow you test as anyone.

Resources