Showing posts with label alli. Show all posts
Showing posts with label alli. Show all posts

Thursday, March 29, 2012

error 18456 when trying to connect to 2005 using odbc

Hi all

I am using Windows XP SP2 with a Sql server 2005 Express installation. I created a test db with a user called test, schema also test. I gave the permission connect, db_datareader and db_datawriter. I can now connect into this user using WinSQL. But if I want to connect using a application which is using ODBC, then I get the error:

[SQLSTATE=28000 - [Microsoft][SQL Native][SQL Server]Login failed for user 'test'.[Native Error=18456]]

Because I connect using ODBC, I think there must be the problem. But I have to connect with ODBC. There is no other possibility.

any ideas ?

Regards, Waff

I found this out:

The server collation is defined to: Latin1_General_CI_AS

If I create a new login id in lowercase, then ODBC will change it to uppercase and then the server refuse the access. But why. CI means case insensitive, so doesn't matter if upper or lower case. should.

How do you use a id in lowercase and connecto via ODBC ?

You need to enable TCP in order for ODBC clients to connect. Check out http://blogs.msdn.com/sqlexpress/archive/2004/07/23/192044.aspx for information about doing this.

Mike

|||

Guess has something to do with the collation. I used Latin1_General_AI_CI.

If I create my login id in lowercase and try then to connect to the db using ODBC, then ODBC will switch my id to uppercase and so I can't logon.

Anyway, somehow, it must be possible to modify the server settings, so that it doesn't matter how I logon. lowercase or uppercase. I tryed with CI and CS but still them same.

ODBC is enabled but think has to do with the collation.

What are you using if you use id's as upper/lower case as Test ?

Sunday, February 19, 2012

Error - identifier too long

Hi All
I have to work with a list of values passed through from an application that
I have no way of changing. I have to get the values into a procedure.
The values come through in the following format:
('value1','value2','value3',...)
I have no way of knowing how many values will come through.
I developed the following type pf proc:
SET QUOTED_IDENTIFIER off
GO
SET ANSI_NULLS ON
GO
ALTER procedure MyProc @.InParm varchar(8000)
as
begin
declare @.MyVar varchar(8000)
set @.MyVar = @.InParm
--..... this is an examle
end
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
And called it like this using " to enclose the value list:
Exec MyProc "('this is my','list','of choices','that is sent like','this
from the','application','which I have no way','of changing.','this is a very
long list that comes through')"
I get the following error:
Server: Msg 103, Level 15, State 7, Line 1
The identifier that starts with '('this is my','list','of choices','that is
sent like','this from the','application','which I have no way','of
changing.','this i' is too long. Maximum length is 128.
I found somewhere that I should set quoted identifier off, but this didn't
seem to help.
I have to get this list into my proc. Any Suggestions?
Thanks!You can replace all ' with '' (two single quotes) and then surround the
whole text with a single quote. For example:
=====
CREATE PROCEDURE takeLongList (@.theList VARCHAR(8000)) AS
BEGIN
PRINT @.theList
END
GO
EXEC takeLongList '''This is my'', ''Long List'', ''That I cannot change'',
''From what it was'''
GO
=====
--
HTH,
SriSamp
Email: srisamp@.gmail.com
Blog: http://blogs.sqlxml.org/srinivassampath
URL: http://www32.brinkster.com/srisamp
"Chan" <Chan@.discussions.microsoft.com> wrote in message
news:61815D17-ED68-49D6-8489-BC397B466EC1@.microsoft.com...
> Hi All
> I have to work with a list of values passed through from an application
> that
> I have no way of changing. I have to get the values into a procedure.
> The values come through in the following format:
> ('value1','value2','value3',...)
> I have no way of knowing how many values will come through.
> I developed the following type pf proc:
> SET QUOTED_IDENTIFIER off
> GO
> SET ANSI_NULLS ON
> GO
> ALTER procedure MyProc @.InParm varchar(8000)
> as
> begin
> declare @.MyVar varchar(8000)
> set @.MyVar = @.InParm
> --..... this is an examle
> end
>
> GO
> SET QUOTED_IDENTIFIER OFF
> GO
> SET ANSI_NULLS ON
> GO
> And called it like this using " to enclose the value list:
> Exec MyProc "('this is my','list','of choices','that is sent like','this
> from the','application','which I have no way','of changing.','this is a
> very
> long list that comes through')"
>
> I get the following error:
> Server: Msg 103, Level 15, State 7, Line 1
> The identifier that starts with '('this is my','list','of choices','that
> is
> sent like','this from the','application','which I have no way','of
> changing.','this i' is too long. Maximum length is 128.
> I found somewhere that I should set quoted identifier off, but this didn't
> seem to help.
> I have to get this list into my proc. Any Suggestions?
> Thanks!|||Hi
tried that tho I can't change how the app sends the list through which is:
('val1','val2','val3',...)
so I tried:
declare @.myVar varchar(8000)
select @.myvar = "('this is my','list','of choices','that is sent like','this
from the','application','which I have no way','of changing.','this is a very
long list that comes through')"
set @.myvar = replace(@.myvar, '''',''')
which still gives the same error.
Am I missing your point here?
Thanks
--
Chan
Programmer
"SriSamp" wrote:

> You can replace all ' with '' (two single quotes) and then surround the
> whole text with a single quote. For example:
> =====
> CREATE PROCEDURE takeLongList (@.theList VARCHAR(8000)) AS
> BEGIN
> PRINT @.theList
> END
> GO
> EXEC takeLongList '''This is my'', ''Long List'', ''That I cannot change''
,
> ''From what it was'''
> GO
> =====
> --
> HTH,
> SriSamp
> Email: srisamp@.gmail.com
> Blog: http://blogs.sqlxml.org/srinivassampath
> URL: http://www32.brinkster.com/srisamp
> "Chan" <Chan@.discussions.microsoft.com> wrote in message
> news:61815D17-ED68-49D6-8489-BC397B466EC1@.microsoft.com...
>
>|||> Am I missing your point here?
Yes. SQL Server expects ' to be a string delimiter. So, when you pass
'val1','val2'
What I would suggest doing, unless ' appears in the data itself, is
replacing all instances of ' with space(0) (empty space) and surrounding the
whole string with a single set of quotes.

> tried that tho I can't change how the app sends the list
Well, the app is doing it wrong, and it will need to change. How can you
not be in a position to change an app that could never have possibly worked?
A|||What I showed was an example and you can see that I do the '' when I
actually pass the parameter to the SP. This means that your application will
have to change to send it this way.
--
HTH,
SriSamp
Email: srisamp@.gmail.com
Blog: http://blogs.sqlxml.org/srinivassampath
URL: http://www32.brinkster.com/srisamp
"Chan" <Chan@.discussions.microsoft.com> wrote in message
news:24688FF2-F179-436D-B0A0-0C35AE87D7FE@.microsoft.com...
> Hi
> tried that tho I can't change how the app sends the list through which is:
> ('val1','val2','val3',...)
> so I tried:
> declare @.myVar varchar(8000)
> select @.myvar = "('this is my','list','of choices','that is sent
> like','this
> from the','application','which I have no way','of changing.','this is a
> very
> long list that comes through')"
> set @.myvar = replace(@.myvar, '''',''')
> which still gives the same error.
> Am I missing your point here?
> Thanks
> --
> Chan
> Programmer
>
> "SriSamp" wrote:
>|||Hi
I really have no way of changing the app as it was something we purchased
froom another company and they have the parameters setuyp the way they need
to use them.
--
Chan
Programmer
"SriSamp" wrote:

> What I showed was an example and you can see that I do the '' when I
> actually pass the parameter to the SP. This means that your application wi
ll
> have to change to send it this way.
> --
> HTH,
> SriSamp
> Email: srisamp@.gmail.com
> Blog: http://blogs.sqlxml.org/srinivassampath
> URL: http://www32.brinkster.com/srisamp
> "Chan" <Chan@.discussions.microsoft.com> wrote in message
> news:24688FF2-F179-436D-B0A0-0C35AE87D7FE@.microsoft.com...
>
>|||Then go back to them, because they are wrong.

> I really have no way of changing the app as it was something we purchased
> froom another company and they have the parameters setuyp the way they
> need
> to use them.

Friday, February 17, 2012

Error

Dear All
I am getting this error during indexing on the table. What should i do to
solve this problem
Server: Msg 8946, Level 16, State 12, Line 2
Table error: Allocation page (1:48528) has invalid PFS_PAGE page header
values. Type is 0. Check type, object ID and page ID on the page.
Server: Msg 8939, Level 16, State 1, Line 1
Table error: Object ID -1, index ID 65535, page (1:48528). Test (IS_ON
(BUF_IOERR, bp->bstat) && bp->berrcode) failed. Values are 2057 and -1.
Server: Msg 8921, Level 16, State 1, Line 1
CHECKTABLE terminated. A failure was detected while collecting facts.
Possibly tempdb out of space or a system table is inconsistent. Check
previous errors.
Server: Msg 8998, Level 16, State 1, Line 1
Page errors on the GAM, SGAM, or PFS pages do not allow CHECKALLOC to verify
database ID 15 pages from (1:48528) to (1:56615). See other errors for cause
.
The repair level on the DBCC statement caused this repair to be
bypassed.
CHECKDB found 1 allocation errors and 0 consistency errors in table '(Object
ID -1)' (object ID -1).
DBCC results for 'infodrive_query'.
The repair level on the DBCC statement caused this repair to be
bypassed.
CHECKDB found 1 allocation errors and 0 consistency errors not associated
with any single object.
DBCC results for 'sysobjects'.
There are 87 rows in 1 pages for object 'sysobjects'.
CHECKDB found 2 allocation errors and 0 consistency errors in database
'Infodrive_Query'.
DBCC execution completed. If DBCC printed error messages, contact your
system administrator.
Thanks & regards
Manoj kumarManoj
> CHECKTABLE terminated. A failure was detected while collecting facts.
> Possibly tempdb out of space or a system table is inconsistent. Check
> previous errors.
Check these above options. I assume you don't create an index on system
table.
Identify what is the object that has corrupted index. Drop this index and
try re-create again
"Manoj" <Manoj@.discussions.microsoft.com> wrote in message
news:6C43A8D4-4FE3-4303-8E51-64D436CB33CE@.microsoft.com...
> Dear All
> I am getting this error during indexing on the table. What should i do to
> solve this problem
>
> Server: Msg 8946, Level 16, State 12, Line 2
> Table error: Allocation page (1:48528) has invalid PFS_PAGE page header
> values. Type is 0. Check type, object ID and page ID on the page.
> Server: Msg 8939, Level 16, State 1, Line 1
> Table error: Object ID -1, index ID 65535, page (1:48528). Test (IS_ON
> (BUF_IOERR, bp->bstat) && bp->berrcode) failed. Values are 2057
> and -1.
> Server: Msg 8921, Level 16, State 1, Line 1
> CHECKTABLE terminated. A failure was detected while collecting facts.
> Possibly tempdb out of space or a system table is inconsistent. Check
> previous errors.
> Server: Msg 8998, Level 16, State 1, Line 1
> Page errors on the GAM, SGAM, or PFS pages do not allow CHECKALLOC to
> verify
> database ID 15 pages from (1:48528) to (1:56615). See other errors for
> cause.
> The repair level on the DBCC statement caused this repair to be
> bypassed.
> CHECKDB found 1 allocation errors and 0 consistency errors in table
> '(Object
> ID -1)' (object ID -1).
> DBCC results for 'infodrive_query'.
> The repair level on the DBCC statement caused this repair to be
> bypassed.
> CHECKDB found 1 allocation errors and 0 consistency errors not associated
> with any single object.
> DBCC results for 'sysobjects'.
> There are 87 rows in 1 pages for object 'sysobjects'.
> CHECKDB found 2 allocation errors and 0 consistency errors in database
> 'Infodrive_Query'.
> DBCC execution completed. If DBCC printed error messages, contact your
> system administrator.
>
> Thanks & regards
> Manoj kumar

Wednesday, February 15, 2012

Erro message during import of access DB...

Hello All!
I am getting an error whle I try to import an Access DB into a MSSQL DB.
Insert Error, ('DATEBIRTH', DBTYPE_DBTIMESTAMP), status 6; Data
Overflow. Invalid character value for cast specification.
Now, during the DTS wizard I tried changing the types to smalldate, or
just plain text but neither work.
any thoughts?
thanks!
Luis
Hi
Usually this is caused by incorrect data. You may want to load into a
staging table and make the date column char or validate the data before
loading.
http://groups-beta.google.com/group/...514b83c7397d2c
John
"Anon" wrote:

> Hello All!
> I am getting an error whle I try to import an Access DB into a MSSQL DB.
> Insert Error, ('DATEBIRTH', DBTYPE_DBTIMESTAMP), status 6; Data
> Overflow. Invalid character value for cast specification.
> Now, during the DTS wizard I tried changing the types to smalldate, or
> just plain text but neither work.
> any thoughts?
> thanks!
> Luis
>
|||hmmm. that stinks since we have almost 100k records in this table...mayb
eI can make some sort of update query to these records. Ok, thanks!
Luis
John Bell wrote:[vbcol=seagreen]
> Hi
> Usually this is caused by incorrect data. You may want to load into a
> staging table and make the date column char or validate the data before
> loading.
> http://groups-beta.google.com/group/...514b83c7397d2c
> John
> "Anon" wrote:
>
|||Hi
It may highlight a deficiency in the current application, therefore any
clean up operation would have to be repeated each time you loaded your
SQL server database. Finding out why you have poor data would be
necessary to ensure a smoother transfer in the future. If you loaded
into staging tables your clean-up code could be used when transforming
that data into the live tables, this would mean you are not depending
on the current data source.
100K records is not actually that many, hopefully not all of them are
duff!!
John
Anon wrote:
> hmmm. that stinks since we have almost 100k records in this
table...mayb[vbcol=seagreen]
> eI can make some sort of update query to these records. Ok, thanks!
> Luis
>
> John Bell wrote:
a[vbcol=seagreen]
before[vbcol=seagreen]
http://groups-beta.google.com/group/...514b83c7397d2c[vbcol=seagreen]
MSSQL DB.[vbcol=seagreen]
or[vbcol=seagreen]

Erro message during import of access DB...

Hello All!
I am getting an error whle I try to import an Access DB into a MSSQL DB.
Insert Error, ('DATEBIRTH', DBTYPE_DBTIMESTAMP), status 6; Data
Overflow. Invalid character value for cast specification.
Now, during the DTS wizard I tried changing the types to smalldate, or
just plain text but neither work.
any thoughts?
thanks!
LuisHi
Usually this is caused by incorrect data. You may want to load into a
staging table and make the date column char or validate the data before
loading.
http://groups-beta.google.com/group...7397d
2c
John
"Anon" wrote:

> Hello All!
> I am getting an error whle I try to import an Access DB into a MSSQL DB.
> Insert Error, ('DATEBIRTH', DBTYPE_DBTIMESTAMP), status 6; Data
> Overflow. Invalid character value for cast specification.
> Now, during the DTS wizard I tried changing the types to smalldate, or
> just plain text but neither work.
> any thoughts?
> thanks!
> Luis
>|||hmmm. that stinks since we have almost 100k records in this table...mayb
eI can make some sort of update query to these records. Ok, thanks!
Luis
John Bell wrote:[vbcol=seagreen]
> Hi
> Usually this is caused by incorrect data. You may want to load into a
> staging table and make the date column char or validate the data before
> loading.
> http://groups-beta.google.com/group...739
7d2c
> John
> "Anon" wrote:
>|||Hi
It may highlight a deficiency in the current application, therefore any
clean up operation would have to be repeated each time you loaded your
SQL server database. Finding out why you have poor data would be
necessary to ensure a smoother transfer in the future. If you loaded
into staging tables your clean-up code could be used when transforming
that data into the live tables, this would mean you are not depending
on the current data source.
100K records is not actually that many, hopefully not all of them are
duff!!
John
Anon wrote:
> hmmm. that stinks since we have almost 100k records in this
table...mayb[vbcol=seagreen]
> eI can make some sort of update query to these records. Ok, thanks!
> Luis
>
> John Bell wrote:
a[vbcol=seagreen]
before[vbcol=seagreen]
http://groups-beta.google.com/group...7514b83c7397d2c[vbcol=s
eagreen]
MSSQL DB.[vbcol=seagreen]
or[vbcol=seagreen]