Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 175693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:44:39+00:00 2026-05-11T13:44:39+00:00

Sorry everyone. It appears that I am a dumbass! The query works fine when

  • 0

Sorry everyone. It appears that I am a dumbass! The query works fine when I run it against the live database versus my test database…gotta pay more attention to that stuff!

I am having a problem with the statement shown below. It works fine if I run it against one database (sans the DBCATALOG.dbo), so no problem there. When I try running the statement as is, I get an incorrect syntax near ‘<’. I also tried using a tool to create a union for all of our databases (see second statement). This results in an invalid object name error (Invalid object name ‘TF7-User-Demo-ScheduledRestore-03.dbo.LinkedDocumentFolderTable’, Invalid object name ‘TF7-TestDatabase-ScheduledRestore.dbo.LinkedDocumentFolderTable’, etc.). It seems to be tied to the .[dbo], but I just don’t know what causes the problem. I can’t find anything in the book stating a count can’t be performed across multiple databases….

SELECT CNT=COUNT(*) FROM <DBCATALOG>.[dbo].[LinkedDocumentFolderTable] WHERE IsUnmanagedFolder = 1   SELECT 'TF7-User-Demo-ScheduledRestore-03' AS DBCatalog, * FROM(SELECT COUNT(*) FROM [TF7-User-Demo-ScheduledRestore-03].[dbo].[LinkedDocumentFolderTable] WHERE IsUnmanagedFolder = 1)rsOne  UNION ALL  SELECT 'TF7-TestDatabase-ScheduledRestore' AS DBCatalog, * FROM(SELECT COUNT(*) FROM [TF7-TestDatabase-ScheduledRestore].[dbo].[LinkedDocumentFolderTable] WHERE IsUnmanagedFolder = 1)rsOne 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T13:44:40+00:00Added an answer on May 11, 2026 at 1:44 pm

    Your syntax seems to be weird. Try next:

    SELECT 'TF7-User-Demo-ScheduledRestore-03' AS DBCatalog, COUNT(*)  FROM [TF7-User-Demo-ScheduledRestore-03].[dbo].[LinkedDocumentFolderTable]  WHERE IsUnmanagedFolder = 1 

    Also do you have all neccessary permissions set? (I’d better not ask, do you have such databases like TF7-User-Demo-ScheduledRestore-03 on same server present at all?)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry to bother everyone again. For some reason when I try to run the
Greetings, everyone: Firstly, sorry that my Flow description is long winded, but I think
everyone! My english is poor and sorry fot that. I want implement a function
IMPORTANT EDIT: Sorry everyone, i made a big mistake in the structure. char *name;
Sorry in advance everyone for this question as I know the cascading select boxes
Morning again..., Sorry to bother everyone but I need more help... I haven't done
everyone. I'm just starting with django, so sorry for a possibly stupid question. Imagine,
Sorry if this is a dup; I haven't found any questions that pose quite
First of all, sorry about the title -- I couldn't figure out one that
Sorry everyone, I really can't find any better title for my question. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.