Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Q: What is the sound of one value coalescing?

Q: What is the sound of one value coalescing?

Scheduled Pinned Locked Moved The Weird and The Wonderful
questiondatabasesql-serversysadminlearning
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PIEBALDconsult
    wrote on last edited by
    #1

    A: It goes BOOM! SQL Server 2008 R2 I was just altering some of my code to choose betewen two values via COALESCE. Then I decided I might want to back out the change, but I wanted to leave the existing code in case I wanted to reapply the change later. So I had something like COALESCE ( /* X , */ Y ) Z -- of course, it makes no sense to COALESCE on one value, but I was only going to leave it there momentarily and I don't mind causing errors in order to advance my knowledge of the syntax. The result is Incorrect syntax near ')'. -- I thought that was an odd message. I checked the documentation: COALESCE ( expression [ ,...n ] ) -- so the syntax should be legal! :wtf: But it also goes on to say that COALESCE is equivalent to a CASE and my attempts at CASE (WHEN Y IS NOT NULL) THEN Y END Z CASE ELSE Y END Z have been unsatisfactory. :sigh:

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups