以下脚本创建一个存储过程 (mysproc.sql):
/* A table type with 1 column (NVARCHAR(200)) of names */
CREATE TYPE [SchemaName].[NameList] AS TABLE(
[Name] [NVARCHAR](200)
)
GO
ALTER PROCEDURE [SchemaName].[AlterNameAccess]
@pNames AS [SchemaName].[NameList] READONLY
AS
BEGIN
-- Logic Here ...
END
GO
运行上面的脚本时,会运行另一个调用存储过程的脚本,如下所示(runsproc.sql):
DECLARE @Names AS [SchemaName].[NameList]
INSERT INTO @Names -- Logic ...
EXEC [SchemaName].[AlterNameAccess]
@pNames = @Names
RoundhouseE 用于按顺序运行这些脚本......在本地 RoundhouseE 将正确运行这些脚本,但是当在 Azure 上运行 RoundhouseE 时,声明时会发生错误DECLARE @Names AS [SchemaName].[NameList]
......说用户定义的类型没有被定义,尽管它实际上是被定义的。
这是 RoundHouse 提供的错误消息:
2019-09-17 18:52:04,358 [INFO ] - Running runsproc.sql on (local)
2019-09-17 18:52:06,686 [ERROR] -
*** Error executing file 'runsproc.sql'. ***
2019-09-17 18:52:06,701 [ERROR] - Database deployment encountered an error. You were running in a transaction though, so the database should be in the state it was in prior to this piece running. This does not include a drop/create or any creation of a database, as those items can not run in a transaction.
System.Data.SqlClient.SqlException: Column, parameter, or variable #4: Cannot find data type SchemaName.NameList.
Must declare the table variable "@Names".
Must declare the table variable "@Names".
Parameter or variable '@Names' has an invalid data type.