terça-feira, 9 de julho de 2013

O formato da seqüência de inicialização não está de acordo com a especificação iniciada no índice XX

Ao tentar postar um relatório em uma nova instalação do SQL Server Business Intelligence Development Studio, obtive o seguinte erro: O formato da seqüência de inicialização não está de acordo com a especificação iniciada no índice XX (onde XX é um número de índice). 
Após algumas pesquisas, cheguei a informações que poderia ser o uso de "\" simples em vez de "\\" duplas ao criar uma conexão no .NET. Não era isto, pois estou no Reporting Services e as conexões são configuradas, não programadas. Então eu não teria este nível de controle.
Como abri o projeto dos relatórios de uma pasta da rede, pois acabara de instalar o IDE, resolvi refazer a conexão com o banco. E foi isto que resolveu, pois estava dando falha na autenticação. Por algum motivo a conexão foi aberta sem o usuário/senha que eu havia informado na conexão. A senha até parecia estar preenchida, mas só funcionou depois que eu digitei novamente.
Espero que ajude a outros, pois a situação de instalar o IDE em outra máquina é tão comum... 8-)

segunda-feira, 25 de março de 2013

Cloning tables in TSQL, as in Oracle CTAS

Explaining: the CREATE TABLE AS SELECT * FROM command, used to create a whole new table from an existing one (aka CTAS), and already importing its data, has a similar on Microsoft Transact-SQL:  SELECT * INTO NEW_TABLE FROM EXISTENT_TABLE .

It's quite simple like you were filling such a variable.

Clonando tabelas no TSQL, como o CTAS do Oracle

Explicando: o comando CREATE TABLE AS SELECT * FROM , usado para criar uma nova tabela a partir de outra no Oracle (aka CTAS), e já importando seus dados, tem um correspondente no Microsoft Transact-SQL: SELECT * INTO NEW_TABLE FROM EXISTENT_TABLE.

É tão simples como se estivesse preenchendo uma variável.

segunda-feira, 18 de fevereiro de 2013

Erro no INSERT em tabela com campo IDENTITY


Ao tentar inserir um valor em uma tabela com campo identity diretamente, será necessário ligar o atributo identity_insert, e também informar explicitamente a lista de campos, ou seja, o comando a seguir, sem a lista explícita vai gerar o erro "An explicit value for the identity column in table 'table_name' can only be specified when a column list is used and IDENTITY_INSERT is ON";

INSERT nome_tabela VALUES (Valor1, Valor2, etc)

Pois neste caso é imperativo que se informa a lista de campos, deste jeito:

INSERT nome_tabela(Campo1, Campo2, etc) VALUES (Valor1, Valor2, etc).

Para ligar e desligar o atributo:
SET IDENTITY_INSER ON BANCO.DBO.TABELA ON|OFF

Não sei se a lista de campos é uma questão de versão do banco, mas no SQL Server 2008 foi necessário informá-la. Bom trabalho a todos.

sexta-feira, 8 de fevereiro de 2013

TNS Protocol Adapter Erro

[PT-BR]
Um dos motivos deste erro é que o sqlplus não consegue identificar o ORACLE_SID, e fica sem saber em qual Instância de banco efetuar o login. 
A solução mais simples que achei na web para meu caso foi configurar a variável de ambiente citadas:

c:>set ORACLE_SID=

O nome da variável pode estar em qualquer combinação de caixa (alta, baixa ou mista).

[ENU]
One of the causes of this error is the fact that sqlplus cannot identify the oracle_sid value, and cannot decide which instance to log in.
The simpler solution I`ve found on the web for my actual case was to set up the environment variable cited above:

c:>set ORACLE_SID=

The variable name can be typed in any combination of case.

sábado, 6 de outubro de 2012

SQLServer Cannot connect to server

When you get the Cannot connect to , many things can be involved, but here is one which is related to a named instance. If you choose to install a named instance you must inform to SQL Server the instance you want to use. It would list them by design, but does not. So, you must remember to inform the name you gave it. See the previous post about Express instance issues for more details.



TITLE: Connect to Server

Cannot connect to (local).
------------------------------
ADDITIONAL INFORMATION:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

Express named instance issues

If you have just installed an instance of SQL Server Express, and used a Named instance instead of a Default instance, so you must remember that it will be mandatory to inform the instance name right after the Server name field when loggin in (see picture below), or in another situation, like creating a database via script. The path to the database changes from MSSQLSERVER to SQLEXPRESS.

Using a named instance, instead of default bring some little bit differences when using SQLServer