The following script creates a stored procedure (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
When the script above is ran, another script is ran that calls the stored procedure is called like so (runsproc.sql):
DECLARE @Names AS [SchemaName].[NameList]
INSERT INTO @Names -- Logic ...
EXEC [SchemaName].[AlterNameAccess]
@pNames = @Names
RoundhousE is used to run these scripts in order... locally RoundhousE will run these scripts correctly, however when running RoundhousE on Azure an error occurs when DECLARE @Names AS [SchemaName].[NameList]
is declared... saying the user defined type is not being defined despite it actually being defined.
Here is the error message RoundHousE provides:
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.