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

  • Home
  • SEARCH
  • 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 941873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:11:02+00:00 2026-05-15T22:11:02+00:00

Coming from an Oracle background, Oracle’s SQLPlus would let you indicate a variable. If

  • 0

Coming from an Oracle background, Oracle’s SQLPlus would let you indicate a variable. If the variable wasn’t set, you’d be prompted to provide a value.

I’m using SQLCMD, using the $([var_name]) syntax. In SSMS SQLCMD mode, I get:

A fatal scripting error occurred.
Variable tbl_name is not defined.

…for trying to run:

SELECT COUNT(*) FROM $(tbl_name)

Does SQLCMD provide the same functionality as SQLPlus? If so, what am I doing wrong?

  • 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. Editorial Team
    Editorial Team
    2026-05-15T22:11:02+00:00Added an answer on May 15, 2026 at 10:11 pm

    SQLCMD does not support prompting for missing variable names. However, you can use SSMS in SQLCMD mode. Dunno how you’re error was caused, but this works for me:

    :setvar table "sys.tables"
    
    SELECT * FROM $(table);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 498k
  • Answers 498k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You have to call all methods necessary to actually start… May 16, 2026 at 12:22 pm
  • Editorial Team
    Editorial Team added an answer A quick test revealed that you need to omit the… May 16, 2026 at 12:22 pm
  • Editorial Team
    Editorial Team added an answer Modules are imported only once. Python realizes it already has… May 16, 2026 at 12:22 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am currently learning Cocoa. However I am coming from a traditional Sybase/Oracle background
I am new to MySQL coming from Oracle. I have a requirement to create
I'm coming to Postgres from Oracle and looking for a way to find the
Coming from SQL Server, I am learning some Oracle syntax. This is my table
I'm dealing with large numbers coming from the hash table. I'm wondering what would
i am new to c#. coming from mainly PHP background or basic VB. i
I am coming from the SQL server world where we had uniqueidentifier. Is there
coming from the Ocaml community, I'm trying to learn a bit of Haskell. The
Coming from Java , I'm used to the package structure (com.domain.appname.tier) Now I've started
I basically have this markup coming from my JSP. I add class in each

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.