SQL SERVER FUNCTION REMOVE NUMS

  GO   SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION [dbo].[RemoveNumCharacters](@InputString VARCHAR(1000)) RETURNS VARCHAR(1000) AS BEGIN WHILE PATINDEX('%[^a-Z]%',@InputString)>0 SET @InputString = STUFF(@InputString,PATINDEX('%[^a-Z]%',@InputString),1,'') RETURN @InputString END GO  

SQL Server Function remove characters

GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION [dbo].[RemoveAlphaCharacters](@InputString VARCHAR(1000)) RETURNS VARCHAR(1000) AS BEGIN WHILE PATINDEX('%[^0-9]%',@InputString)>0 SET @InputString = STUFF(@InputString,PATINDEX('%[^0-9]%',@InputString),1,'') RETURN @InputString END GO

Trigger with Cursor

Trigger with cursor USE [Gestio] GO /****** Object: Trigger [dbo].[SetAxAltaTripartita] Script Date: 28/04/2017 10:02:41 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <Author,,Name> -- Create date: <Create Date,,> -- Description: <Description,,> -- ============================================= ALTER TRIGGER [dbo].[SetAxAltaTripartita] ON [dbo].[docEncomienda] AFTER INSERT, DELETE, UPDATE AS BEGIN -- SET NOCOUNT ON added to [...]

Search a value in all server objects structure

Use this to search a value in every object of the DDBB.   DECLARE @sqlCommand varchar(1000) Declare @bbdd nvarchar(255) Declare @value nvarchar(255) Declare data1 Cursor for SELECT name FROM master.dbo.sysdatabases SET @value = 'Técnico' SET @sqlCommand = '' Open data1; fetch next from data1 into @bbdd; while @@fetch_status = 0 begin SET @sqlCommand = 'SELECT [...]