Tuesday, March 20, 2012
[strange] date format issue: 2 servers, one query, 2 different results.
SELECT DATA FROM TABLE_1 WHERE ((TRANSACTION_DATE >='13/11/2003') AND (TRANSACTIONS_DATE <='20/11/2003')) [dates are DD/MM/YYYY]
Query on server_1:
- using OLE DB: correct
- using ODBC: correct
- using Query Analyzer: error <The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value>
On server_2:
- using OLE DB: error <The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value>
- using ODBC: correct
- using Query Analyzer: error <The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value>
Both servers have MDAC 2.8 RTM installed and a <select @.@.language> returns <us_english> via query analyzer and <franais> via ODBC.
I'd like to setup Server 2 so that queries can be executed the same as on server 1.
Any ideas are welcomed!There's a problem with 20/11/2003 in us_english format. Default is: MDY, so it's reading 20th as month, which is why you're getting that error.
Here's an article I found: http://members.lycos.nl/digispy/C2/P56/C2P56A1806.htm
G'luck!
Meera|||Possible there is something to do with locale settings of windows, check the "Region Options" in Control Panel for both servers.|||I'd say the languages are different...and accordingingly each date format is different
Di SELECT * FROM master..syslanguages
I think English is the only one that mdy|||(D/M/Y is a French date format).
I just had to set <French> to user's default language instead of <US_ENGLISH>. This means ODBC settings override the default SQL Server settings as OLE DB uses the default SQL Server setting.sql
Thursday, March 8, 2012
[Performance Discussion] To schedule a time for mssql command, which way would be faster a
2. Use a .NET windows service with timers to call SqlClientConnection
above, which way would be faster and get a better performance?I don't think you'll see any performance difference.
but go with agent.|||ok, but will have a difference when busy
Tuesday, March 6, 2012
[MSSQL] Which port
I have the following problem.
I know that MSSQL resides under given IP adress but I do not know under
which port. Who konows how to determine this port number?
Best wihses,
Marek Powichrowski
Hi,
Open the SQL Server Error log and see which port SQL Server is using. By
default SQL Server default instance use the port 1433.
You could also use the Server network utility from SQL Server program groups
of SQL Server machine
and click properties in TCP/IP protocol to get the port number.
Thanks
Hari
SQL Server MVP
"news.task.gda.pl" <marek@.telbank.pl> wrote in message
news:d77u99$dgu$1@.korweta.task.gda.pl...
> Hi all,
> I have the following problem.
> I know that MSSQL resides under given IP adress but I do not know under
> which port. Who konows how to determine this port number?
> Best wihses,
> Marek Powichrowski
>
|||Uytkownik "Hari Prasad" <hari_prasad_k@.hotmail.com> napisa w wiadomoci
news:eDkDhevYFHA.1148@.tk2msftngp13.phx.gbl...
> Hi,
> Open the SQL Server Error log and see which port SQL Server is using. By
> default SQL Server default instance use the port 1433.
> You could also use the Server network utility from SQL Server program
> groups of SQL Server machine
> and click properties in TCP/IP protocol to get the port number.
Hari,
I know this but I want to know how to do this without network utility and
serwer error log. What I must send to SQL serwer and what resposne from
given port give me information that under given port resides MSSQL?
Best wishes,
Marek Powichrowski
[MSSQL] Which port
I have the following problem.
I know that MSSQL resides under given IP adress but I do not know under
which port. Who konows how to determine this port number?
Best wihses,
Marek PowichrowskiHi,
Open the SQL Server Error log and see which port SQL Server is using. By
default SQL Server default instance use the port 1433.
You could also use the Server network utility from SQL Server program groups
of SQL Server machine
and click properties in TCP/IP protocol to get the port number.
Thanks
Hari
SQL Server MVP
"news.task.gda.pl" <marek@.telbank.pl> wrote in message
news:d77u99$dgu$1@.korweta.task.gda.pl...
> Hi all,
> I have the following problem.
> I know that MSSQL resides under given IP adress but I do not know under
> which port. Who konows how to determine this port number?
> Best wihses,
> Marek Powichrowski
>|||Uytkownik "Hari Prasad" <hari_prasad_k@.hotmail.com> napisa w wiadomoci
news:eDkDhevYFHA.1148@.tk2msftngp13.phx.gbl...
> Hi,
> Open the SQL Server Error log and see which port SQL Server is using. By
> default SQL Server default instance use the port 1433.
> You could also use the Server network utility from SQL Server program
> groups of SQL Server machine
> and click properties in TCP/IP protocol to get the port number.
Hari,
I know this but I want to know how to do this without network utility and
serwer error log. What I must send to SQL serwer and what resposne from
given port give me information that under given port resides MSSQL?
Best wishes,
Marek Powichrowski
[MSSQL 2005] Code provided for constructing plug-in algorithm?
I've found interesting tutorial for constructing a plug-in algorithm for
MSSQL 2005.
http://msdn.microsoft.com/library/d... />
InAlg2.asp
But where is the necessary stub code that should be provided with this
tutorial (dmalgo.h etc)? There is only information that it is provided, but
I can't find it.
Thanks for any help.
Krokers.You'll probably have better luck in the SQL Server 2005 newsgroups.
http://www.aspfaq.com/sql2005/show.asp?id=1
http://www.aspfaq.com/
(Reverse address to reply.)
"wilar" <wilar123@.poczta.onet.pl> wrote in message
news:coftje$g7n$1@.news.onet.pl...
> Hello,
> I've found interesting tutorial for constructing a plug-in algorithm for
> MSSQL 2005.
>
http://msdn.microsoft.com/library/d.../PlugInAlg2.asp
> But where is the necessary stub code that should be provided with this
> tutorial (dmalgo.h etc)? There is only information that it is provided,
but
> I can't find it.
> Thanks for any help.
> Krokers.
>
>
>
[MSSQL 2005] Code provided for constructing plug-in algorithm?
I've found interesting tutorial for constructing a plug-in algorithm for
MSSQL 2005.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/PlugInAlg2.asp
But where is the necessary stub code that should be provided with this
tutorial (dmalgo.h etc)? There is only information that it is provided, but
I can't find it.
Thanks for any help.
Krokers.You'll probably have better luck in the SQL Server 2005 newsgroups.
http://www.aspfaq.com/sql2005/show.asp?id=1
--
http://www.aspfaq.com/
(Reverse address to reply.)
"wilar" <wilar123@.poczta.onet.pl> wrote in message
news:coftje$g7n$1@.news.onet.pl...
> Hello,
> I've found interesting tutorial for constructing a plug-in algorithm for
> MSSQL 2005.
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/PlugInAlg2.asp
> But where is the necessary stub code that should be provided with this
> tutorial (dmalgo.h etc)? There is only information that it is provided,
but
> I can't find it.
> Thanks for any help.
> Krokers.
>
>
>
[MSSQL + VS.NET] Connection - sleeping
I've prepared a small aplication in VS.NET and I use SqlConnection class.
Everything is ok, but when I'm trying to disconnect from server using
if (cnSQL->State != ConnectionState::Closed) cnSQL->Close()
there is still connection do server present. I have to close connection
because I'm trying to drop this database.
Have you ever heard about this kind of problem??
Trociu
--
Plain-text over all!!!
/**********/
write me : trociu@.autonom ict pwr wroc pl
search me : gg: 1382729"Trociu" <trociu@.autonom.ict.pwr.wroc.pl> wrote in message
news:slrncmhvuv.14n.trociu@.autonom.ict.pwr.wroc.pl ...
> Hello
> I've prepared a small aplication in VS.NET and I use SqlConnection class.
> Everything is ok, but when I'm trying to disconnect from server using
> if (cnSQL->State != ConnectionState::Closed) cnSQL->Close()
> there is still connection do server present. I have to close connection
> because I'm trying to drop this database.
> Have you ever heard about this kind of problem??
> Trociu
> --
> Plain-text over all!!!
> /**********/
> write me : trociu@.autonom ict pwr wroc pl
> search me : gg: 1382729
I have no idea, unless perhaps you're using connection pooling, and the pool
is still active? You might get a better response in a VB or .NET group.
From the server side, you can use ALTER DATABASE to disconnect all users
from a database - see Books Online:
ALTER DATABASE MyDB SET OFFLINE WITH ROLLBACK IMMEDIATE
Simon
Saturday, February 25, 2012
[Match any Portion] - Possible in MSSQL?
We have an mysql inventory database. We want to be able to put in 4984.600 and choose "match any portion" and it finds 4984600 which is in our database.
Does Mysql have a "match any portion" search function? In this case LIKE didn't work which we tried already.
Any ideas? or are we stuck with using MSSQL. We know this will work with MSSQL.
Thank you very much. This is a huge problem for us.
JimHuh?
You want to match 44984600 to 4984.600? Are these strings or numeric data?
It makes no sense to match these "on any part". That is like saying you want to match "Betty" to "Rob", since they both contain the letter "B".
Perhaps you should explain more clearly, and include the code that you have tried.|||Hi there,
Here you can see in action what I am talking about.
First, go to this website http://www.bell-electrical.com. On the left side there is an "Inventory Search" section. Enter Part no. 4984.600 ( You don't have to enter a manufacturer, or check any radio boxes. ).
The website will now redirect to another website and display your result. It will contain the part number 4984600 without the decimal. That particular website is using an ASP script with an MSSQL backend. This is why I say it works with MSSQL. Whether it is the ASP script or something else using sql, I am not exactly sure, but they are doing something to make this work.
I am basically looking to implement something like this using php and mysql, but am unsure if it's possible. I have noticed that most big php scripts including vbulletin for example don't have this function either.
The particular company that is using this search system, is not known for custom programming. Rather they usually use basic asp and mssql systems. This also leads me to believe that it's probably not all that complex.
Any ideas on how they might be achieving this would be great. I have also heard that in MS Access there is actually some parameter that you can use to switch from a "Match" search to a "Match Portion" search. I am wondering if there is something like this in MSSQL as well.
Anyway, hopefully this reply will help everyone understand what I am trying to accomplish.
Thanks again for all the replies.|||I don't think you want to "match portion". It looks like you want to strip all non-numeric (or non-alphanumeric) characters from the string prior to doing your search. And then maybe use the LIKE operator to search as a substring of existing.
TSQL has a nice selection of character string manipulation functions you can use, depending upon the details of your situation. Lookup the REPLACE function, for instance.