Query analyzer help

Hello quick question,
I am trying to get data from a database and two tables into a csv.. I thought i could write a join but i dont see the join between the two tables. How would i do this, the tables are called dbo.card and dbo.person. The database is called wapac. The column
in the dbo.card table that I need is Card Number and that has to match up with First Name, Middle Name, Last Name from the Dbo.person table. Any help would be great. I thought the ID was the connection but it is not.

Can you post the DDL (CREATE TABLE) for the tables?
Usually tables are JOINed on PRIMARY KEY and FOREIGN KEY.
> column in the dbo.card table that I need is Card Number and that has to match up with First Name, Middle Name, Last Name from the Dbo.person table
There must be some sort of mapping between cards and persons.
Diagram example showing relationship among tables.
Kalman Toth Database & OLAP Architect
SQL Server 2014 Database Design
New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

Similar Messages

  • How to create a Matrix table using this data in SQL Query Analyzer

    Hello all,
    I have a problem while I am trying to represent my Sql Table namely table1 in Matrix form
    my table Format is
    city1 city2 Distance--------------------------------------------------------
    Mumbai Delhi 100
    Delhi Banaras 50
    Mumbai Rajasthan 70
    Banaras haryana 40
    Mumbai Mumbai 0
    784 entries
    there are 784 cities each having link to other
    Now i want my output as
    Mumbai Delhi Banaras haryana
    Mumbai 0 100 -- --
    Delhi 100 0 50 --
    Banaras
    haryana
    respective distance from one city to other should be shown
    final Matrix would be 784*784
    I am using SQL Query Analyser for this
    Please help me in this regard

    I'm pretty much certain that you don't want to do this in pure SQL. So that means that you want to do it with a reporting tool. I'm not familiar with SQL Query Analyzer, but if it is in fact a reporting tool you'll want to consult its documentation looking for the terms "pivot" or perhaps "cross tab."

  • Problem about printing special character in bex query analyzer

    Hi,
    in bex query analyzer i have created one restricted key figure , in which i have substracted two date with the help of replacement path.
    So i got result.
    But i am facing one problem. when in both date, if one date is null or # then it is giving some big value like -734567.
    But i want some special character like X instead of this big values.
    So how can i do this?
    With the help of if and else it can be done.
    But how can we print special character in report.
    Please help me
    Thank you in advance

    hi,
    You cannot show X in a formula result. You can highlight the row using exception.
    Still if you want to show X in the result then you need to create a formula variable on a char which returns X value all the times.
    Then you can use the three formula variable to write a formula so that it shows the difference:
    date1 -- formula variable
    date2 -- formula variable
    charx -- formula variable.
    the formula will be
    Count(date1)Count(date2)(date1 - date2) + charx *(count (delta(date1) + delta(date2))).
    this would return the X value if any of the dates are empty otherwise their difference.
    regards.
    Arvind.

  • Report running very slow compared to Query Analyzer - high TimeDataRetrieval

    Hi,
    I have a report in SQL Reporting Services 2005 which calls a stored proc and the report takes a very long time to run and sometimes returns zero records. But when i run the stored proc in query analyzer it takes about 4 seconds!!
    I have checked the execution log on the RS using the below sql:
    Code Snippet
    use ReportServer
    Select * from ExecutionLog with (nolock) order by TimeStart DESC
    It shows that i have a large amount of time for the dataretrieval (601309ms, about 10mins) and does not return any records most likely because of a query timeout:
    TimeDataRetrieval  TimeProcessing  TimeRendering Source Status         ByteCount RowCount
      601309                      2227                     3                         1            rsSuccess 4916           0
    The weird thing is that when i run it in query analyzer, i get about 400 records in 4 seconds !!
    I dont understand what RS is doing to take up so much time like this to retrieve data.
    The report is very simple - it basically returns the records straight out into a table.
    The only thing I somewhat suspected was a parameter data type conflict between RS and SQL, specifically dates. I have a start and end date parameter in the report - i tried specifying this as date and string to see if it made any difference but it didn't.
    Any help would be greatly appreciated.

    Hi Mark,
    I didn't say it was an issue of parameter sniffing, and I didn't point you towards the good article about that <s>. I asked you whether you had read the article, described to you earlier in the thread.
    What I said was that it might be an issue of appropriate and dynamic query optimization, versus a cached query plan.  Parameter sniffing is only one of many ways that SQL Server tries to figure out how to optimize a query.  I thought the article did a good job of discussing some of what goes on during this process, and that by absorbing that you could think of ways to handle the wider issue that would be appropriate to your code.  I also pointed you to a thread in which I discussed this in more detail.
    While there are truly many issues with the date controls in the default parameter interface and how they behave, I don't think that what you're experiencing with the date format is implicated in the performance issue.  I guess it *might* be if (say) there is a non-default param value in your proc but your report parameter allows nulls. 
    Let's say the report server database has a different date default than your production database in your system. I have never sat down and tested this scenario and I guess it might cause problems, So we'll look at that first. 
    Whether the date format is at fault is really easy to prove one way or the other, and once proven can be pretty easy to fix:
    Create a test parameter that is of string type.  SQL Server is really good about dynamic conversion of string dates to date types as you probably know.
    place values (formatted however you want) into this version of the parameter instead of your date control parameter.  Use valid dates, in both formats.
    Does your performance change?
    Do you get the right results but bad performance with US format date strings versus right results with good performance with AU date values?
    Do you get the WRONG results with US format date strings, or with AU date strings?
    Try additional permutations involving casting/converting in your proc.
    FWIW, go ahead in the Query Analyzer and put the SAME values you see in the log into your tests there (in US format, I mean).  Do you get the CORRECT results?  Does performance change?  Hold this thought and see below.
    Another thing you can do is look at the query plan as presented by the Query Analyzer when you present the arguments different ways.  See #7 above -- try presenting the date in different formats.  Does the plan show the same path and the same indexes in use each time, or are some not possible because of the way the date has to be converted?  When this happens, the issue is usually that the conversion must be done for each line compared in the filter.  You can fix this really easily in most cases by cast/convert in the procedure so that your SELECT line is only doing that work once. 
    If the plans are different, and perhaps the indexes used are different and you *can't* fix it by fixing the date before the SELECT, do you need to add an index, or perhaps rebuild one?
    Moving on from the date format, as I said before it may be really important NOT to go by your interactive Query Analyzer performance because what you do there may not be used by SQL Server in determining a query plan to cache and re-use.  In case you haven't read the other discussion that I pointed you to at (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1827775&SiteID=1), think about using RECOMPILE or other options that will force a more dynamic investigation of the query.
     >L<

  • BEx QUERY DESIGNER AND QUERY ANALYZER

    HI!!!
    I want to learn to use the BEx Query Designer and the Query Analyzer, someone can help me with link, manuals, tutorials, cookbooks, everything about this?
    Thanks and regards

    Hi,
    Please check the links below which may help you.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/a8cd1f71-0a01-0010-4783-f119b6132d25
    https://www.sdn.sap.com/irj/sdn/bi-elearning
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/ba95531a-0e01-0010-5e9b-891fc040a66c
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/27388d45-0c01-0010-9ebf-9b3dd7bd4ce6?prtmode=navigate
    http://help.sap.com/saphelp_nw04s/helpdata/en/05/4b583cf7388362e10000000a114084/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/92a25985-0a01-0010-5ea0-99ff9e0a244a
    http://help.sap.com/saphelp_nw04s/helpdata/en/42/d21c1f46076bb2e10000000a1553f6/frameset.htm
    Regards,
    ®

  • Open View not seen in the 7.0 Query Analyzer

    Hello ,
    I am not able to see open view in the 7.0 Query Analyzer, but that seen in the 3.x Designer
    Are we missing something here, or its the GUI issue
    When we click on Open, I have only 2 options
    Open Query....
    Open Workbook...
    I could locate my view through the open Query & then naviagting it from the Dialog box, but thats does not seem a good way of locating views.
    Any help on this
    Regards
    Lalan

    Hi Lalan,
    The Query View is not missing and it's not a GUI issue.It's by design.
    With 7.x BEx Analyzer,the Query View can be opened only through Open->Open Query dialog
    where you have to select the "Type" as "Query View".It will list the available query views in the open dialog.Select the query view you want to open and click "Open".
    This is the way to open the query view with 7.x Analyzer.
    Rgds,
    Murali

  • BI query Analyzer

    Hi,
      BI query analyzer is posing problem when connecting to 2004srelease patch 700 revision 259
      when executing  in citrix as it is redirecting to N:\cache\tmp....... if we are doing Execution after
      3 or 4 attempts this error occurs
        its using ie. 7.0
       guys pls help out with any version problems or is it intenet explorer settings may be?
    Thanks,
    p.suresh

    I am not sure which button you pressed and which tool are you using ;however below are the options available.
    Reporting Methods nw2004s
    You can use the BEx Analyzer, the Web Applications and the Web Analyzer for the Business Explorer for free multidimensional
    data analysis as a part of Enterprise reporting.
    Bex Analyzer
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ba/45583ca544eb51e10000000a114084/frameset.htm
    Web Applications
    http://help.sap.com/saphelp_nw2004s/helpdata/en/05/4b583cf7388362e10000000a114084/frameset.htm
    Web Analyzer
    http://help.sap.com/saphelp_nw2004s/helpdata/en/0d/af12403dbedd5fe10000000a155106/frameset.htm
    Hope it Helps
    Chetan
    @CP..

  • Need tcode for Query analyzer

    hi i want to test query in query analyzer befor using in programe.
    i need tcode for query analyzer.
    thanks in advanced.

    hi,,
    SE30 - gives you a run time analysis and points out the issues more at design time.
    ST05 - Is the most useful if you want to track time taken for execution of each of the sections.
    SM50 - Will give you a work process overview, not sure at a program level how can it help you.
    Some times you will have to use a combination of SE30 and ST05.
    I would like to use St05 personally.
    rgds
    anver
    if hlped mark points

  • Is there query analyzer in SAP

    i want to test Query in query analyzer so how can i test in query analyzer.
    thanks .

    hi,
    SE30 - gives you a run time analysis and points out the issues more at design time.
    ST05 - Is the most useful if you want to track time taken for execution of each of the sections.
    SM50 - Will give you a work process overview, not sure at a program level how can it help you.
    Some times you will have to use a combination of SE30 and ST05.
    I would like to use St05 personally.
    Rgds
    Anver

  • Executing query analyzer command via batch ?

    Hello experts,
    it it possible to execute following query analyzer command
    with a batch-programm ?
    EXEC sp_dbcmptlevel ides, 80
    I just want to send this batch - programm to our mobile sales user
    so that they just have to execute this programm and not to
    open query analyzer etc. in order to do this.
    Some ideas ?
    Thanks
    Gerd

    Hello
    Please follow below the steps to do it in a very simple way.
    1. Create <<FIleName>>.sql file, write the sql query or stored procedure what ever you want to execute.
       Place the file Mobile\bin.Net folder.
    2. Open the Upgrade Console from Mobile\Bin.Net folder, Log on to ARS.
    3. Create a new unit, Go to Commands Tab page.
    4. Click on 'Add Sql Command', it will open a small dialog. You enter some name ,select the symbolic DB name as 'USER', click on the 'ADD' and 'select Mobile Application Root Folder' and Browse for <<FIleName>>.sql from Mobile\bin.Net folder. Now click on OK.
    5. IF your MDW is cofigured with CRM server and all mobile clients subscribed for MUP subscriptions, you can do 'send upgrade' from upgrade console. Then you need to run contrans in the mobile client machine to get MUP from CRM server.
    6. IF your MDW is not cofigured with CRM server, you can ' create pakcage' from upgrade console and deploy MUP file to mobile sales user.
    You can find mroe help in UpgradeConsole.chm file available at Mobile\bin.Net folder.
    Best Regards
    Shankar

  • Why 0FISCVARNT is not shown in Query Analyzer?

    I have a cube, when I look at its dimensions from RSA1->Info provider under Time Dimension,
    I see Fiscal Year, Fiscal year Variant and Fiscal Year Period.
    But when I go to Query Analyzer and develop a query on it, under Dimensions Fiscal Year Variant is missing, why?

    Hi,
    Are you creating query on info cube or multiprovider? Have you included info cube in multiprovider and identified the fiscal year variant in the multiprovider or not? If you are creating query directly on Info cube it is not possible that you won't see it.
    Please check if you are creating queriy on proper info provider.
    Regards,
    Kams

  • How to improve the performance of the attached query, Please help

    Hi,
    How to improve performance of the below query, Please help. also attached explain plan -
    SELECT Camp.Id,
    rCam.AccountKey,
    Camp.Id,
    CamBilling.Cpm,
    CamBilling.Cpc,
    CamBilling.FlatRate,
    Camp.CampaignKey,
    Camp.AccountKey,
    CamBilling.billoncontractedamount,
    (SUM(rCam.Impressions) * 0.001 + SUM(rCam.Clickthrus)) AS GR,
    rCam.AccountKey as AccountKey
    FROM Campaign Camp, rCamSit rCam, CamBilling, Site xSite
    WHERE Camp.AccountKey = rCam.AccountKey
    AND Camp.AvCampaignKey = rCam.AvCampaignKey
    AND Camp.AccountKey = CamBilling.AccountKey
    AND Camp.CampaignKey = CamBilling.CampaignKey
    AND rCam.AccountKey = xSite.AccountKey
    AND rCam.AvSiteKey = xSite.AvSiteKey
    AND rCam.RmWhen BETWEEN to_date('01-01-2009', 'DD-MM-YYYY') and
    to_date('01-01-2011', 'DD-MM-YYYY')
    GROUP By rCam.AccountKey,
    Camp.Id,
    CamBilling.Cpm,
    CamBilling.Cpc,
    CamBilling.FlatRate,
    Camp.CampaignKey,
    Camp.AccountKey,
    CamBilling.billoncontractedamount
    Explain Plan :-
    Description                    Object_owner          Object_name     Cost     Cardinality     Bytes     
    SELECT STATEMENT, GOAL = ALL_ROWS                              14     1     13
    SORT AGGREGATE                                                  1     13
    VIEW                         GEMINI_REPORTING               14     1     13
    HASH GROUP BY                                        14     1     103
    NESTED LOOPS                                        13     1     103
    HASH JOIN                                             12     1     85
    TABLE ACCESS BY INDEX ROWID     GEMINI_REPORTING     RCAMSIT          2     4     100
    NESTED LOOPS                                        9     5     325
    HASH JOIN                                        7     1     40
    SORT UNIQUE                                        2     1     18
    TABLE ACCESS BY INDEX ROWID     GEMINI_PRIMARY          SITE          2     1     18
    INDEX RANGE SCAN          GEMINI_PRIMARY          SITE_I0          1     1     
    TABLE ACCESS FULL          GEMINI_PRIMARY          SITE          3     27     594
    INDEX RANGE SCAN          GEMINI_REPORTING     RCAMSIT_I     1     1     5     
    TABLE ACCESS FULL     GEMINI_PRIMARY     CAMPAIGN                    3     127     2540
    TABLE ACCESS BY INDEX ROWID     GEMINI_PRIMARY          CAMBILLING     1     1     18
    INDEX UNIQUE SCAN     GEMINI_PRIMARY     CAMBILLING_U1                    0     1

    Hello,
    This has really nothing to do with the Oracle Forms product.
    Please, send the SQL or/and PL/SQL questions in the corresponding forums.
    Francois

  • How to restrict the users to make sorting on Field in query analyzer(Excel)

    i want to know that is it possible to put restiction for user to make sorting for posting date or any other Field in Query analyzer(Ms Excel )  after excuting the queryy ? i want restiction on sorting option of Ms excel . pls reply me soon.

    viral
    it depend upon different companies and how they are maintianing securities in that...
    for e.g.
    after discussing iwth ur senior member u will decide to publish a new folder in ur production system...
    let say name of folder is BW Financial Accounting
    Now u will publish ur report in this folder.
    go to query designer
    hit Query in menu
    hit publish and select the BW FINANCIAL ACCOUNTING
    now u interact with Security administrator at ur firm
    he will create proper Authorization object for this Folder BW FINANCIAL ACCOUNTING
    once he/she does that then he will add this authorization object to ur user id
    this way u can test that
    u can acess that folder and query link in that folder.....
    similarly they will add the newly created authorization objects to ur specific user ids and they will then have acess to this .....
    if u want to check authorization objects currently assigned to ur user id
    enter t code /su01
    enter ur user id
    and u can see several authorization objects

  • Query Analyzer - issue in variables

    Hello,
    In query analyzer, I have a requirement for 3 keyfigures.
    1 -> Current Month budget
    2 -> Next Month budget
    3 -> Cummulated Yr to Month budget
    for eg. I fI am in month 02.2006
    column 1-> budget for 02.2006
    column 2-> budget for 03.2006
    column 3-> budget for 04.2005 - 01.2006
    for column1, I have created a new selection and included budget qty and 0calmonth and restricted it to 0CMONTH.
    for column2, I have created a new selection and included budget qty and 0calmonth and restricted it to 0CMONTH, and specified +1 as variable offset.
    for column3, I have created a new selection and included budget qty and 0calmonth and restricted it to 0I_CMY01 or 0CYTCM.
    the output is that column1 show the rigth current month figures.
    column2 is blank
    cloumn3 shows the same figure as column1.
    is there any activation that needs to be done so that these variables work.
    thanks in advance

    Hi,
    <i>for column3, I have created a new selection and included budget qty and 0calmonth and restricted it to 0I_CMY01 or 0CYTCM.</i>
    0I_CMY01 gives what????
    0CYTLM
    This variable denotes an interval from month 1 of the current calendar year to the month before the current calendar month.
    <i>for column2, I have created a new selection and included budget qty and 0calmonth and restricted it to 0CMONTH, and specified +1 as variable offset.</i>
    pl check data in infoProvider for 03.2006...i think data is not there for 03.2006..thats y u r getting blank.
    regards

  • Licensing for Query Analyzer

    Hello,As a partner with access to the download center, I would assume that the license keys provided to us on the download page would unlock all Essbase functionality, including the new Query Analyzer (or whatever it's called...it's the new tool in the spreadsheet add-in. And no, I don't mean the Essbase Query Designer).But when I try to access this functionality, I get the "server not licensed with this option" message. Have any other partners encountered this? Do we have to make special requests to our partner reps to gain access to this functionality, just so we can test it?Jared

    If you're refering to "Visual Explorer" then yes, we're having the same problem too. I had an Essbase 6 license, when upgrading to v7, got the warning that license will expire in 365 days, so I opened a ticket with tech support and asked them for a new license. Finally got one and noticed Visual Explorer option still didn't work. When I contacted tech support again, they stated that we "weren't entitled to the option". I explained that we were a partner and it would be real difficult to sell/implement a feature that we've never seen. They said they would look into it. Still haven't heard back as of yet. Will probably escalate to our senior partner and see if he can get them to see the logic in letting us have access to the features in the product.Regards,

Maybe you are looking for

  • The Flash Help Search doesn't work

    Do I need to reinstall my flash ? I installed flash 8 professional on my machine about a month ago. i have just noticed that the search button in the help section doesn't do anything. what should i do? All the help content is there but the only way i

  • What are the book names for MDM from SAP Education academy

    Hi SAP gurus, Can any one tell the name of the books for MDM from SAP Education academy. For example in SAP MM (material management) - it is TAMM40(part1,part2,part3,paret4...etc) So what are the names of the books for MDM from SAP Education academy.

  • Hi , how to install  "  xi content for mdm "  in XI

    hi how to install  "  xi content for mdm "  in XI . does any body know the procedure cheers akhil

  • Read the text in object LFA1 with ID Z001

    Hi Guys, Can u please suggest me how can i read the text in object LFA1 with ID Z001. Actually my requirement is i have service agent in my internal table. Z002 is the current pro number..that is ready to use after using that update that current pro

  • Can not connect to a remote SSH server with my mac

    Ok have tried 4 different applications, fetch , captain ftp, terminal, etc. I am trying and connect to a friends ssh server to upload some file logs. I have the correct login/password, have tried both protocol 1 and 2. Port 22 is correct. I keep gett