 DROP PROCEDURE dbo.moveRenameDb
 GO
 
+
+
+
+SELECT * FROM Lease
+
+

EXEC dbo.addColumn 'Tag', 'atPath', 'VARCHAR(255)', '/ITA'
GO

UPDATE lea SET atPath = '/ITA/' + LEFT(agr.reference,3)
    FROM Lease lea
    INNER JOIN Agreement agr ON lea.id = agr.id
GO

            WHERE [name] = @column AND [object_id] = OBJECT_ID(QUOTENAME(@table)))
    BEGIN
        DECLARE @addColumnCmd NVARCHAR(1000)
        SET @addColumnCmd = 'ALTER TABLE '+ QUOTENAME(@table) + ' ADD '+ QUOTENAME(@column) + ' ' + @type + ' NOT NULL DEFAULT ''' + @default + ''''
        EXEC sp_executesql @addColumnCmd

        DECLARE @dropDefaultCmd NVARCHAR(1000)
