|
沙发
楼主 |
发表于 2014-11-24 18:11:19
|
只看该作者
本帖最后由 zhouf 于 2014-11-24 18:13 编辑
配置电子邮件脚本示例:- DECLARE @smParameter TABLE(sParameterCategory NVARCHAR(20),sParameterNo NVARCHAR(30),sParameterName NVARCHAR(50),sParameterValue NVARCHAR(200));
- INSERT INTO @smParameter(sParameterCategory,sParameterNo,sParameterName,sParameterValue)
- SELECT N'SysEmail',N'smMailCompany',N'邮件发件人显示名',N'HUANSI ERP'
- UNION ALL SELECT N'SysEmail',N'smMailFrom',N'邮件发件人地址',N'huansi_erp@163.com'
- UNION ALL SELECT N'SysEmail',N'smMailSmtpHost',N'邮件Smtp主机',N'smtp.163.com'
- UNION ALL SELECT N'SysEmail',N'smMailSmtpPort',N'邮件Smtp端口',N'25'
- UNION ALL SELECT N'SysEmail',N'smMailTimeOut',N'邮件连接超时(秒)',N'60'
- UNION ALL SELECT N'SysEmail',N'smMailSign',N'邮件签名',N'(此邮件由“环思ERP系统”自动发出,请勿直接回复!)'
- UNION ALL SELECT N'SysEmail',N'smMailLogin',N'邮件登陆名',N'huansi_erp'
- UNION ALL SELECT N'SysEmail',N'smMailPassword',N'邮件登陆密码',N'92A1548EB074A841DB030524D9052FE715';
- UPDATE x SET
- sParameterCategory=a.sParameterCategory
- ,sParameterName=a.sParameterName
- ,sParameterValue=a.sParameterValue
- ,sParameterValueType=N'STRING'
- ,sOptionList='',sRemark=''
- FROM @smParameter a
- JOIN dbo.smParameter x(NOLOCK) ON x.sParameterNo=a.sParameterNo;
- INSERT INTO dbo.smParameter(uGUID,sParameterCategory,sParameterNo,sParameterName,sParameterValue,sParameterValueType,sOptionList,sRemark)
- SELECT newid(),a.sParameterCategory,a.sParameterNo,a.sParameterName,a.sParameterValue,N'STRING',N'',N''
- FROM @smParameter a
- WHERE NOT EXISTS(SELECT TOP 1 1 FROM dbo.smParameter x(NOLOCK) WHERE x.sParameterNo=a.sParameterNo);
复制代码 |
|