0
Excel and SQL Quick Tricks for Merchandisers <ul><li>Learn simple SQL queries to extract data from your SmartSite SQL tabl...
Software Needs for Microsoft SQL and Microsoft Excel <ul><li>Microsoft SQL Server 2008 Express  – Free at </li></ul><ul><u...
SQL Query Components <ul><li>Every SQL query must have at least two components </li></ul><ul><ul><li>SELECT  – control the...
Microsoft SQL Management Tools <ul><li>Connect to your SQL server </li></ul><ul><li>Select the desired database </li></ul>
Common SmartSite Tables <ul><li>Common SmartSite Tables </li></ul><ul><ul><li>acBrands </li></ul></ul><ul><ul><li>acGroups...
Helpful Microsoft Excel Functions <ul><li>CONCATENATE:  =CONCATENATE(A1,” “,B1) </li></ul><ul><ul><li>Use to add data to t...
Helpful Microsoft Excel Functions  Cont. <ul><li>LEFT:  =LEFT(B2,3) </li></ul><ul><ul><li>Returns the first character or c...
Helpful Microsoft Excel Functions  Cont. <ul><li>PROPER:  =PROPER(B2) </li></ul><ul><ul><li>Capitalizes the first letter i...
Helpful Microsoft Excel Functions  Cont. <ul><li>SUBSTITUTE:  =SUBSTITUTE(B2,”MPW”,”Mack’s”) </li></ul><ul><ul><li>Substit...
Scenarios <ul><li>Query the data in SQL </li></ul><ul><li>Copy the queried data into Excel </li></ul><ul><li>Manipulate th...
Update Excel Data in SQL <ul><li>Excel File Requirements for upload to SQL </li></ul><ul><ul><li>One identifying row such ...
Update Excel Data in SQL  Cont. <ul><li>Log into the SQL Server with the SQL tool installed </li></ul><ul><li>Navigate to ...
Update Excel Data in SQL  Cont. Click ‘Next’ for the screen below In the Data Source Field select Microsoft Excel
Update Excel Data in SQL  Cont. <ul><li>Browse to the file to be imported to update SQL </li></ul><ul><li>Verify the corre...
Update Excel Data in SQL  Cont. <ul><li>Destination: should be defaulted to ‘SQL Server Native Client 10.0’ </li></ul><ul>...
Update Excel Data in SQL  Cont. <ul><li>Select the radio button for ‘Copy data from one or more tables or views’ </li></ul...
Update Excel Data in SQL  Cont. <ul><li>Since the saved spreadsheet has only one sheet, check the box for ‘Sheet1$’ as sho...
Update Excel Data in SQL  Cont. <ul><li>Edit Mapping: allows for the review of the Source and Destination mappings </li></...
Update Excel Data in SQL  Cont. <ul><li>Edit Mapping window </li></ul><ul><li>Review the Source and Destination columns sh...
Update Excel Data in SQL  Cont. <ul><li>Preview Window </li></ul><ul><li>Display the data to be imported into the temp tab...
Update Excel Data in SQL  Cont. <ul><li>After the review of the data click ‘Next’ to move to Save and Run the data </li></...
Update Excel Data in SQL  Cont. <ul><li>Success import will result in all ‘Success’ in Status </li></ul><ul><li>Review dat...
Update Excel Data in SQL  Cont. <ul><li>Close the SQL Server Import and Export Wizard </li></ul><ul><li>Go back to the SQL...
Update Excel Data in SQL  Cont. <ul><li>Write the UPDATE script to insert the data in the temp table to the desired table ...
You CAN do it! Enjoy your “new ability”! <ul><li>Questions? </li></ul>
Upcoming SlideShare
Loading in...5
×

Excel and SQL Quick Tricks for Merchandisers

3,442

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
3,442
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • CONCATENATE: A1 would be the First Name, then I have a space “ “, then B1 is the Last Name COUNT: In the example from cells A1 thru A20 there is a mixture of text and numbers. Maybe only 5 cells have numbers, thus the result of 5 will be returned COUNTIF: Use to count the number of times a specific search term was used NOTES: You can use the wildcard characters ? matches any single character, * matches any sequence of characters Criteria are not case sensitive EXACT
  • Be sure to get the note in regards to Proper when there is a word such as ‘hancock’s’ the Proper will change it to ‘Hancock’S’
  • Talk about Scenarios (have them all setup before hand)
  • Explain script components
  • Transcript of "Excel and SQL Quick Tricks for Merchandisers"

    1. 1. Excel and SQL Quick Tricks for Merchandisers <ul><li>Learn simple SQL queries to extract data from your SmartSite SQL tables </li></ul><ul><li>Excel functions to edit your data with little effort </li></ul><ul><li>Show and talk about real scenarios </li></ul><ul><li>Update your SQL tables with the updated information to eliminate manual Content work </li></ul>Leah Fernelius
    2. 2. Software Needs for Microsoft SQL and Microsoft Excel <ul><li>Microsoft SQL Server 2008 Express – Free at </li></ul><ul><ul><li>http:// www.microsoft.com /express/Database/ (on right side) </li></ul></ul><ul><li>Enable the ability to query and update your SmartSite SQL tables </li></ul><ul><li>Contact Ability Support or your hosting company for connection information </li></ul><ul><li>Microsoft Office Excel – any current version </li></ul><ul><li>All Excel files created will need to be saved as .XLS </li></ul>
    3. 3. SQL Query Components <ul><li>Every SQL query must have at least two components </li></ul><ul><ul><li>SELECT – control the data elements (columns) desired, such as, the item number or short description </li></ul></ul><ul><ul><li>FROM – identify the table that contains the desired data </li></ul></ul><ul><li>Narrowing criteria and functions </li></ul><ul><ul><li>WHERE – narrow the desired data outcome </li></ul></ul><ul><ul><li>Equal: = Less Than: < Greater Than: > </li></ul></ul><ul><ul><li>Not Equal to: <> Contains: like Doesn’t Contain: not like </li></ul></ul><ul><ul><li>Note: ‘like’ and ‘not like’ are used with the wildcard of % </li></ul></ul>
    4. 4. Microsoft SQL Management Tools <ul><li>Connect to your SQL server </li></ul><ul><li>Select the desired database </li></ul>
    5. 5. Common SmartSite Tables <ul><li>Common SmartSite Tables </li></ul><ul><ul><li>acBrands </li></ul></ul><ul><ul><li>acGroups </li></ul></ul><ul><ul><li>acItems </li></ul></ul><ul><ul><li>acItemText </li></ul></ul><ul><ul><li>MCEcom_Order </li></ul></ul><ul><ul><li>MCEcom_ShoppingCart_LineItems </li></ul></ul><ul><ul><li>MCEcom_User_Address </li></ul></ul><ul><li>Expand ‘Tables’ to see all of the SmartSite tables </li></ul>
    6. 6. Helpful Microsoft Excel Functions <ul><li>CONCATENATE: =CONCATENATE(A1,” “,B1) </li></ul><ul><ul><li>Use to add data to the front, end, or put to fields together into one, such as First Name and Last Name into one field </li></ul></ul><ul><li>COUNT: =COUNT(A1:A20) </li></ul><ul><ul><li>Counts the number of cells that contain numbers. </li></ul></ul><ul><li>COUNTIF: =COUNTIF(B2:B25, “SmartSite”) </li></ul><ul><ul><li>Counts the number of cells in a range with a single criterion. </li></ul></ul><ul><li>EXACT: =EXACT(A2,B2) </li></ul><ul><ul><li>Compares two text strings returning TRUE for an exact match or FALSE if otherwise. EXACT is case-sensitive </li></ul></ul>
    7. 7. Helpful Microsoft Excel Functions Cont. <ul><li>LEFT: =LEFT(B2,3) </li></ul><ul><ul><li>Returns the first character or characters in a text string. If a number is not entered, then just the first character will be returned. If a number is entered, then the first positions for that count will be returned </li></ul></ul><ul><li>LEN: =LEN(A4) </li></ul><ul><ul><li>Counts the number characters in a text string </li></ul></ul><ul><li>MID: =MID(A2,1,5) </li></ul><ul><ul><li>Returns a specific number of characters from a text string, starting at a defined point. The example is for cell A2, first position, return 5 characters </li></ul></ul>
    8. 8. Helpful Microsoft Excel Functions Cont. <ul><li>PROPER: =PROPER(B2) </li></ul><ul><ul><li>Capitalizes the first letter in a text string and converts all other letters to lowercase. Great for product descriptions from an OMS. </li></ul></ul><ul><li>REPLACE: =REPLACE(C2,3,2,”10”) </li></ul><ul><ul><li>Replaces part of a text string, based on the number of characters specified, with the new text. C2 is the old text, 3 is the position to start at, 2 is the number of positions to remove, and “10” is the new text </li></ul></ul><ul><li>RIGHT: =RIGHT(A2,4) </li></ul><ul><ul><li>Returns the last character or characters in a text string. If a number is not entered, then only the last character will be returned. If a number is entered, then the last positions for that count will be returned </li></ul></ul>
    9. 9. Helpful Microsoft Excel Functions Cont. <ul><li>SUBSTITUTE: =SUBSTITUTE(B2,”MPW”,”Mack’s”) </li></ul><ul><ul><li>Substitutes new text for old text. “MPW” is the old text and “Mack’s” is the new text </li></ul></ul><ul><li>UPPER: =UPPER(C2) </li></ul><ul><ul><li>Convert text from mixed or lower to all upper case </li></ul></ul><ul><li>VLOOKUP: see handout available </li></ul>
    10. 10. Scenarios <ul><li>Query the data in SQL </li></ul><ul><li>Copy the queried data into Excel </li></ul><ul><li>Manipulate the data in Excel using functions </li></ul><ul><li>Review manipulated data </li></ul>Scenario One
    11. 11. Update Excel Data in SQL <ul><li>Excel File Requirements for upload to SQL </li></ul><ul><ul><li>One identifying row such as an item number, item ID or EDP </li></ul></ul><ul><ul><li>The file must contain column headings </li></ul></ul><ul><ul><li>Save the file as .xls </li></ul></ul><ul><li>SQL Requirements </li></ul><ul><ul><li>Permissions to write to or update the database </li></ul></ul>
    12. 12. Update Excel Data in SQL Cont. <ul><li>Log into the SQL Server with the SQL tool installed </li></ul><ul><li>Navigate to the desired database </li></ul><ul><li>Right click on the desired database selecting: </li></ul><ul><li>Tasks > Import Data </li></ul><ul><li>The SQL Server Import and Export Wizard will open </li></ul>
    13. 13. Update Excel Data in SQL Cont. Click ‘Next’ for the screen below In the Data Source Field select Microsoft Excel
    14. 14. Update Excel Data in SQL Cont. <ul><li>Browse to the file to be imported to update SQL </li></ul><ul><li>Verify the correct Excel Version displays in the drop down. </li></ul><ul><ul><li>If using MS Excel 2007 be sure the 2007 version displays </li></ul></ul><ul><li>Check box marked for ‘First row has column names’ </li></ul><ul><li>Click ‘Next’ </li></ul>
    15. 15. Update Excel Data in SQL Cont. <ul><li>Destination: should be defaulted to ‘SQL Server Native Client 10.0’ </li></ul><ul><li>Server name: will be the name of the SQL server </li></ul><ul><li>Authentication: access information for SQL </li></ul><ul><li>Database: should default to the database that was clicked to start this task </li></ul><ul><li>Click ‘Next’ </li></ul>
    16. 16. Update Excel Data in SQL Cont. <ul><li>Select the radio button for ‘Copy data from one or more tables or views’ </li></ul><ul><li>Click ‘Next’ </li></ul>
    17. 17. Update Excel Data in SQL Cont. <ul><li>Since the saved spreadsheet has only one sheet, check the box for ‘Sheet1$’ as shown </li></ul><ul><li>In the Destination cell remove the text ‘Sheet1$’ and enter the desired temp. table name </li></ul>
    18. 18. Update Excel Data in SQL Cont. <ul><li>Edit Mapping: allows for the review of the Source and Destination mappings </li></ul><ul><li>Preview: display the data that will be imported </li></ul>
    19. 19. Update Excel Data in SQL Cont. <ul><li>Edit Mapping window </li></ul><ul><li>Review the Source and Destination columns shown </li></ul><ul><li>Click ‘OK’ </li></ul>
    20. 20. Update Excel Data in SQL Cont. <ul><li>Preview Window </li></ul><ul><li>Display the data to be imported into the temp table </li></ul><ul><li>Click ‘OK’ to close the window </li></ul>
    21. 21. Update Excel Data in SQL Cont. <ul><li>After the review of the data click ‘Next’ to move to Save and Run the data </li></ul><ul><li>Click Next on the Save and Run the data window will start the process to import the data from Excel </li></ul>
    22. 22. Update Excel Data in SQL Cont. <ul><li>Success import will result in all ‘Success’ in Status </li></ul><ul><li>Review data, click ‘Finish’ </li></ul>
    23. 23. Update Excel Data in SQL Cont. <ul><li>Close the SQL Server Import and Export Wizard </li></ul><ul><li>Go back to the SQL Server Management Studio window </li></ul><ul><li>Click on ‘New Query’ </li></ul><ul><li>Confirm desired database is in the drop down </li></ul>
    24. 24. Update Excel Data in SQL Cont. <ul><li>Write the UPDATE script to insert the data in the temp table to the desired table </li></ul><ul><li>Click ‘Execute’ or hit ‘F5’ on keyboard to run the script </li></ul><ul><li>When script has run a message will appear to show how many rows were affected </li></ul><ul><li>Query the table to confirm data </li></ul>
    25. 25. You CAN do it! Enjoy your “new ability”! <ul><li>Questions? </li></ul>
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×