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 7077567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:26:21+00:00 2026-05-28T06:26:21+00:00

In Sql Server 2005, I have a stored procedure, in which i have wrote

  • 0

In Sql Server 2005,
I have a stored procedure, in which i have wrote some commands to create a table and add some records in it.

Create Procedure Procedure1 AS 
Begin
    create table TmpTable(CD Decimal(10,0), Descr Varchar(50));
    Insert Into TmpTable Values(0,'Not Applicable');
    Insert Into TmpTable Values(1,'ALL');
    Insert Into TmpTable Values(2,'Selected');
    Insert Into TmpTable Values(3,'Only New');
END

i want to create this table in all available databases, i don’t know, how many databases are available when i call this store procedure.

  • 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-28T06:26:21+00:00Added an answer on May 28, 2026 at 6:26 am

    You can try looping through the list of Databases on your server using a cursor and then inside the loop for the cursor doing the above code. SQL Server through its Master database which every server instance has has functions in it that you can call to get system vise information.

    Ive done some thing in the past.

    Try having a look at this link, hopefully it will be useful to you:

    http://sqlserverplanet.com/tsql/list-all-tables-in-a-database/

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

Sidebar

Related Questions

SQL Server 2005. I have a stored procedure which accepts a few parameters that
I have a stored procedure on a SQL Server 2005 database which has a
I have created a stored procedure in SQL Server 2005, also I create another
I have a stored procedure in SQL Server 2005 which accepts few parameters of
I have a stored procedure on SQL Server 2005. It is pulling from a
Let's say I have a stored procedure in Microsoft SQL Server 2005 that returns
I'm working on SQL server 2005 and I have a very simple stored procedure:
I have a very long-running stored procedure in SQL Server 2005 that I'm trying
I have a stored proc in SQL Server 2005, which looks like the following
i have this procedure for inserting rows in tables(sql server 2005) CREATE PROCEDURE ans_insert

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.