这里的第一个问题是以下.我写了下面的代码,一切正常:
DECLARE @subject NVARCHAR(100)
SET @subject = 'Report executed on ' + CONVERT(VARCHAR(12), GETDATE(), 107)
SELECT @subject
Run Code Online (Sandbox Code Playgroud)
结果:报告于2012年8月17日执行
但是在设置msdb.dbo.sp_send_dbmail过程的参数时尝试连接前一个字符串时,它会失败
EXEC msdb.dbo.sp_send_dbmail @profile_name='XXX',
@recipients='XXXX@XXXXX.com',
@subject = 'Report executed on ' + CONVERT(VARCHAR(12), GETDATE(), 107),
@body= @tableHTML,
@body_format = 'HTML';
Run Code Online (Sandbox Code Playgroud)
我知道我可以声明并向参数发送一个变量,但我想了解为什么它在参数中直接连接时失败了.谢谢你的时间和知识
我有一个带有连续标签的XML文件,而不是嵌套标签,如下所示:
<title>
<subtitle>
<topic att="TopicTitle">Topic title 1</topic>
<content att="TopicSubtitle">topic subtitle 1</content>
<content att="Paragraph">paragraph text 1</content>
<content att="Paragraph">paragraph text 2</content>
<content att="TopicSubtitle">topic subtitle 2</content>
<content att="Paragraph">paragraph text 1</content>
<content att="Paragraph">paragraph text 2</content>
<topic att="TopicTitle">Topic title 2</topic>
<content att="TopicSubtitle">topic subtitle 1</content>
<content att="Paragraph">paragraph text 1</content>
<content att="Paragraph">paragraph text 2</content>
<content att="TopicSubtitle">topic subtitle 2</content>
<content att="Paragraph">paragraph text 1</content>
<content att="Paragraph">paragraph text 2</content>
</subtitle>
</title>
Run Code Online (Sandbox Code Playgroud)
我在BaseX中使用XQuery,我想将其转换为包含以下列的表:
Title Subtitle TopicTitle TopicSubtitle Paragraph
Irrelevant Irrelevant Topic title 1 Topic Subtitle 1 paragraph text 1
Irrelevant Irrelevant …Run Code Online (Sandbox Code Playgroud)