sql-server - 将 URL 作为参数传递的 T-SQL 在存储过程中不起作用
问题描述
我有以下两种情况,一种情况有效,另一种情况无效,我不确定出了什么问题。
我想实施的不工作案例:
exec[dbo].[test]
@Alias = 'test',
@Pipeline = 'testing_',
@SBU = 'Test',
@LoB = ' Test',
@SupportChannel = 'Test',
@Detail = 'testing personal version',
@Status = 0,
@Error = ' no error',
@Debug = 1
DECLARE @ReportURL NVARCHAR(MAX)
IF @Pipeline = 'testing_'
SET @ReportURL = N'https://powerbi.microsoft.com/en-us/'
IF @Pipeline = 'testing1_'
SET @ReportURL = N'https://www.microsoft.com/en-us/'
DECLARE @SuccessFooter NVARCHAR(MAX) = 'results can be found </br></br>' +
'<p><a href="'+@ReportURL+'" style="color: #FFFFFF"> Click here to view reports.</a></p>'
第二个相同的情况,我直接传递我不想做的 URL,因为我有多个链接传递给该参数。
exec[dbo].[test]
@Alias = 'test',
@Pipeline = 'testing_',
@SBU = 'Test',
@LoB = ' Test',
@SupportChannel = 'Test',
@Detail = 'testing personal version',
@Status = 0,
@Error = ' no error',
@Debug = 1
DECLARE @ReportURL NVARCHAR(MAX)
IF @Pipeline = 'testing_'
SET @ReportURL = N'https://powerbi.microsoft.com/en-us/'
IF @Pipeline = 'testing1_'
SET @ReportURL = N'https://www.microsoft.com/en-us/'
DECLARE @SuccessFooter NVARCHAR(MAX) = 'results can be found </br></br>' +
'<p><a href="https://powerbi.microsoft.com/en-us/" style="color: #FFFFFF"> Click here to view reports.</a></p>'
有谁知道如何解决这个问题?
我想动态传递链接。如果我通过 testing_ 它应该采用第一个链接,如果我通过 testing1_ 它应该采用第二个链接。
当我执行[dbo].[test]
时,这将给我发送一封电子邮件和相应网站的链接
解决方案
推荐阅读
- ruby-on-rails - 如何打印 Rails POST 请求输出?
- clickhouse - Clickhouse 物化视图是否支持来自多个物化视图的填充?
- swift - SwiftUI view animates at unexpected path
- blockchain - 在 1 笔交易中检索 Chainlink VRF 生成的随机数
- character-encoding - 如何防止 babel.js 将字符串编码为 unicode?
- excel - 使用 Robot Framework 同时打开两个 Excel 工作表
- spring-boot - “./gradlew bootRun --debug-jvm”无法正常工作
- wpf - 当我将模板添加到我的 MenuItem 时,为什么我的 MenuItem.Ressource 没有显示?
- safari - 我们如何使用适用于 ios 模拟器的 applescript 重置 safari devtools 的大小?
- flutter - 我的颤振应用程序图标未显示在手机应用程序列表中