Mais links

As imagens deste blog são alojadas por HostImage - Serviço gratuíto

Use variable in table name question of Stored Procedures SQL Server 2000

I have one Stored procedure that use a global temporary table, because if I use a local temporary table, give error, because is created with the result of a SQL in Linked server:

EXEC('SELECT * INTO ##TABLE FROM OPENQUERY( LINKEDSERVER, ''SELECT CP1, CP2, CP3 FROM TABLEOTHERSERVER WHERE CP1 = '+@CODE+''')')

and then i use the temporary table in the next line

FOR SELECT CP1, CP2, CP3 FROM ##TABLE ORDER BY CP1

If I use local temporary table give erro in the previous line to define the table #TABLE, because this I use ## global temporary tables

AND THE PROBLEM IS

The stored procedure runs simultaneously in diferent connections and give the error that the table ##TABLE is already created, the soluction is create unique global temporary tables with the help of one parameter that I receive in Stored Procedure, the first line look like:

EXEC('SELECT * INTO ##TABLE'+@PARAMETER+' FROM OPENQUERY( LINKEDSERVER, ''SELECT CP1, CP2, CP3 FROM TABLEOTHERSERVER WHERE CP1 = '+@CODE+''')')

in this case the name of the global temporary table is for example ##TABLE0001

but in the other line:

FOR SELECT CP1, CP2, CP3 FROM ##TABLE+@PARAMETER ORDER BY CP1

give-me error if I try to concatenate the @PARAMETER to the rest of the table name.

Any ideas ??

 

Post nos newsgroups da Microsoft em Inglês http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.sqlserver.programming&mid=0c62e450-fcd9-48ff-8f67-2f14c8ffc32b

Post nos newsgroups da Microsoft em Português http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.pt.sql&cat=pt_PT_001633e6-47b3-460b-a215-1a096bfab972&lang=pt&cr=PT&mid=9bf12d67-1ee0-4b34-ad00-dd8c79c6fb20

Vídeos do lançamento do Windows 7

sdas

Recuperar mails eliminados directamente sem passar na pasta Itens Eliminados

Este pequeno procedimento que se segue, salvou-me o dia.

Para podermos recuperar as mensagens que foram eliminadas directamente sem passar pela pasta Itens Eliminados, através do Hard delete (Shift+Del), devemos seguir esses passos.

  1. O Exchange deve estar configurado para reter itens excluídos.
  2. Esse procedimento deve ser utilizado na (as) maquinas (as) que for recuperar as mensagens.
  3. Acesse o Registro do Windows > Regedit
  4. No registro do Windows, acesse a seguinte pasta.
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Exchange\Client\Options
  5. Clique com o botão direito do mouse e aponte para New (NOVO) e então clique em DWORD Value.
  6. No novo registro digite "DumpsterAlwaysOn", respeitando as letras maiúsculas e, pressione ENTER.
  7. Clique duas vezes sobre o "DumpsterAlwaysOn"
  8. Adicione o Valor 1 e clique em OK.

Depois de adicionar esse valor, a opção de "recuperar itens excluídos", estará disponível para Caixa de entrada, mensagens enviadas...

Windows 7 falha em apresentação na TV Chinesa

Aparentemente a falha tem mais a ver com o touchscreen do que com o Windows 7, mas aqui fica.