From 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 Mon Sep 17 00:00:00 2001
From: Lucas Faria Mendes <lucas.fariamo08@gmail.com>
Date: Mon, 30 Mar 2026 10:38:18 -0300
Subject: chore: location

---
 Codemerx/Gestor.Application.Migration.Files.20201030_79.SQL | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 Codemerx/Gestor.Application.Migration.Files.20201030_79.SQL

(limited to 'Codemerx/Gestor.Application.Migration.Files.20201030_79.SQL')

diff --git a/Codemerx/Gestor.Application.Migration.Files.20201030_79.SQL b/Codemerx/Gestor.Application.Migration.Files.20201030_79.SQL
new file mode 100644
index 0000000..b4ca119
--- /dev/null
+++ b/Codemerx/Gestor.Application.Migration.Files.20201030_79.SQL
@@ -0,0 +1,13 @@
+IF	COL_LENGTH( '[dbo].[documento]', 'banco' ) IS NOT NULL AND COL_LENGTH( '[dbo].[documento]', 'idbanco' ) IS NOT NULL
+BEGIN
+	IF (SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'documento' AND COLUMN_NAME = 'idbanco' AND DATA_TYPE = 'int') IS NOT NULL
+		 BEGIN
+			 UPDATE [dbo].[documento] 
+			 SET idbanco = TRY_CAST ( banco AS INT ) 
+			 WHERE
+			 (
+				 SELECT	idcodigobanco FROM codigobanco 
+				 WHERE idcodigobanco = TRY_CAST ( banco AS INT )
+			 ) IS NOT NULL AND banco IS NOT NULL AND banco != '' AND idbanco IS NULL;
+		END
+END
\ No newline at end of file
-- 
cgit v1.2.3

