|
|
|
CREATE FUNCTION [dbo].[COMPARENTEXT] ( @ntext1 NTEXT, @ntext2 NTEXT )
RETURNS BIT
AS
BEGIN
-- Declare the return variable here
DECLARE @IsEqual AS BIT
SET @IsEqual = 1
-- Compare lengths to get an easy result
DECLARE @Length1 AS INT, @Length2 AS INT
SET @Length1 = DATALENGTH(@ntext1)
SET @Length2 = DATALENGTH(@ntext2)
IF (@Length1 <> @Length2)
BEGIN
SET @IsEqual = 0
END
ELSE
BEGIN
-- Lengths don't match, so compare NVARCHAR chunks of data
DECLARE @ChunkIndex AS INT
DECLARE @ChunkText AS NVARCHAR(4000)
DECLARE @ChunksAreEqual AS BIT
SET @ChunkIndex = 0
WHILE @ChunkIndex < @Length1 AND @IsEqual = 1
BEGIN
-- Compare corresponding 4000-character chunks of NTEXT
IF (CAST(SUBSTRING(@ntext1, @ChunkIndex, 4000) AS NVARCHAR(4000)) <>
CAST(SUBSTRING(@ntext2, @ChunkIndex, 4000) AS NVARCHAR(4000)))
SET @IsEqual = 0
SET @ChunkIndex = @ChunkIndex + 4000
END
END
RETURN @IsEqual
END |
|
| TSQL INDENTER Categories : MS SQL Server, Debugging, Databases, General SQL | | | Dynamic WHERE CLAUSE depending on number of FORM FIELDS Categories : ODBC, General SQL, PHP, Complete Programs, Databases | | | Multiple Search using PHP and Mysql Categories : PHP, Databases, General SQL, MySQL | | | You have a set of many resources , and You need to know wich of these resources are available for a given use during a given period but MySql does not allow SUB-Selection :(
here is the right way to do that in a single query
Categories : MySQL, General SQL, Databases, Algorithms | | | phpEasySQL - Easily connect to your MySQL database with just 1 php file and 3 easy steps! Categories : Databases, PHP, MySQL, General SQL | | | Guestbook sort by descending date and can view page by page Categories : PHP, MS SQL Server, Databases | | | Unable to select text bigger than 4K from MSsql Categories : PHP, WinNT, Databases, MS SQL Server | | | Sql Builder Categories : PHP, HTML and PHP, Databases, General SQL, Form Processing | | | how to activate connection pooling in IIS 3 and IIS 4, for access via ODBC to SQL Server 6.5
Categories : IIS, ODBC, MS SQL Server, Web Servers, Databases | | | MSSql limitations regarding length of tables, columns, databases.. Categories : MS SQL Server, Databases | | | This is a class with functions that are taken from simple SQL statements.
I made it to have an easier connection between PHP3 and DBase files. Categories : General SQL, PHP, PHP Classes, Databases | | | How to connect to MS SQL 6.x+ database server via ODBC functions of
PHP3 compiled with iODBC and Openlink drivers under Linux. Categories : Databases, MS SQL Server, PHP, ODBC | | | ADODB Database Wrapper Abstraction Library for PHP: MySQL, MSSQL,
Oracle, Interbase,ODBC, Microsoft Access and FoxPro. Categories : PHP Classes, Databases, PHP, General SQL, ODBC | | | Mssql database Manager Categories : PHP, Databases, MS SQL Server, Classes and Objects, PHP Classes | | | Simple class for accessing databases like MSSql Server, Oracle etc by Raju Categories : PHP, MS SQL Server, Databases, PHP Classes, Oracle | |
|
|
|