DECLARE @PR棜楌No int
DECLARE @彜昳No int
DECLARE @屭媞No int
DECLARE @搊榐僗僞僢僼No int
DECLARE @峀崘No int
DECLARE @僾儘儌乕僔儑儞梊掕No int
DECLARE @僾儘儌乕僔儑儞幚愌No int
DECLARE @PR嬫暘No int
DECLARE @憤旓梡 int
DECLARE @懳徾彜昳憤悢 int
DECLARE @懳徾婛懚屭媞憤悢 int
DECLARE @桳岠擔悢撪偺憤攧忋 int
DECLARE @怴婯屭媞妉摼悢 int
DECLARE @尒崬屭媞妉摼悢 int
DECLARE @孈婲偟屭媞悢 int
DECLARE @峏怴僗僞僢僼No int
DECLARE @擭 int
DECLARE @擭寧 int
DECLARE @寧 int
DECLARE @F int
DECLARE @M int
DECLARE @僐儞僞僋僩棜楌No int
DECLARE @僶僂儞僪No int
DECLARE @僣乕儖No int
DECLARE @僐儞僞僋僩僗僞僢僼No int
DECLARE @僗僞僢僼No int
DECLARE @栶怑No int
DECLARE @尃尷No int
DECLARE @夋柺No int
DECLARE @嬫暘 int
DECLARE @壜晄壜 int
DECLARE @PR柤 varchar
DECLARE @峀崘柤 varchar
DECLARE @撪梕 varchar
DECLARE @扴摉幰柤 varchar
DECLARE @TEL varchar
DECLARE @FAX varchar
DECLARE @儊乕儖傾僪儗僗 varchar
DECLARE @URL varchar
DECLARE @旛峫 varchar
DECLARE @憖嶌抂枛柤 varchar
DECLARE @憖嶌僗僞僢僼巵柤 varchar
DECLARE @憖嶌夋柺 varchar
DECLARE @憖嶌撪梕 varchar
DECLARE @審柤 varchar
DECLARE @杮暥 varchar
DECLARE @僗僞僢僼ID varchar
DECLARE @僷僗儚乕僪 varchar
DECLARE @巵柤 varchar
DECLARE @抣 varchar
DECLARE @岞奐梊掕擔 datetime
DECLARE @岞奐幚巤擔 datetime
DECLARE @梊掕婜娫fr datetime
DECLARE @梊掕婜娫to datetime
DECLARE @岞奐梊掕擔fr datetime
DECLARE @岞奐梊掕擔to datetime
DECLARE @岞奐幚巤擔fr datetime
DECLARE @岞奐幚巤擔to datetime
DECLARE @幚巤婜娫fr datetime
DECLARE @幚巤婜娫to datetime
DECLARE @媥柊懳徾擔 datetime
DECLARE @斕攧擔帪fr datetime
DECLARE @斕攧擔帪to datetime
DECLARE @憖嶌擔fr datetime
DECLARE @憖嶌擔to datetime
DECLARE @僐儞僞僋僩擔帪 datetime

SET @PR棜楌No = 1
SET @彜昳No = 1
SET @屭媞No = 1
SET @搊榐僗僞僢僼No = 1
SET @峀崘No = 1
SET @僾儘儌乕僔儑儞梊掕No = 1
SET @僾儘儌乕僔儑儞幚愌No = 1
SET @PR嬫暘No = 1
SET @憤旓梡 = 1
SET @懳徾彜昳憤悢 = 1
SET @懳徾婛懚屭媞憤悢 = 1
SET @桳岠擔悢撪偺憤攧忋 = 1
SET @怴婯屭媞妉摼悢 = 1
SET @尒崬屭媞妉摼悢 = 1
SET @孈婲偟屭媞悢 = 1
SET @峏怴僗僞僢僼No = 1
SET @擭 = 1
SET @擭寧 = 1
SET @寧 = 1
SET @F = 1
SET @M = 1
SET @僐儞僞僋僩棜楌No = 1
SET @僶僂儞僪No = 1
SET @僣乕儖No = 1
SET @僐儞僞僋僩僗僞僢僼No = 1
SET @僗僞僢僼No = 1
SET @栶怑No = 1
SET @尃尷No = 1
SET @夋柺No = 1
SET @嬫暘 = 1
SET @壜晄壜 = 1
SET @PR柤 = 'a'
SET @峀崘柤 = 'a'
SET @撪梕 = 'a'
SET @扴摉幰柤 = 'a'
SET @TEL = 'a'
SET @FAX = 'a'
SET @儊乕儖傾僪儗僗 = 'a'
SET @URL = 'a'
SET @旛峫 = 'a'
SET @憖嶌抂枛柤 = 'a'
SET @憖嶌僗僞僢僼巵柤 = 'a'
SET @憖嶌夋柺 = 'a'
SET @憖嶌撪梕 = 'a'
SET @審柤 = 'a'
SET @杮暥 = 'a'
SET @僗僞僢僼ID = 'a'
SET @僷僗儚乕僪 = 'a'
SET @巵柤 = 'a'
SET @抣 = 'a'
SET @岞奐梊掕擔 = '2002/1/11'
SET @岞奐幚巤擔 = '2002/1/11'
SET @幚巤婜娫fr = '2002/1/11'
SET @幚巤婜娫to = '2003/7/11'
SET @媥柊懳徾擔 = '2001/7/15'
SET @梊掕婜娫fr = '2001/7/15'
SET @梊掕婜娫to = '2001/7/15'
SET @岞奐梊掕擔fr = '2002/1/11'
SET @岞奐梊掕擔to = '2002/1/11'
SET @岞奐幚巤擔fr = '2002/1/11'
SET @岞奐幚巤擔to = '2002/1/11'
SET @斕攧擔帪fr = '2002/1/11'
SET @斕攧擔帪to = '2002/1/11'
SET @憖嶌擔fr = '2002/1/11'
SET @憖嶌擔to = '2002/1/11'
SET @僐儞僞僋僩擔帪 = '2002/1/11'



---- Fill
--SELECT
--	M07慻怐僗僞僢僼.儐乕僓乕No, 
--	M07慻怐僗僞僢僼.僗僞僢僼ID, 
--	M07慻怐僗僞僢僼.僷僗儚乕僪, 
--	M07慻怐僗僞僢僼.栶怑No, 
--	M04摦揑懏惈.抣 AS 栶怑柤, 
--	M07慻怐僗僞僢僼.僯僢僋僱乕儉, 
--	M07慻怐僗僞僢僼.尃尷No, 
--	M01屌掕懏惈.抣 AS 尃尷柤,
--	M07慻怐僗僞僢僼.旛峫
--FROM
--	M07慻怐僗僞僢僼 INNER JOIN
--	M04摦揑懏惈 ON M07慻怐僗僞僢僼.栶怑No = M04摦揑懏惈.摦揑懏惈No INNER JOIN
--	M01屌掕懏惈 AS M01屌掕懏惈 ON M07慻怐僗僞僢僼.尃尷No = M01屌掕懏惈.屌掕懏惈No
--WHERE
--	M07慻怐僗僞僢僼.慻怐No = @慻怐No
SELECT
	M07僗僞僢僼.僗僞僢僼No,
	M07僗僞僢僼.僗僞僢僼ID, 
	M07僗僞僢僼.僷僗儚乕僪,
	M07僗僞僢僼.栶怑No,
	M04懏惈.抣 AS 栶怑柤, 
	M07僗僞僢僼.巵柤,
	M07僗僞僢僼.尃尷No,
	M04懏惈_1.抣 AS 尃尷柤, 
	M07僗僞僢僼.旛峫
FROM
	M07僗僞僢僼 INNER JOIN
	M04懏惈 ON M07僗僞僢僼.栶怑No = M04懏惈.懏惈No INNER JOIN
	M04懏惈 AS M04懏惈_1 ON M07僗僞僢僼.尃尷No = M04懏惈_1.懏惈No
