У меня есть набор инструкций SQL, и я хочу получить точный вывод, используя скрипт powershell.Я совершенно не осведомлен о сценариях PS и SQL.Может кто-нибудь помочь мне, как это сделать?
\\\\\\\\\\\ КОД SQL \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
DECLARE @table_name SYSNAME
SELECT @table_name = 'Godzilla.Jobs'
DECLARE
@object_name SYSNAME
, @object_id INT
SELECT
@object_name = '[' + s.name + '].[' + o.name + ']'
, @object_id = o.[object_id]
FROM sys.objects o WITH (NOWAIT)
JOIN sys.schemas s WITH (NOWAIT) ON o.[schema_id] = s.[schema_id]
WHERE s.name + '.' + o.name = @table_name
AND o.[type] = 'U'
AND o.is_ms_shipped = 0
Etc....
\\\\\\\\\ ВЫХОД, КОТОРЫЙ ХОЧУ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\
CREATE TABLE [Godzilla].[Jobs]
(
[JobId] BIGINT NOT NULL
, [MacAddressWifi] NVARCHAR(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
, [SerialNumber] NVARCHAR(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
, [TrpId] NVARCHAR(50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
, [SniffsPackage] NVARCHAR(4000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
, [DecryptPackage] NVARCHAR(4000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
, [StatusID] INT NOT NULL
, [DateInsert] DATETIME NOT NULL
, [DateUpdate] DATETIME NULL
, [EstimatedTime] BIGINT NULL
, [Priority] BIGINT NULL
)