Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set Query Results to 'File' to Text in script
Message
De
25/03/2010 16:33:28
 
 
À
25/03/2010 14:32:14
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Scripting
Divers
Thread ID:
01457214
Message ID:
01457264
Vues:
30
>Biggest gotcha is making sure you have permissions enabled on the folder where you are writing the file.
>
>HTH

Thank you Charles. There must be other gotchas I don't quite have my brain wrapped around. I end up with a result file that contains:
(0 rows affected)
the source script is
WITH Procs (ProcName) AS 
(
    SELECT 
        name 
    FROM sys.procedures 
    WHERE [type] = 'P' 
		AND is_ms_shipped = 0 
		AND [name] LIKE 'spMT%'
)
SELECT 
'IF EXISTS(
	SELECT *
	FROM sys.objects
	WHERE object_id = OBJECT_ID(N''[dbo].[' + ProcName + ']'') 
		AND TYPE IN (N''P'', N''PC''))
DROP PROCEDURE [dbo].[' + ProcName + ']
GO

'
FROM Procs
Which works perfectly when executed from SSMS.
I suspect the problem is with the formatting of my script.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform