locked
Building view from excel column values RRS feed

  • Question

  • Table Name Current Name New Name(Alias)
    Table1 Basekey Basekey
    Table1 rq Required Quantity
    Table1 son Shop Order Number
    Table2 in Item Number
    Table2 QR Qty Reqd
    Table2 RD Date Reqd
    Table2 RemQ RemainingQuantity
    Table2 RD REC ID
    Table2 FC Facility Code
    Table2 SF

    MRP/MPS by Whse Flg

    I have an excel sheet with three columns like the example.  I have to build SQL views using the table name and the current columnnames ( current as new) .

    For Ex: create view vwTable 1 as Select basekey as basekey, rq as requiredquantity, son as shop order number from table1.

    I have 37 such tables.

    Is there any function or VBA macro that i can use to create these views easily?

    Thank You,

    Ara


    Ara

    Thursday, December 10, 2015 4:15 PM

Answers

  • Hi Ara,

    >>I have to build SQL views using the table name and the current columnnames ( current as new) .<<

    Based on my understanding, the SQL views is the object exits in Microsoft SQL database. There is no SQL View concept in Excel. Did you want to create SQL Views in Microsoft SQL database?

    If I understood correctly, we need to import the data into SQL server, then we can create SQL views via Transact-SQL.

    And if you want to generate SQL based on the data in the worksheet, we can get cell value from Excel via Range object.

    Here is helpful links for you learning about Excel developing:
    Concepts (Excel VBA reference)

    How do I... (Excel VBA reference)

    Object model (Excel VBA reference) 

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 11, 2015 5:17 AM