블로그 이미지
SQL Server VS. 석이 minsouk@hotmail.com MSSQL 쿼리성능 관련해 궁금한 사항이 있다면 언제나 누구나 TeamViewer + Line (네이버 japan 메신저) 에 minsouk1 추가 후 연락주세요~ 010-9967-0955 보미아빠

카테고리

보미아빠, 석이 (446)
밥벌이 (16)
싸이클 (1)
일상 (1)
Total211,711
Today13
Yesterday45

달력

« » 2018.05
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

공지사항

'2018/05'에 해당되는 글 2건

  1. 2018.05.29 function base n
  2. 2018.05.17 bmw ista+

function base n

분류없음 / 2018.05.29 18:07

/****** Object:  UserDefinedFunction [dbo].[F_NUMERIC_TO_BASE_N]    Script Date: 5/29/2018 6:07:05 PM ******/

SET ANSI_NULLS ON

GO


SET QUOTED_IDENTIFIER ON

GO


create function [dbo].[F_NUMERIC_TO_BASE_N]

(

@Number numeric(32,0),

@Base int

)

returns varchar(110)

as


/*

Function: F_NUMERIC_TO_BASE_N


Function F_NUMERIC_TO_BASE_N converts a numeric(32,0) value, @Number,

to a string of digits in number base @Base,

where @Base is between 2 and 36.


Output digits greater than 9 are represented by

uppercase letters A through Z, where A = 10 through Z = 35.

 

If input parameter @Number is negative, the output string

will have a minus sign in the leftmost position.


Any non-null numeric(32,0) value for parameter @Number is valid:

-99999999999999999999999999999999 through

99999999999999999999999999999999.


If input parameters @Number or @Base are null,

or @Base is not between 2 and 36,

then the function returns a null value.

*/


begin


declare @Work_Number numeric(38,0)

declare @Modulus int

declare @Digits varchar(36)

declare @Output_String varchar(110)


if @Number is null or @Base is null or @Base < 2 or @Base > 36 

begin

return null

end


set @Digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'

set @Output_String = ''

set @Work_Number = @Number


while 1=1  

begin


Set @Modulus = convert(int,abs(@Work_Number-(round(@Work_Number/@Base,0,1)*@Base)))


set @Output_String = substring(@Digits,@Modulus+1,1) + @Output_String


set @Work_Number = round(@Work_Number/@Base,0,1)


if @Work_Number = 0 break

end -- end while


if @Number < 0 set @Output_String = '-'+@Output_String


return @Output_String


end

GO










declare @times bigint = 1

declare @top_count bigint = 1000


select  dbo.[F_NUMERIC_TO_BASE_N](@times * 100000000 + rn * 1000 , 32)

from 

(

select top (@top_count) row_number() over (order by (select 1)) rn 

from sysobjects a 

cross join sysobjects b 

cross join sysobjects c

) a



Posted by 보미아빠

bmw ista+

분류없음 / 2018.05.17 20:16

https://m.blog.naver.com/PostView.nhn?blogId=lauf1&logNo=220781453020&proxyReferer=https%3A%2F%2Fwww.google.co.kr%2F



ista-d torrent


Posted by 보미아빠

최근에 달린 댓글

최근에 받은 트랙백

글 보관함