SQL Server Syntax Difficulties

Hey guys,

I'm used to RedShift and Postgres, but not SQL Server, and I'm having to do some work in SQL Server syntax now and am having trouble with a particular query.

I have a snippet that is a standalone query (not adding the query for company reasons) and it runs fine.  I.E.:
[spGetNewHirePaperworkReport]

But when I make a parent query around that subquery it bombs, citing the last character as the issue, both in Periscope and directly querying off of a server client.  I.E.:

select count(1)
from
  ([spGetNewHirePaperworkReport])

Any ideas what I'm missing here?  I haven't had luck isolating this with documentation or forums so far.

Thanks!

Brien

2replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hey Brien ! My guess is that you would need to alias the subquery like so:

     

    select count(1)
    from
      ([spGetNewHirePaperworkReport]) as t1

     

    Let me know if that works!

    Reply Like
  • Yup, all good now Neha Kumar thanks!

    Reply Like
Like Follow
  • Status Answered
  • 5 mths agoLast active
  • 2Replies
  • 10Views
  • 2 Following