Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
SQL Server 2000/2005/2008, Express, Access, MySQL, Oracle
Function da 2008 a 2000
venerdì 19 novembre 2010 - 14.14
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
Elenco Tags
Windows XP
|
Visual Studio 2005
|
SQL Server 2000
biroph
Profilo
| Junior Member
56
messaggi | Data Invio:
ven 19 nov 2010 - 14:14
Ciao a tutti, ho convertito questa funzione da sql2008 a sql2000, ma ho problemi con il tipo di ritorno.
Come potete vedere qui ritorno una tabella, ma non riesco a fare altrettanto in sql2000, si può fare? se si come? se no, avete altre idee?
grazie per l'aiuto
Cristian
code 2008:
ALTER FUNCTION [dbo].[Split] (@sep char(1), @s varchar(512))
RETURNS table
AS
RETURN (
WITH Pieces(ID_Array, start, stop) @S (
SELECT 1, 1, CHARINDEX(@sep, @as)
UNION ALL
SELECT ID_Array + 1, stop + 1, CHARINDEX(@sep, @s, stop + 1)
FROM Pieces
WHERE stop > 0
)
SELECT ID_Array,
SUBSTRING(@s, start, CASE WHEN stop > 0 THEN stop-start ELSE 512 END) AS Array
FROM Pieces
)
alx_81
Profilo
| Guru
8.814
messaggi | Data Invio:
lun 29 nov 2010 - 12:55
>Ciao a tutti,
ciao
>Come potete vedere qui ritorno una tabella, ma non riesco a fare
>altrettanto in sql2000, si può fare? se si come? se no, avete altre idee?
> WITH Pieces(ID_Array, start, stop) @S (
questo non si può fare.. prova con questo metodo:
http://www.databasejournal.com/features/mssql/article.php/10894_3348181_2/User-Defined-Functions-in-Microsoft-SQL-Server-2000.htm
>grazie per l'aiuto
di nulla!
--
Alessandro Alpi | SQL Server MVP
MCP|MCITP|MCTS|MCT
http://www.alessandroalpi.net
http://blogs.dotnethell.it/suxstellino
http://mvp.support.microsoft.com/profile/Alessandro.Alpi
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !