如何在动态查询中连接uniqueidentifier [英] how to concatenate uniqueidentifier in a dynamic query

查看:149
本文介绍了如何在动态查询中连接uniqueidentifier的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个动态查询,其中我想连接唯一标识符,但+和&运算符不支持这一点,是否有一种方式可以将uniqueidentifier连接到动态字符串。任何样本或任何帮助在这方面将被高度评价。

解决方案

你是否试图将字符串转换为字符串,然后连接?

  CAST(NEWID()AS NVARCHAR(36))
pre>

I have a dynamic query in which I want to concatenate uniqueidentifier, but + and & operators are not supporting this, is there a way I can concatenate uniqueidentifier to a dynamic string. Any sample or any help in this regard will be highly appricated.

解决方案

Have you tried casting or converting to a string first, then concating?

CAST(NEWID() AS NVARCHAR(36))

这篇关于如何在动态查询中连接uniqueidentifier的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆