Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_db_vardecimal_storage_format

  No additional text.


Syntax
create procedure sys.sp_db_vardecimal_storage_format	
	@dbname sysname = NULL,			-- database name to change
	@vardecimal_storage_format  varchar(3) = NULL	-- vardecimal format to turn on/off
as
	set nocount    on

	-- If db name is not given, enumerate all databases and print out their vardecimal state
	if @dbname is null
	begin
		select name as 'Database Name',
		(case
			when name in ('master', 'tempdb', 'model', 'msdb') then 'OFF'
			else 'ON'
		end) as 'Vardecimal State'
		from master.dbo.sysdatabases

		return (0)
	end
	
	--  Verify the database name and get info
	declare @dbid int
	select @dbid = dbid
		from master.dbo.sysdatabases
		where name = @dbname

	--  If @dbname not found, say so and list the databases.
	if @dbid is null
	begin
		raiserror(15010,-1,-1,@dbname)
		print ' '
		select 'Available databases:' = name
			from master.dbo.sysdatabases
		return (1)
	end

	-- The value specified must be 'ON' or 'OFF'.
	if @vardecimal_storage_format is not null and lower(@vardecimal_storage_format) not in ('on', 'off')
	begin
		raiserror(15229,-1,-1)
		return (1)
	end

	-- Determine whether it's a system database.
	declare @is_system_db bit
	if @dbname in ('master', 'tempdb', 'model', 'msdb')
		set @is_system_db = 1
	else
		set @is_system_db = 0

	if @vardecimal_storage_format is null
	begin
		-- Return ON or OFF based on whether the db is a system database.
		select @dbname as 'Database Name',
			(case
				when @is_system_db = 1 then 'OFF'
				else 'ON'
			end) as 'Vardecimal State'
		
		return (0)
	end

	-- Not supported in system databases.
	if @is_system_db = 1
	begin
		raiserror(15657, -1, -1, @dbname)
		return (1)
	end

	return (0) -- sp_db_vardecimal_storage_format

 
Last revision 2008RTM
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