Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSmaptype

  No additional text.


Syntax

create procedure sys.sp_MSmaptype (@type nvarchar(258) output,
                                @len smallint,
                                @prec int,
                                @scale int)
as
    declare @typeout nvarchar(258)

select @typeout = case @type
    when 'binary' then 'varbinary'
    when 'char' then 'varchar'
    when 'nchar' then 'nvarchar'
    when 'datetimn' then 'datetime'
    when 'decimaln' then 'decimal'
    when 'floatn' then 'float'
    when 'intn' then 'int'
    when 'moneyn' then 'money'
    when 'numericn' then 'numeric'
    when 'timestamp' then 'varbinary'
    when 'bit' then 'tinyint'
    else @type  --for user defined data type which may contain space in between
    END


-- Quote UDTs.  Systems types are left alone as there are a number of places where we do
--  text based name comparisons for system types.

if exists (select * from sys.types where name = @typeout and is_user_defined = 1)
begin
	select @typeout = quotename(@typeout)
end

-- append length or scale and precision if needed
if (@typeout = 'varbinary' or @typeout = 'varchar' or @typeout = 'nvarchar')
begin
    if @len=0 or @len=-1
        select @type = @typeout + '(max)'
    else
        select @type = @typeout + '(' + rtrim(convert(nchar, @len)) + ')'
    return
end
if (@typeout = 'numeric' or @typeout = 'decimal')
begin
    select @type = @typeout + '(' + rtrim(convert(nchar, @prec)) + ',' +
            rtrim(convert(nchar, @scale)) + ')'
    return
end

select @type = @typeout

 
Last revision 2008RTM
See also

  sp_MSAdjustConflictTable (Procedure)
sp_MScreatelightweightinsertproc (Procedure)
sp_MScreatelightweightupdateproc (Procedure)
sp_MSdrop_rlcore (Procedure)
sp_MShelpalterbeforetable (Procedure)
sp_MShelpcreatebeforetable (Procedure)
sp_MSmakebatchinsertproc (Procedure)
sp_MSmakebatchupdateproc (Procedure)
sp_MSmakeconflictinsertproc (Procedure)
sp_MSmakeinsertproc (Procedure)
sp_MSmakeupdateproc (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash