易截截图软件、单文件、免安装、纯绿色、仅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


相关文档:

常用经典SQL语句大全

 下列语句部分是Mssql语句,不可以在access中使用。
  SQL分类:
  DDL—数据定义语言(CREATE,ALTER,DROP,DECLARE)
  DML—数据操纵语言(SELECT,DELETE,UPDATE,INSERT)
  DCL—数据控制语言(GRANT,REVOKE,COMMIT,ROLLBACK)
  首先,简要介绍基础语句:
  1、说明: ......

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

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

ms sql到mysql的移植:关于数据类型移植的一些问题

   ms sql中的int型默认是4位,mysql的int型默认是11位,前者到后者的移植不会有什么隐患,但是后者到前者的移植就存在位数不够,不能存储大数的隐患。
   还有bigint,ms sql是8位,mysql默认是20位。 ......

SQL Server 中的查询通知 (ADO.NET)

查询通知是在 Microsoft SQL Server 2005 中以及 ADO.NET 2.0 的 System.Data.SqlClient 命名空间中引入的。查询通知建立在 Service Broker 基础结构的基础上,使应用程序可以在数据更改时收到通知。如果应用程序提供数据库中信息的缓存(例如 Web 应用程序),需要在源数据更改时接收通知,此功能特别有用。
通过三种方式 ......

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 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号