File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ sqlcmd -S %_server% -d %_database% -U %_username% -P %_password% -I -i .\functio
5454sqlcmd -S %_server% -d %_database% -U %_username% -P %_password% -I -i .\functions\microsoft.lpad.sql
5555sqlcmd -S %_server% -d %_database% -U %_username% -P %_password% -I -i .\functions\microsoft.months_between.sql
5656sqlcmd -S %_server% -d %_database% -U %_username% -P %_password% -I -i .\functions\microsoft.next_day.sql
57+ sqlcmd -S %_server% -d %_database% -U %_username% -P %_password% -I -i .\functions\microsoft.rpad.sql
5758
5859ECHO Deploying views
5960
Original file line number Diff line number Diff line change 1+ IF EXISTS (SELECT * FROM sys .objects WHERE schema_id = SCHEMA_ID (' microsoft' ) AND name = N ' rpad' )
2+ DROP FUNCTION microsoft .rpad ;
3+ GO
4+
5+ CREATE FUNCTION microsoft .rpad (@expression VARCHAR (MAX ), @length INT , @fill VARCHAR (64 ) = ' ' )
6+ RETURNS VARCHAR (MAX )
7+ WITH SCHEMABINDING
8+ AS
9+ BEGIN
10+
11+ RETURN
12+ CASE
13+ WHEN (@length <= DATALENGTH(@expression)) THEN LEFT (@expression, @length)
14+ ELSE @expression + LEFT (REPLICATE (@fill, @length), ABS (@length - DATALENGTH(@expression)))
15+ END
16+
17+ END
18+ GO
You can’t perform that action at this time.
0 commit comments