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;