155 How to move files to year wise folder in ssis

Поділитися
Вставка

КОМЕНТАРІ • 6

  • @ahmadserry1823
    @ahmadserry1823 2 місяці тому

    hi sir ,,
    first thanks for all your great videos in sql and ssis
    i want to ask you something
    how can i make a stored proc to check a merge statement
    means i want this stored to check the syntax and the columns that is written right or not
    how can i come up with a logic like this ?

    • @learnssis
      @learnssis  2 місяці тому +1

      I have never tried it, can you take help from chatgpt on it, it can give you syntax. When I asked it has given me this sp, if you got any issues, give the code to chatgpt and ask to fix it.
      CREATE PROCEDURE CheckMergeSyntax
      @mergeStatement NVARCHAR(MAX)
      AS
      BEGIN
      SET NOCOUNT ON;
      BEGIN TRY
      -- Attempt to parse the MERGE statement to check syntax
      DECLARE @dummy INT;
      SET @dummy = PARSE(@mergeStatement AS SQL);
      PRINT 'Syntax check passed.';
      END TRY
      BEGIN CATCH
      -- If an error occurs, print the error message
      PRINT 'Syntax check failed. Error: ' + ERROR_MESSAGE();
      END CATCH
      END;
      ------------------
      EXEC CheckMergeSyntax '
      MERGE INTO TargetTable AS T
      USING SourceTable AS S
      ON T.ID = S.ID
      WHEN MATCHED THEN
      UPDATE SET T.Value = S.Value
      WHEN NOT MATCHED THEN
      INSERT (ID, Value) VALUES (S.ID, S.Value);
      '

    • @ahmadserry1823
      @ahmadserry1823 2 місяці тому

      @@learnssis
      thank you so much for your help sir
      shoukrya

    • @learnssis
      @learnssis  2 місяці тому +1

      @@ahmadserry1823 No problem.

  • @AnilYadav-mb4zj
    @AnilYadav-mb4zj 2 місяці тому

    Hi akhil.. I want to contact you how it can be possible

    • @learnssis
      @learnssis  2 місяці тому

      email me at aqil33@gmail.com