June 2, 2008 at 6:04 am
hi,
i want to get the schema for a table on a function, I use to have this on other SP as following:-
DECLARE @RESULT VARCHAR(100);SET @RESULT=''
DECLARE @mpq int;SET @mpq=0
DECLARE @FILENAME VARCHAR(40);SET @FILENAME='parm'
SELECT @RESULT =SCHEMA_NAME((SELECT SCHEMA_ID FROM SYS.TABLES WHERE NAME=@FILENAME)+'.'
SELECT @MPQ = SELECT MPQ FROM @RESULT + 'PARM'
after that to use the result to get a value form on select statment
Thanks for any help.
Best Regards
June 2, 2008 at 7:46 am
Not sure what you mean by the schema for a file. Do you mean for a table? (It looks like that's what your code is meant to do.)
If so, then take a look at sys.tables.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply