I have a DB running on SQL Server 2005 that has a user-defined data type. The user-defined data type is also implemented in the model database, so that when I create a temp table I can use the same user-defined data type.
For instance, in AppDB I have this datatype defined:
CREATE TYPE [dbo].[ product_code] FROM [varchar](8) NULL
And the exact same in Model:
CREATE TYPE [dbo].[ product_code] FROM [varchar](8) NULL
I’ve found that if the security login on my database instance has the sysadmin Server Role, then the user has no trouble calling stored procedures that create tables in tempdb using the product_code datatype—but if I remove sysadmin from the application security login, then the stored procedure call fails.
The same stored procedure call succeeds if I replace the user-defined datatype with the varchar system datatype throughout.
For security reasons I don’t want to add the sysadmin Server Role to the application security login—what options do I have if I want to continue using user-defined datatypes? Do these options change with SQL Server 2008?
Specifically, what permissions beyond those granted to public role are required? Answers that require edits to all stored procedures will be considered non-responsive.