Dynamic SQL 1 in 5 Minutes

Поділитися
Вставка
  • Опубліковано 14 лис 2024

КОМЕНТАРІ • 17

  • @TheBitles
    @TheBitles 9 місяців тому

    Claro, simple y al grando. Los TQM.

  • @amagab2346
    @amagab2346 3 роки тому

    Bless you, that was super clear!

  • @ahsanraco
    @ahsanraco 5 місяців тому

    Thanks ❤❤❤

  • @liquidcode1704
    @liquidcode1704 Рік тому

    DO's: implement this on your own local machine for your own research
    DONT's: use dynamic sql in an api

  • @bprasad1950
    @bprasad1950 Рік тому

    Tq so much

  • @Der_Befraier
    @Der_Befraier 3 роки тому

    Chindi explanation
    Tumba Thanks

  • @gotchihaeyo1825
    @gotchihaeyo1825 2 роки тому +1

    I guess I understand how it works but why not explaining why we need it??

    • @mamneo2
      @mamneo2 Рік тому +1

      Incroyable.

    • @shabebelu1739
      @shabebelu1739 Рік тому

      I can think with a use for it in reports. Using dynamic SQL to have a a flexible report that shows columns only when they have values in them.

  • @shivgan3g
    @shivgan3g 8 років тому

    very good

  • @ibrahimmaher2008
    @ibrahimmaher2008 7 років тому +1

    how to pass a varchar field to where criteria like
    DECLARE @Where [nvarchar](50)='FirstName=' +'Nancy''
    return error "Invalid column name ''Nancy"

    • @Aphranteus
      @Aphranteus 6 років тому +1

      Exactly in what part of the code you are trying to use that?
      E.g. when I want to pass 'like' parameter to WHERE clause, I declare @variable varchar(50) and within procedure I put
      (...)WHERE [name] like CONCAT('%',@variable,'%')(...) and then variable is used in LIKE statement, but it seems like you should use EXEC(...)''WHERE',' @WHERE') (which is not the best name for variable, to be honest).
      General rule - if you are passing anything to EXECUTE or sp_executesql it should be string, to be functional within exec. Test it out using PRINT insted of exec first - if it prints a valid query (which you can e.g. copy from output and run) it will be working. If it is not a valid string - your idea will collapse.
      Shortly: If you can PRINT it, you can EXEC it.

  • @msashoyeb
    @msashoyeb Рік тому

    💕💕

  • @animeboy93
    @animeboy93 Рік тому

    Well that helped me

  • @hassanOnYoutube
    @hassanOnYoutube 2 роки тому

    Love from Pakistan

  • @COSMOStheOPERA
    @COSMOStheOPERA 7 років тому

    it's blurred