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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:38:00+00:00 2026-06-13T17:38:00+00:00

In SSMS, I create a database using the following script. When the script execution

  • 0

In SSMS, I create a database using the following script. When the script execution completes, I would expect to see the CREATE TABLE statement in the sql_modules table. However I can’t find it.

CREATE DATABASE [MyDb]
GO 
USE [MyDb]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MyTable] (
    [UID] [uniqueidentifier] NOT NULL,
    [DateTime] [datetime] NOT NULL
)

Here’s the query I run the get the table definition. However, I get three empty result sets. Any idea why I am getting those three empty results set?

USE MyDb
GO

SELECT * 
FROM sys.sql_modules

SELECT * 
FROM sys.triggers

SELECT sm.object_id, OBJECT_NAME(sm.object_id) AS object_name, o.type, o.type_desc, sm.definition
FROM sys.sql_modules AS sm
JOIN sys.objects AS o ON sm.object_id = o.object_id
ORDER BY o.type;
  • 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-06-13T17:38:01+00:00Added an answer on June 13, 2026 at 5:38 pm

    To get columns and table information, this is a good place to start:

    SELECT c.*, t.*
    FROM sys.tables AS t
    INNER JOIN sys.columns AS c ON t.object_id = c.object_id
    INNER JOIN sys.schemas AS sch ON t.schema_id = sch.schema_id
    WHERE sch.name = 'dbo'
       AND t.name = 'YourTable'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I backed up my database table's and entire schema into .sql script using Visual
I'm unable to create database diagrams in a SS 2000 database using SSMS 2008.
Using SSMS Object Explorer to click through explorer tree against a database with many
I am using following code to attach my database to SQL Server. The problem
Please see the pic. I am attaching DBs using following code. Dim conn As
I am having trouble sending a SQL statement through a DbContext using context.Database.ExecuteSqlCommand() .
I am using SQLserver 2008 R2 edition. I am trying to create a database
Is any thing wrong if i create alter script on the entire database in
When I use SSMS to create an assembly dll, it generates a script like
This is from SQL Server 2008, ssms When I create a table, it creates

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.