系统表master..spt_values的目的是什么,它的值的含义是什么? [英] What is the purpose of system table master..spt_values and what are the meanings of its values?

查看:294
本文介绍了系统表master..spt_values的目的是什么,它的值的含义是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

系统表master..spt_values的目的是什么?

为什么它提供了,应该如何使用它?

What is the purpose of system table master..spt_values?
Why was it provided and how one should use it?

其类型,低值,高值的含义是什么?

What are the meanings of its type, low, high values?

更新:

Google搜索提供数千种其用途,例如:

Update:
Google search gives thousands of " its uses", for example:

有些帖子警告它的使用,因为它可以在将来版本的SQL Server中被删除但是已经有代码脚本使用它来演示新的SQL Server 11(Denali)的新功能:

Some posts warn against its use since it can be removed in future versions of SQL Server but there are already code scripts using it to illustrate new features of new SQL Server 11 (Denali):

推荐答案

spt_values 表在SQL Server文档中没有提及,但它可以追溯到Sybase日,而有一些极少的文档

The spt_values table is not mentioned in the the SQL Server documentation but it goes back to the Sybase days and there is some extremely minimal documentation in the Sybase online docs that can be summed up in this comment:


要查看如何使用它,请执行sp_helptext,并查看引用它的系统过程之一
的文本。

To see how it is used, execute sp_helptext and look at the text for one of the system procedures that references it.

换句话说,读取代码并自己编写。

In other words, read the code and work it out for yourself.

如果您扼制系统存储过程并检查表数据本身,则很清楚该表用于将代码转换为可读字符串(除其他外)。或者正如上面链接的Sybase文档所说,将内部系统值[...]转换成人类可读格式

If you poke around the system stored procedures and examine the table data itself, it's fairly clear that the table is used to translate codes into readable strings (among other things). Or as the Sybase documentation linked above puts it, "to convert internal system values [...] into human-readable format"

表也是有时使用,但从未在正式文档中 - 通常为数字列表的方便来源。但是如其他地方所讨论的,创建自己的数字来源更安全,更多可靠的解决方案比使用未记录的系统表。甚至有一个Connect请求可以提供一个正确的记录数字表格SQL Server本身。

The table is also sometimes used in code snippets in MSDN blogs - but never in formal documentation - usually as a convenient source of a list of numbers. But as discussed elsewhere, creating your own source of numbers is a safer and more reliable solution than using an undocumented system table. There is even a Connect request to provide a 'proper', documented number table in SQL Server itself.

无论如何,表完全没有文档,所以在了解任何事情方面没有什么重要价值,至少从实际的角度来看:下一个servicepack或升级可能会完全改变它。知识的好奇心当然是: - )

Anyway, the table is entirely undocumented so there is no significant value in knowing anything about it, at least from a practical standpoint: the next servicepack or upgrade might change it completely. Intellectual curiosity is something else, of course :-)

这篇关于系统表master..spt_values的目的是什么,它的值的含义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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