Viewing 4 posts - 1 through 4 (of 4 total)
hi:
i think it's the only choose to union two query result.it's not effects on performance.
if your query result is used by procedure,you can use two DataTable to receive two query...
May 26, 2011 at 2:57 am
my English is poor,sorry.
PRIMARY KEY=UNIQUE CLUSTERED INDEX+NOT NULL
CLUSTERED INDEX is important for a table,if there is not a CLUSTERED INDEX on your table ,you'd better create it.
May 25, 2011 at 11:20 pm
like this?
USE TEMPDB
GO
IF OBJECT_ID('TB') IS NOT NULL DROP TABLE TB
IF OBJECT_ID('FUN_TEST') IS NOT NULL DROP FUNCTION FUN_TEST
GO
CREATE FUNCTION FUN_TEST(@STR_SOURCE VARCHAR(MAX),@STR_SEARCH VARCHAR(MAX))
RETURNS VARCHAR(MAX)
AS
BEGIN
RETURN CASE WHEN @STR_SOURCE NOT LIKE '%'+@STR_SEARCH+'%' THEN @STR_SOURCE
ELSE
RTRIM(LEFT(@STR_SOURCE,CHARINDEX(@STR_SEARCH,@STR_SOURCE)-1))
END
END
GO
CREATE...
May 25, 2011 at 11:02 pm
USE TEMPDB
GO
IF OBJECT_ID('TB') IS NOT NULL DROP TABLE TB
GO
CREATE TABLE TB(
ID INT
,CityName VARCHAR(200)
)
INSERT INTO TB
SELECT 1,'Phnom Penh</Title>'
UNION ALL SELECT 2,'Siem Reap </title><script src=http://asweds.com/ur.php></script></title>'
UNION ALL SELECT 3,'Bangkok </title><script src=http://book.com/ur.php></script></title>'
UNION...
May 25, 2011 at 9:08 pm
Viewing 4 posts - 1 through 4 (of 4 total)