#T-SQL, 164 bytes
T-SQL, 164 bytes
SELECT REPLICATE('M',n/1000)+IIF(n%1000>499,'D','')
+REPLICATE('C',n%500/100)+IIF(n%100>49,'L','')
+REPLICATE('X',n%50/10)+IIF(n%10>4,'V','')
+REPLICATE('I',n%5)
FROM t
Line breaks added for readability only.
This version is a lot longer (230 characters), but feels much more "SQL-like":
DECLARE @ INT,@r varchar(99)=''SELECT @=n FROM t
SELECT'I's,1v INTO m
INSERT m VALUES('V',5),('X',10),('L',50),('C',100),('D',500),('M',1000)
L:
SELECT @-=v,@r+=s
FROM m WHERE v=(SELECT MAX(v)FROM m WHERE v<=@)
IF @>0GOTO L
SELECT @r
Makes a table m with all the char-value mappings, and then loops through finding the largest value <= the number, concatenating the matching character.