如何在SQL Server 2008中插入数学符号 [英] How to insert maths symbol in sql server 2008

查看:103
本文介绍了如何在SQL Server 2008中插入数学符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个奇怪的查询,我需要在sql server 2008中插入数学问题.我所拥有的是我在excel工作表中有很多数学问题,而且它们都是纯文本问题,我需要像符号问题一样.符号等.

我所做的是在Excel工作表中插入对象类型,并且平方根符号在Excel工作表中显示为图像.

现在,我需要在sql server 2008中插入该问题的符号.

这怎么可能??请帮我解决这个问题..


预先感谢,

问候,
Krunal panchal

Hello everyone,

I have one odd query that i need to insert maths question into sql server 2008. what i have is i have lots of question of maths in excel sheet, moreover they all are plain text question and i need like symbolic question.. like square root symbol etc.

what i have done is inserted object type in excel sheet and the square root symbol appears as an image in excel sheet.

Now i need the symbol in sql server 2008 for the question to be inserted.

How is this possible?? please help me out in making this possible..


Thanks in advance,

Regards,
Krunal panchal

推荐答案

SQL Server在列中支持Unicode字符,您可以使用N''...''前缀进行查询.
SQL Server supports Unicode characters in columns, and you can query using the N''...'' prefix.


嗨在那里,

试试这个

DECLARE @table AS表(v3 nvarchar(50));
DECLARE @ v3 nvarchar(50)=''有一个值''+N''≥''
插入@table值(@ v3);
SET @ v3 = N''≧''
插入@table值(@ v3);
SET @ v3 =N''π至π*''
插入@table值(@ v3);
SELECT * FROM @table;

我也在寻找从前端保存的解决方案.

如果找到,也请告诉我.

谢谢
Gurpreet Deol
Hi there,

try this

DECLARE @table AS Table (v3 nvarchar(50));
DECLARE @v3 nvarchar(50)=''There is a value ''+N''≥''
INSERT INTO @table VALUES (@v3);
SET @v3 =N''≧''
INSERT INTO @table VALUES (@v3 );
SET @v3 =N''π to π*''
INSERT INTO @table VALUES (@v3 );
SELECT * FROM @table;

I''m also finding solution to save from front end.

If you find please tell me too.

Thanks
Gurpreet Deol


http ://social.msdn.microsoft.com/Forums/zh-CN/transactsql/thread/1c55b874-75bf-4abf-8c34-8c4d0f1071bc [
http://social.msdn.microsoft.com/Forums/en/transactsql/thread/1c55b874-75bf-4abf-8c34-8c4d0f1071bc[^]
or try this:
--------------------TABLE-------------------

create table MATH(id int,equation varchar(1000))
insert MATH
select 1,''POWER(x+1,2)'' UNION ALL -- (x+1)^2
select 2,''COS(x)'' -- Cosinus(x)

--------------------QUERY-------------------

declare @query nvarchar(1000)
declare @Result Float
declare @id int
declare @x float
set @x=0.5
set @id=1
set @query=(select equation from MATH where Id=1)
set @query=''select ROUND(''+replace(@query,''x'',CAST(@x as varchar(50))+''000'')+'',5)''
exec(@query)
--RESULTS----------------------
--(0.5+1)^2=2.2500
-------------------------------
set @query=(select equation from MATH where Id=2)
set @query=''select ROUND(''+replace(@query,''x'',CAST(@x as varchar(50))+''000'')+'',5)''
exec(@query)
--RESULTS----------------------
--cos(0.5)=0,87758
-------------------------------


这篇关于如何在SQL Server 2008中插入数学符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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