易截截图软件、单文件、免安装、纯绿色、仅160KB

用SQL语句从aspnet_profile表里取用户的Profile值

The aspnet_Profile table contains the following fields: UserId, PropertyNames, PropertyValuesString, PropertyValuesBinary,  and LastUpdatedDate. The PropertyNames field contains a string delimited with colons (:) that identify which profile fields are stored, what their datatype is and their offset and length.
For Example:
FirstName:S:1:7:PostalCode:S:8:5:Street:S:13:15:LastName:S:28:7:
Actual values stored in PropertyValuesString:
Viktar 601481336 Finley rd Karpach
ASP.Net profiles can store binary data as well, but usually your are interested in string data such as First and Last names. First lets create helper function, which helps to get position:length pair values:
CREATE FUNCTION dbo.fn_GetElement
(
@ord AS INT,
@str AS VARCHAR(8000),
@delim AS VARCHAR(1) )
 
RETURNS INT
AS
BEGIN
  -- If input is invalid, return null.
  IF @str IS NULL
      OR LEN(@str) = 0
      OR @ord IS NULL
      OR @ord < 1
      -- @ord > [is the] expression that calculates the number of elements.
      OR @ord > LEN(@str) - LEN(REPLACE(@str, @delim, '')) + 1
    RETURN NULL
  DECLARE @pos AS INT, @curord AS INT
  SELECT @pos = 1, @curord = 1
  -- Find next element's start position and increment index.
  WHILE @curord < @ord
    SELECT
      @pos    = CHARINDEX(@delim, @str, @pos) + 1,
      @curord = @curord + 1
  RETURN
  CAST(SUBSTRING(@str, @pos, CHARINDEX(@delim, @str + @delim, @pos) - @pos) AS INT)
END
 
And then code for the actual worker function:
CREATE FUNCTION dbo.fn_GetProfileElement
(
@fieldName AS NVARCHAR(100),
@fields AS NVARCHAR(4000),
@values AS NVARCHAR(4000))
 
RETURNS NVARCHAR(4000)
AS
BEGIN
  -- If input is invalid, return null.
  IF @fieldName IS NULL
&nb


相关文档:

ASP.NET2.0分页技术之使用纯sql语句的双top分页篇

Repeater在前台使用比较灵活自由,但有一个问题就是Repeater不支持直接分页,这个很多人看起来就有点不想用了,但我想大家都知道GridView控件或DataGrid控件在启用自带分页的时候其实效率是非常低的,大的不说,一但到了百万级数据以后,就会感觉是多么的痛苦和无耐了,所以即使是用DataGrid(GridView)控件,高手们还是只会 ......

总结经典常用的SQL语句(2)

向表中添加一个新记录,你要使用SQL INSERT 语句。
这里有一个如何使用这种语句的例子:
INSERT mytable (mycolumn) VALUES (‘some data’)
这个语句把字符串’some data’插入表mytable的mycolumn字段中。将要被插入数据的字段的名字在第一个括号中指定,实际的数据在第二个括号中给出。
I ......

PL/SQL 001

在 Oracle 10g  中 
可以通过 http://localhost:5560/isqlplus 访问 isqlplus 
在 isqlplus 中 可以执行 plsql
set serveroutput on size 100000   // 打开 服务器的输出  on 后面是 缓存的大小 范围是  (2000 至 1000000)
begin
   dbms_output.put_line('hel ......

SQL 2008 体验第一波

从2000开始就是MS SQL家的忠实用户了,2000的时候我是从一本2000宝典开始入门的,从2000到2005经历了很长时间,很多的用户至今还死死的守着2000,如果不是工程要求,估计我也不会主动换到2005,然而眼睛一眨,2008又出来了,哀叹,2005的功能我都没有摸透呢。
2008与2005的对比
1.慢,什么都慢,从恢复数据库,到导入数据 ......

查看Oracle表空间使用情况SQL语句

 select f.tablespace_name,a.total,u.used,f.free,round((u.used/a.total)*100) "% used", round((f.free/a.total)*100) "% Free"
from
(select tablespace_name, sum(bytes/(1024*1024)) total
from dba_data_files group by tablespace_name) a,
(select tabl ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号