While most of us here have a lot of knowledge with SQL Server, none of us (to my knowledge) can read a crystal ball, so it is in your best interest to explain fully what you need as we are not sitting in front of your computer. Quite frankly, stating "do not work" is no use whatsoever. Just imagine taking your car to the mechanic telling them "do not work" and I suspect you should understand.
For clarity here is the same in Spanish: Mientras hay muchos aquí que son muy capaces usando SQL Server, nadie (de que yo sepa) somos magos, por lo tanto por tu bien te conviene explicar completamente tus requerimientos ya que no estamos enfrente de tu computadora (ordenador). Francamente diciendo "no funciona" no ayuda en lo más mínimo. Imagina que lleves tu auto al mecánico y le dices" "no funciona" y creo que comprenderás.