Sunday, September 29, 2013

Creating Scripts To Insert Data From Existing Tables

When we work with systems is inevitable to work with data that is manipulated by these, and there are moments when you need to move data created by one application to another database, but it's not necessary to copy all the database to another one, maybe you require just to move all data for particular tables.

For this task, SQL Server can help us by using the "Generate Scripts..." option that it's into Management Studio tool, you only have to right-click over the source database and go to "Tasks" menu and here locate the option said before.

You will see the introduction, just click "Next".

As I said at the beginning in this opportunity we are going to select a group of tables and not all the database.

Specify the media where this result is going to be published. But, in this case it is necessary to click on "Advanced" option to personalized the operation.

As we want just the data, select "Data only" in the "Types of data to script".

Review the summary of the operation to be executed.

Wait for the process to finish successfully.

Once the process finishes with success the output file can be use directly over the new database that have the tables with no data.

Sunday, September 22, 2013

Using Calculated Fields in Dynamic Tables with Excel

Honestly, I don't consider myself an expert in dynamic tables, although many people think that actually I am this is just because I know many tricks about Excel, however I don't use dynamic tables a lot and therefore there are things about this tables than I don't know.

One day, when I was at work, a partner called me to watch his computer because he had a big doubt about something so he decided to ask me about it. He was managing a huge dynamic table that have a bigger simple table as data source, this dynamic table resumed all sales from region, but the problem was that he needed to show that resume not with the exact amount but rounded to thousands.

At that moment I couldn't help him because I didn't know how to do it, but now I took a time for testing ways of doing that and I want to show you what could have done at that time.

First at all create a simple table with few regions and sales value in 3 currencies.

With this information, select it and  go to "Insert" tab and select "Dynamic Table" to create one based in the simple table created above.

You will have your dynamic table created, select  "Regiones" field to have the first column of the new table.

 Now select the "Options" tab and inside here select "Fields, Items & Sets" button to select the option "Calculated Field" from the menu.

Once you see the new window the next step is to set the new field, first put a name for it and second, place the function for this, in this case you have to use a previous existing field to divide it over 1000 and this result has to be rounded by using the native function round provided by Excel.

Doing so will give you a new column in your table that shows the amount of sales but in thousands as it is required.

If you want to see the original value just check the original field from the panel, in this case is the "Dólar" field.

Using this method will provide you many useful ways to present information in an easy way, it depends on the complexity of the functions to be used to calculate the new field.

Sunday, September 8, 2013

Attaching Files to Microsoft Word

Probably you already know, but I work with systems, I mean, I analyze the client requeriments and specify the features a new software or piece of it will have, to do so it's well know that exists an standard document where an analyst have to explain in detail how the feature will behave when the user interacts with it.

Many times, it's necessary to make references to other documents to get the specification clearer enough, and this is why I thought about attaching files instead of referencing them because the person who this document was address for couldn't access to our repository, so I tried to send a unique file containing all the information to avoid any problem. As I did this through Word I'll show you how to do it in it, probably you can do the same with the other Office applications.

The first thing you have to do is to prepare the file that is going to be attached, once you got this file you are now able to use it inside a parent file. The next step it's to open the parent file and locate the place where the another file will be attached.

Once you have located the position of the attachment select the "Object" list under the "Insert" section, in this list select also the "Object..." button.

Choose the tab "Create from File" because a previous created file will be selected.

Just search the file you want to attach in the Windows explorer.

Finally, as you selected your file to be added to your parent file, click on "Display as Icon" to show the file as icon.

With this your file is ready to be sent containing the attachment file you selected.