Problems Microsoft SQL 2005

We have a situation when a PC connects to the Ms SQL instance, that it would halt a specific areas and the message that appears is "data type error.

What can be causing this?
rayluvsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rayluvsAuthor Commented:
Ooops, wrong error message.  Tha message is:

Msg 242, Level 16, State 3, Line 3
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

Open in new window


When debuging the VB.NET apps we see the error happens in the line where the script is:

SET @Var = (SELECT CONVERT(VARCHAR,GETDATE(),103))

Open in new window


We noticed that the Server is Ms SQL 2005 English version, but another server is Spanish version and it runs ok.  We also noticed that doing the query directly in the Studio SQL, gave same result in 2005 SQL version.

We tested other values beside 103 and it works.  We thought it was Regional, but changed it, still error.

Please adveice
AnujSQL Server DBACommented:
gpizzutoCommented:
did you declare the variable  @Var
as
nvarchar (at least 10) ???

try also

SELECT CONVERT(VARCHAR(10),GETDATE(),103)
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

CodeCruiserCommented:
Try changing

SET @Var = (SELECT CONVERT(VARCHAR,GETDATE(),103))

to

SET @Var = (SELECT CONVERT(VARCHAR,Convert(DateTime, GETDATE(), 103),103))

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rayluvsAuthor Commented:
It did work.  Question, can this be an issue as I the install parameters of the SQL instance?
CodeCruiserCommented:
>It did work.
My suggestion?

>Question, can this be an issue as I the install parameters of the SQL instance?
Not sure what you mean.
rayluvsAuthor Commented:
All suggestions worked.

What we mean by "if this can be a SQL instance issue", is since in server SQL 2000 worked excellently and in the 2005 didnt.  So can it be the actual installation?
CodeCruiserCommented:
I think it has to do with culture settings.
rayluvsAuthor Commented:
what is "culture"
CodeCruiserCommented:
Regional and culture settings of the system/server. Dates have different format in different cultures like dd/mm/yyyy in UK vs mm/dd/yyyy in US.
rayluvsAuthor Commented:
Understood.

One last question; if truly based on "culture settings", should we reinstall SQL?
CodeCruiserCommented:
What are regional settings of the operating systems running the sql servers?

http://stackoverflow.com/questions/2432185/how-can-i-query-the-database-culture-sql-server-2005
rayluvsAuthor Commented:
Thanx, good link.

Should we reinstall SQL or just modify the script as recommended?
rayluvsAuthor Commented:
or change collation?

which?

Please advice.
CodeCruiserCommented:
Change script is a quick fix. Other fixes would need more investigation. Do you have a DBA?
rayluvsAuthor Commented:
Don't understand by change script and quick script.  We would to just a simple SELECT various time within MsAccess SQL scripting area.

All googles searches has indicated that it not possible so this where we rely on EE expert advice.

No, we don't have a DBA
CodeCruiserCommented:
>Don't understand by change script and quick script.  We would to just a simple SELECT various time within MsAccess SQL scripting area

Your question was whether you should change the select statement, reinstall sql, or change collation. My response was that changing the select statement (sql script) is a quick fix if its working. Reinstalling and changing collation is also an option.
rayluvsAuthor Commented:
Thanx
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.