SSMS 2012:XQuery-doing "Retriving Job Candidates with the query Method" in AdventuresWorks 2012. Unclosed quotation mark after string '//*:Name.First?

Hi all,
From Page 354 of the the Book "Pro T-SQL 2008 Programmer's Guide" written by Michael Coles (published by apress), I copied the following code (Listing 12-9 Retrieving Job Candidates with the query Method):
--Coles12_9.sql // saved in C:/Documemnts/SQL Server Management Studio
-- Coles Listing 12-9 Retrieving Job Candidates with the query Method
-- Doing XQuery and the xml Data Type in AdvantureWorks
-- 17 March 2015 1105 AM
USE AdventureWorks;
GO
SELECT Resume.query
N'//*:Name.First,
//*:Name.Middle,
//*:Name.Last,
//*:Edu.Level
FROM HumanResources.JobCandidate;
I executed this set of Listing 12-9 code in my SQL Server 2012 Management Studio and I got the following error messages:
Msg 105, Level 15, State 1, Line 4
Unclosed quotation mark after the character string '//*:Name.First,
//*:Name.Middle,
//*:Name.Last,
//*:Edu.Level
FROM HumanResources.JobCandidate;
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near '//*:Name.First,
//*:Name.Middle,
//*:Name.Last,
//*:Edu.Level
FROM HumanResources.JobCandidate;
I am not able to figure out why I got the error messages.  Please kindly help and advise me how to correct this set of sql codes.
Thanks in advance,
Scott Chang

Hi Scott,
I don't have that book at hand, but your problem is the "Unclosed quotationmark after the character string",as the error message shows. You have to enclose the 'XQUERY' string quotation in the
query().
SELECT jobcandidateid, Resume.query
N'//*:resume,
//*:Name.Middle,
//*:Name.Last,
//*:Edu.Level' --enclose the quotation here
FROM HumanResources.JobCandidate;
For XQUERY learning, here is a good
link.
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support

Similar Messages

  • I have an ipad, when I watch a video the audio does not match up with the video, how can I fix this?

    I have an ipad and when I watch a video the audio does not match up with the video, how can I fix this?

    Hello there, graciecloyd.
    The following Knowledge Base article offers a few steps to try when an application is not functioning as expected:
    iOS: Understanding multitasking
    http://support.apple.com/kb/ht4211
    If an app doesn't respond to your input, or doesn't perform as expected, do the following, testing after each step:
    Check for app updates.
    Force the app to close.
    Restart your device.
    Update your iOS device.
    Learn more about troubleshooting apps.
    On Step 2, close all applicaitons that are open. On Step 3, if the restart doesn't help resolve the issue, you may also want to try the Reset step in that article as well.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Hi, My iPhone 4s does not work properly with the sound.

    Hi, My iPhone 4s does not work properly with the sound. It just ring. Any other app it doesn't make sound unless I have my headset or bluetooth. And it make me choose between "DOCK CONECTOR" or my "APPLE TV". Why? Or any sugestion plz

    Hi M3MB3R,
    Thanks for visiting Apple Support Communities.
    You may find the troubleshooting tips in this article helpful:
    iPhone: Sound muffled or low from the speaker or when speaking into the mic
    http://support.apple.com/kb/TS1631
    Cheers,
    Jeremy

  • Does anyone have trouble with the iPad booting you off of the internet?  I will be in the middle of something (i.e. Facebook), and it boots me out and I have to sign in again.

    Does anyone have trouble with the iPad booting you off of the internet?  I will be in the middle of something (i.e. Facebook), and it boots me out and I have to sign in again.

    Jon....
    Don't confuse the threads here with 'typical' experience.  Most of the stuff here is from brand new users, and those that have problems, and considering the 30 million pads in use, represent a very small sliver.
    If you are having repeated crashes it is really pretty basic.  You either have a physical problem with your pad, or you are using too much memory.
    The iOS system is supposed to monitor memory, and shut down previously used apps automatically to free up memory for what you are doing now.  That part of ios is not perfect, and if an app introduces an unexpected memory load, sometimes it gets over whelmed.  
    This happens, more often than not, when using safari with multiple windows open on graphic intense sites.  It can also happen with a memory intensive game, and residual apps in the background.
    Double  tap the home key and take a peek at the recently used list, and shut them down completely, and often the problem goes away.
    If the problem persists, you may have a software issue, and a trip to the genius bar may be in order.

  • Complete my album downloads the missing tracks but then does not place it with the existing tracks in iTunes. i have a single song bought sat on its own and an album with a track missing, any ideas?

    complete my album downloads the missing tracks but then does not place it with the existing tracks in iTunes. i have a single song bought sat on its own and an album with a track missing, any ideas?

    I had this same problem and started a thread, but for the most part nobody responded and those who did somehow didn't understand what the problem was.
    http://discussions.apple.com/message.jspa?messageID=11504935#11504935
    I'm sure the problem is sweat getting into the apple supplied headphone "remote." Basically even the smallest drop can slide down the wire and get into the unit.
    Unfortunately I haven't found a solution other than to get a Belkin remote adapter and some sport headphones. This doesn't give you voice over, but you can still control the volume, skip, etc.
    I've been doing this for a couple weeks now and it hasn't had a freak out since.

  • Does time machine work with the trash folder?

    Does time machine work with the trash folder? So if I have the entire aperture library backed up to the time machine. Is it safe to empty the trash folder in aperture? I am able to recover files from time machine later?

    So make a top-level Project called "_Circular File".  Put Images in there that you what to have out of your way but not discarded.
    It really is good and proper to treat the Trash as trash.  I instruct everyone to _empty_ the Aperture Trash at the end of _every_ session.  The reason is this: it is the only time you will remember whether it is safe to delete the items in there.  If you wait, you will then waste time trying to answer "Did I really mean to throw that out?" or, periodically, you'll give up trying to remember, and will empty the Trash without reviewing it.  At the end of every session, examine the Trash, confirm that the items there are trash, and empty it.
    Shocking, perhaps, but you should also empty your system trash every day.  The real-life equivalents are good guides here.  No-one in an office hoards their trash.  If you mean to throw something out, throw it out.  If you don't mean to throw it out, do not put it in the trash.
    I don't know how TM handles the Aperture Trash.  I do know, however, that I would not expect this behavior to remain consistent, and would absolutely recommend against a workflow based on it.

  • Does anyone have problems with the ipad 4 staying connected to century link Internet?

    Does anyone have problems with the ipad 4's wi if Internet staying connected to century links Internet??? Please help!!

    LOTS of people reporting a range of similar issues.
    https://discussions.apple.com/thread/6648856
    https://discussions.apple.com/thread/6574287

  • Does anyone have problems with the led light ?

    Does anyone have problems with the led light ?

    LOTS of people reporting a range of similar issues.
    https://discussions.apple.com/thread/6648856
    https://discussions.apple.com/thread/6574287

  • Does iMessage only work with the newest iPod Touch generation?

    Does iMessage only work with the newest iPod Touch generation or does it work with older ones as well?

    Any iPod Touch device that can be upgraded to iOS 5 will have iMessage. This means if you have a 3rd or 4th generation iPod Touch it will support iMessage.
    See this article on what features your iPod Touch supports
    http://support.apple.com/kb/HT4962

  • Does iTunes 12 work with the iPod Classic ?

    Does iTunes 12 work with the iPod Classic ?
    Or do I need to stay with iTunes 11.4 ?
    Thanks

    Thanks, ( you just got your first 10 points, congratulations! )
    Ever since the iPod Classic was discontinued I have stopped purchasing music on iTunes. So I did not have a compelling reason to upgrade.
    I have heard others having troubles and I got concerned that perhaps Apple had dropped support for the Classic on iTunes 12 because it was discontinued.
    Thanks for helping.

  • HT5312 What if it does not come up with the option to reset and you do have a rescue email address?

    On my account, when i select manage acount and go to password and security it does not come up with the option reset security questions and answers. Therefore i have been searching whole websites for days and contacting itunes yet i have not been told a solution yet. How do i reset it?

    You are sure that you have a rescue email address on your account and not just an alternate email address ? If it is a rescue address then you should be able to go tohttps://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you might see an option to send security question reset info to your rescue email address.
    If it's not a rescue email address then see if the instructions on this user tip helps :https://discussions.apple.com/docs/DOC-4551

  • Does nano 6g work with the remote (apple in-ear headphones)?

    Does nano 6g work with the remote (apple in-ear headphones)?
    Is it possible to change volume and skip tracks?

    Hello Homer,
    According to this page from Apple they are.
    http://www.apple.com/ipod/in-ear-headphones/
    B-rock

  • Does iphone 3g work with the AT&T Navigator

    Does iphone 3g work with the AT&T Navigator. They have a free 30 day trial
    thanks

    No, it only works on Windows Mobile devices or Blackberry's.

  • None of the dimension tables are compatible with the query request

    Hi,
    i am experiencing the below error while querying columns alone from employee dimension (w_employee_d) in workforce profile SA. There is only one column in my report which is employee number coming from employee dimension. when i query other information like job, region, location etc i am not getting any error. the below error appears only when querying columns from employee dimension. the content tab level for the LTS of employee dimension is set to employee detail.
         View Display Error
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 14077] None of the dimension tables are compatible with the query request Dim - Employee.Employee Number. (HY000)
    SQL Issued: SELECT 0 s_0, "Human Resources - Workforce Profile"."Employee Attributes"."Employee Number" s_1 FROM "Human Resources - Workforce Profile" FETCH FIRST 65001 ROWS ONLY.
    couldn't able to know the exact reason. Any suggestions would be highly appreciated.
    Regards.

    hi user582149,
    It is difficult to answer you question with such a little amount of details. Could you specify:
    - how many facts/dimensions are you using in the query?
    - what is the structure of your Business Model?
    - which version of OBI are you using?
    - what does your log say?
    I hope to tell you more having the information above
    Cheers

  • My Safari will not allow me to open my Google calendar with Google Apps. I have to open my email with the older version of Google Apps. This happened after I installed 5.1.4. I tried to use the fix of changing to 64 bit by unchecking the 32 bit box no go

    My Safari will not allow me to open my Google calendar with Google Apps. I have to open my email with the older version of Google Apps. This happened after I installed 5.1.4. I tried to use the fix of changing to 64 bit by unchecking the 32 bit box but that didnt help.

    I assume that there are legal restrictions on the way in which iTunes can get artwork automatically from any source apart from the iTunes Store (which is what the right-click > Get Album Artwork function uses).  For example, even though the Gracenote service that iTunes uses to match CDs and retrieve metadata (artist, album, track titles, etc.) also has artwork functions, iTunes does not make use of these.
    For manual addition of artwork, there are three cases where the image you select may not be correctly embedded in your media files:
    your media are in a format that doesn't accommodate embedded artwork - typically WAV files.  To embed artwork you'll need to convert to another format - Apple Lossless or AIFF if you want to preserve lossless quality, AAC or MP3 otherwise.
    your media files are read only - to fix this, use Windows Explorer to find the folder that contains your files, right-click and select Properties.  On the General tab there's a check box labeled "Read-only" - if this is checked, or is grey (sometimes blue), click the box so that the flag is unchecked and the box is white.  Click OK, and then OK again when the "Apply changes to this folder, subfolders and files" option selected.  Now try adding the artwork again.
    Windows permissions issues are preventing iTunes from updating your media files (there's some anecdotal evidence of a change in this behavior in iTunes 12).  See turingtest2's notes on Repair security permissions for iTunes for Windows for advice on fixing this, then try adding the artwork again.

Maybe you are looking for