Split String from string to row entry.
[sql]
CREATE FUNCTION [dbo].[SplitString](
@String NVARCHAR(8000)
,@Delimiter CHAR(1))
RETURNS TABLE
AS
RETURN(
WITH SplitData(
stpos
,endpos)
AS (
SELECT
0 AS stpos
,CHARINDEX(@Delimiter,@String) AS endpos
UNION ALL
SELECT
endpos + 1
,CHARINDEX(@Delimiter,@String,endpos+1)
FROM SplitData
WHERE endpos > 0)
SELECT
ROW_NUMBER() OVER(ORDER BY
(
SELECT
1
)) AS RowID
,RTRIM(LTRIM(SUBSTRING(@String,stpos,COALESCE(NULLIF(endpos,0),LEN(@String) + 1)-stpos))) AS RowData
FROM SplitData)
[/sql]
Applies to ApexSQL Complete Summary This article describes how to set a custom connection color to a query tab in Microsoft SQL Server Management Studio (SSMS) using a feature called Tab coloring in ApexSQL Complete. Description Tab coloring can set custom connection colors for individual instances of SQL Server, down to the database level. The user has ability to assign SQL servers, and databases to a specific environment to help quickly identify which connection a tab is currently using.
Komentar
Posting Komentar