Showing posts with label funny. Show all posts
Showing posts with label funny. Show all posts

Wednesday, March 21, 2012

Funny! More offers to select a search engine! (PP)

wycareersterThet's really nice. And what am I looking for?
ML

Funny SQL Server Error Messages - anyone has an explanation?

I am getting a new server online at a customer, and our system shows very funny erorrs under full load. No explanations could be found. Anyone has some?

Here we go:

Server failed to resume the transaction, desc: 360000054a. The transaction active in this session has been committed or aborted by another session.,

at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

and

New request is not allowed to start because it should come with valid transaction descriptor.

System.Data.SqlClient.SqlException

I am a little lost on those. Simple fact is that I do not find any description of those. Anyone an idea what causes these?

What's your SQL server version? It looks like a known issue with SQL2000. You can take a look at this article:http://support.microsoft.com/default.aspx?scid=kb;EN-US;834720#appliesto|||

2005, x64 version :-(

sql

funny sql

The following sql updates 300 records(3000 records in the
marc_POt_lu_rd_post_code table) but the select element only returns one row.
I am attempting to update the 3000 rows which it does but it does it
incorrectly in that the results set from the select portion does not match
what the results set returns after the update. I added the extra postcode
criteria in the select to isolate what the update does but it still updates
the 3000 rows. Weird?
UPDATE marc_POt_lu_rd_post_code
SET County_id = c.County_id,
County_desc = c.County_Desc,
Parent_County_Id = c.Parent_County_Id,
Parent_County_desc = c.County_desc,
Sector_Id = d.Sector_Id,
Sector_Desc = d.Sector_Desc,
Area_Id = e.Area_Id,
Area_Desc = e.Area_Desc
-- Select *
FROM Pot_lu_County_Area_PostCodes a,
QUINN_st..GET_BCP_H_POSTCODES b,
Pot_lu_county c,
Pot_lu_Sectors d,
Pot_lu_Areas e
WHERE a.Postcode = b.Four_Char_Post_Codes
AND b.COUNTY = c.County_Desc
AND b.SECTOR = d.Sector_Desc
AND b.AREA = e.Area_Desc
and a.Postcode = b.Four_Char_Post_Codes
and b.Four_Char_Post_Codes = 'mk40'found the issue
"marcmc" wrote:

> The following sql updates 300 records(3000 records in the
> marc_POt_lu_rd_post_code table) but the select element only returns one ro
w.
> I am attempting to update the 3000 rows which it does but it does it
> incorrectly in that the results set from the select portion does not match
> what the results set returns after the update. I added the extra postcode
> criteria in the select to isolate what the update does but it still update
s
> the 3000 rows. Weird?
> UPDATE marc_POt_lu_rd_post_code
> SET County_id = c.County_id,
> County_desc = c.County_Desc,
> Parent_County_Id = c.Parent_County_Id,
> Parent_County_desc = c.County_desc,
> Sector_Id = d.Sector_Id,
> Sector_Desc = d.Sector_Desc,
> Area_Id = e.Area_Id,
> Area_Desc = e.Area_Desc
> -- Select *
> FROM Pot_lu_County_Area_PostCodes a,
> QUINN_st..GET_BCP_H_POSTCODES b,
> Pot_lu_county c,
> Pot_lu_Sectors d,
> Pot_lu_Areas e
> WHERE a.Postcode = b.Four_Char_Post_Codes
> AND b.COUNTY = c.County_Desc
> AND b.SECTOR = d.Sector_Desc
> AND b.AREA = e.Area_Desc
> and a.Postcode = b.Four_Char_Post_Codes
> and b.Four_Char_Post_Codes = 'mk40'
>

funny search results with 'contains' clause

hi,
it is really funny how ft search works:
it seems to depend highly on what could be indexed, but it still doesn't
follow a determined order.
consider the following queries:
select name from person where contains(name, 'hammer')
select name from person where contains(name, '"hammer*"')
the first is a query with a "simple term" and the second one with a
"prefix term".
mssql docu says that a simple term "specifies a match for an exact word",
but the first query returns other matches like "oberhammer" or
"hammerschmied" - this is not an exact match for me; the found words
rather consist of two words "ober", "schmied" and "hammer".
one would expect that the 1st and 2nd query work absolutely different but,
even the 2nd returns a lot more results, they seem to differ just slightly.
when searching for 'ober' (instead of 'hammer'), the 2nd query returns
"obermayr" and "oberlehner", but the 1st results only in "oberlehner",
although "ober", "mayr" and "lehner" are single words themselves.
and why does it find "Tober" or "Dober" if i only searched for 'ober'?
i need to know the rules which mssql uses for fulltext search. can someone
point me to a book or a website where i can find more information? or does
somebody have a good explanation?
btw, we use sql2000 and a german collation.
klaus triendl
unfortunately this behavior is caused by the German wordbreaker. You might
get better results with the neutral word breaker.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"klaus triendl" <triendl.kj@.m-box.at> wrote in message
news:opsmm8g1r7cm4gx4@.dev4xp.wasser.local...
> hi,
> it is really funny how ft search works:
> it seems to depend highly on what could be indexed, but it still doesn't
> follow a determined order.
> consider the following queries:
> select name from person where contains(name, 'hammer')
> select name from person where contains(name, '"hammer*"')
> the first is a query with a "simple term" and the second one with a
> "prefix term".
> mssql docu says that a simple term "specifies a match for an exact word",
> but the first query returns other matches like "oberhammer" or
> "hammerschmied" - this is not an exact match for me; the found words
> rather consist of two words "ober", "schmied" and "hammer".
> one would expect that the 1st and 2nd query work absolutely different but,
> even the 2nd returns a lot more results, they seem to differ just
slightly.
> when searching for 'ober' (instead of 'hammer'), the 2nd query returns
> "obermayr" and "oberlehner", but the 1st results only in "oberlehner",
> although "ober", "mayr" and "lehner" are single words themselves.
> and why does it find "Tober" or "Dober" if i only searched for 'ober'?
>
> i need to know the rules which mssql uses for fulltext search. can someone
> point me to a book or a website where i can find more information? or does
> somebody have a good explanation?
> btw, we use sql2000 and a german collation.
>
> --
> klaus triendl
|||klaus,
Could you post the full output of the below SQL code as it is most helpful
in troubleshooting SQL FTS issues.
use <your_database_name_here>
go
SELECT @.@.language
SELECT @.@.version
sp_configure 'default full-text language'
EXEC sp_help_fulltext_catalogs
EXEC sp_help_fulltext_tables
EXEC sp_help_fulltext_columns
EXEC sp_help <your_FT-enable_table_name_here>
go
Specifically, the OS-supplied and language-specific wordbreaker along with
the actual text (single language or mixed?) you are storing in your
FT-enabled table's column is most important information!
Thanks,
John
SQL Full Text Search Blog
http://spaces.msn.com/members/jtkane/
"klaus triendl" <triendl.kj@.m-box.at> wrote in message
news:opsmm8g1r7cm4gx4@.dev4xp.wasser.local...
> hi,
> it is really funny how ft search works:
> it seems to depend highly on what could be indexed, but it still doesn't
> follow a determined order.
> consider the following queries:
> select name from person where contains(name, 'hammer')
> select name from person where contains(name, '"hammer*"')
> the first is a query with a "simple term" and the second one with a
> "prefix term".
> mssql docu says that a simple term "specifies a match for an exact word",
> but the first query returns other matches like "oberhammer" or
> "hammerschmied" - this is not an exact match for me; the found words
> rather consist of two words "ober", "schmied" and "hammer".
> one would expect that the 1st and 2nd query work absolutely different but,
> even the 2nd returns a lot more results, they seem to differ just
slightly.
> when searching for 'ober' (instead of 'hammer'), the 2nd query returns
> "obermayr" and "oberlehner", but the 1st results only in "oberlehner",
> although "ober", "mayr" and "lehner" are single words themselves.
> and why does it find "Tober" or "Dober" if i only searched for 'ober'?
>
> i need to know the rules which mssql uses for fulltext search. can someone
> point me to a book or a website where i can find more information? or does
> somebody have a good explanation?
> btw, we use sql2000 and a german collation.
>
> --
> klaus triendl
|||I am raising a support incident on this one Klaus.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:u3I$G3ZGFHA.4004@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> unfortunately this behavior is caused by the German wordbreaker. You might
> get better results with the neutral word breaker.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "klaus triendl" <triendl.kj@.m-box.at> wrote in message
> news:opsmm8g1r7cm4gx4@.dev4xp.wasser.local...
word",[vbcol=seagreen]
but,[vbcol=seagreen]
> slightly.
someone[vbcol=seagreen]
does
>

Funny search error

I have two fields I am searching on ... address and zipCode

When I have both pieces of data, everything is fine, i get back the expected results, but i am unable able to search on the individual pieces. Here is the SQL I am using. It's placed within a store procedure in Sqlserver that I amreferencing from my VB.net code... any help??


IF ((NOT @.address IS NULL) AND( NOT @.zipCode IS NULL))
BEGIN
SELECT OrderNumber FROM Orders WHERE ShpAddr_Address1 = @.address AND ShpAddr_ZipCode = @.zipCode
END

ELSE IF NOT @.address IS NULL
BEGIN
SELECT OrderNumber FROM Orders WHERE ShpAddr_Address1 = @.address
END

ELSE IF NOT @.zipCode IS NULL
BEGIN
SELECT OrderNumber FROM Orders WHERE ShpAddr_ZipCode = @.zipCode
END

any help would be great. thanksMy guess is that your parameters (@.address and @.zipCode) contain empty strings, not NULLs.

You VB.NET code should be setting the parameter value to SQLString.Null if the user did not choose to use the parameter.

I would then also consider changing your stored procedure to simply this:


SELECT OrderNumber FROM Orders WHERE ShpAddr_Address1 = ISNULL(@.address,ShpAddr_Address1) AND ShpAddr_ZipCode = ISNULL(@.zipCode,ShpAddr_ZipCode)

I make this suggestion for ease of code maintenance. I myself have gotten burned several times over the past month by not changing all relevant similar blocks of code in a stored procedure when the logic needed to change.

Terri|||I'm trying this right now as we speak, but my program refuses to reconize what a "SqlString" is. Is there anything special i have to import?|||It's in the System.Data.SqlTypes namespace, so you can either import the namespace or reference it with the fully qualified name: System.Data.SqlTypes.SqlString.Null.

Terri

Funny Results from using Surface Area Configuration for Features

Hi,
I am using a Windows account that is a local admin on the server yet when I
use Surface Area Configuration for features I only see Reporting Services
and Integration Services. I understand that this feature is using WMI but
what would stop me from seeing the actual Database Engine components?
Thanks
Chris
Worse still I can only see those 2 services when I use the Configuration
Manager/SQL Server 2005 Services. Some how I have lost the ability to see
all the services. I would have to believe that this is a permissions
problem?
Thanks
Chris
"Chris Wood" <anonymous@.discussions.microsoft.com> wrote in message
news:uKkwuy1iHHA.3452@.TK2MSFTNGP04.phx.gbl...
> Hi,
> I am using a Windows account that is a local admin on the server yet when
> I use Surface Area Configuration for features I only see Reporting
> Services and Integration Services. I understand that this feature is using
> WMI but what would stop me from seeing the actual Database Engine
> components?
> Thanks
> Chris
>
|||Could this have happened because a different person, using a different
Windows Account, used Microsoft Update to update the server? Has some
permissions been changed to the other account?
Thanks
Chris
"Chris Wood" <anonymous@.discussions.microsoft.com> wrote in message
news:OG618d2iHHA.1884@.TK2MSFTNGP06.phx.gbl...
> Worse still I can only see those 2 services when I use the Configuration
> Manager/SQL Server 2005 Services. Some how I have lost the ability to see
> all the services. I would have to believe that this is a permissions
> problem?
> Thanks
> Chris
> "Chris Wood" <anonymous@.discussions.microsoft.com> wrote in message
> news:uKkwuy1iHHA.3452@.TK2MSFTNGP04.phx.gbl...
>

Funny Results from using Surface Area Configuration for Features

Hi,
I am using a Windows account that is a local admin on the server yet when I
use Surface Area Configuration for features I only see Reporting Services
and Integration Services. I understand that this feature is using WMI but
what would stop me from seeing the actual Database Engine components?
Thanks
ChrisWorse still I can only see those 2 services when I use the Configuration
Manager/SQL Server 2005 Services. Some how I have lost the ability to see
all the services. I would have to believe that this is a permissions
problem?
Thanks
Chris
"Chris Wood" <anonymous@.discussions.microsoft.com> wrote in message
news:uKkwuy1iHHA.3452@.TK2MSFTNGP04.phx.gbl...
> Hi,
> I am using a Windows account that is a local admin on the server yet when
> I use Surface Area Configuration for features I only see Reporting
> Services and Integration Services. I understand that this feature is using
> WMI but what would stop me from seeing the actual Database Engine
> components?
> Thanks
> Chris
>|||Could this have happened because a different person, using a different
Windows Account, used Microsoft Update to update the server? Has some
permissions been changed to the other account?
Thanks
Chris
"Chris Wood" <anonymous@.discussions.microsoft.com> wrote in message
news:OG618d2iHHA.1884@.TK2MSFTNGP06.phx.gbl...
> Worse still I can only see those 2 services when I use the Configuration
> Manager/SQL Server 2005 Services. Some how I have lost the ability to see
> all the services. I would have to believe that this is a permissions
> problem?
> Thanks
> Chris
> "Chris Wood" <anonymous@.discussions.microsoft.com> wrote in message
> news:uKkwuy1iHHA.3452@.TK2MSFTNGP04.phx.gbl...
>sql

Funny Results from using Surface Area Configuration for Features

Hi,
I am using a Windows account that is a local admin on the server yet when I
use Surface Area Configuration for features I only see Reporting Services
and Integration Services. I understand that this feature is using WMI but
what would stop me from seeing the actual Database Engine components?
Thanks
ChrisWorse still I can only see those 2 services when I use the Configuration
Manager/SQL Server 2005 Services. Some how I have lost the ability to see
all the services. I would have to believe that this is a permissions
problem?
Thanks
Chris
"Chris Wood" <anonymous@.discussions.microsoft.com> wrote in message
news:uKkwuy1iHHA.3452@.TK2MSFTNGP04.phx.gbl...
> Hi,
> I am using a Windows account that is a local admin on the server yet when
> I use Surface Area Configuration for features I only see Reporting
> Services and Integration Services. I understand that this feature is using
> WMI but what would stop me from seeing the actual Database Engine
> components?
> Thanks
> Chris
>|||Could this have happened because a different person, using a different
Windows Account, used Microsoft Update to update the server? Has some
permissions been changed to the other account?
Thanks
Chris
"Chris Wood" <anonymous@.discussions.microsoft.com> wrote in message
news:OG618d2iHHA.1884@.TK2MSFTNGP06.phx.gbl...
> Worse still I can only see those 2 services when I use the Configuration
> Manager/SQL Server 2005 Services. Some how I have lost the ability to see
> all the services. I would have to believe that this is a permissions
> problem?
> Thanks
> Chris
> "Chris Wood" <anonymous@.discussions.microsoft.com> wrote in message
> news:uKkwuy1iHHA.3452@.TK2MSFTNGP04.phx.gbl...
>> Hi,
>> I am using a Windows account that is a local admin on the server yet when
>> I use Surface Area Configuration for features I only see Reporting
>> Services and Integration Services. I understand that this feature is
>> using WMI but what would stop me from seeing the actual Database Engine
>> components?
>> Thanks
>> Chris
>

Funny problem (bug?) using MAX() on SQL Mobile

This sure looks like a bug, but I'm still new...

First I create a simple database:

SqlCeEngine eng = new SqlCeEngine(@."Data Source=\My Documents\test.sdf");
eng.CreateDatabase();
eng.Dispose();

Then I put something in it:

SqlCeConnection conn = new SqlCeConnection(@."Data Source=\My Documents\test.sdf");
SqlCeCommand cmd = new SqlCeCommand("CREATE TABLE myTable (ID int, name nchar(10))");
cmd.Connection=conn;
conn.Open();
cmd.ExecuteNonQuery();
cmd.CommandText="INSERT INTO myTable (ID, name) VALUES (1,'bill')";
cmd.ExecuteNonQuery();

Then I try to get the maximum value from the first column.

cmd.CommandText = "SELECT max(ID) FROM myTable";
int index = (int)cmd.ExecuteScalar();

At this point I get an InvalidCastException raised. Using the datareader to extract the value produces the same exception, however I can go through the Query Analyzer on the device and execute the query and it comes out fine...?

This has really got me confused. Any thoughts?

What object type you're actually getting?|||Good question--how do I find that out?|||

you should NEVER cast the result of an execute scalar before you check for DBNull (not the same as C# null or VB Nothing) being returned.

VB.NET

Dim o As Object = cmd.ExecuteScalar()
If Not IsDBNull(o) Then

' now it's safe to cast the result

End If

-Darren

|||

You can look in the debugger or you can print out type name:

object o = ...;

// Get that mysteries type here

string s = o.GetType().ToString();

// Print out string here

And yes, you do need to check for DBNull.

|||

Yes, I'm still learning this stuff...

It turns out an System.Int64 is being returned. That hadn't occured to me since I was under the impression that MAX() will return the type that it operates on (in this case an int32). Nevertheless, I am now able to successfully cast it to an int32 and use it in my program.

Thanks for your help guys. Problem solved.

Monday, March 19, 2012

Funny network behaviour

Hi,

In order to establish a security enhanced SQL server setup, I tried
to switch off network access by disabling all networking protocols,
so that the server can only be reached through a pipe. Nevertheless
the server was visible in the network and could be accessed from
all clients. Does anybody know what is going on here?

GeorgGeorg Kreyerhoff wrote:
> Hi,
> In order to establish a security enhanced SQL server setup, I tried
> to switch off network access by disabling all networking protocols,
> so that the server can only be reached through a pipe. Nevertheless
> the server was visible in the network and could be accessed from
> all clients. Does anybody know what is going on here?
>
some more information on what I found out:

Even if tcp-ip and all other networking protocols are disabled in the
SQL-server configuration (only named pipes were enabled), Clients and Server
seem to be able to communicate via the Netbios-ports (Netbios-service
was still enabled on the machine). Do named pipes work over Netbios?
Or what is going on?

Georg

Funny error during runs

Can any one please help explain why this error has happened, it is not a normal error of SSIS,

"SSIS Debug host has encountered a problem and needs to close. We are sorry for the inconvenience"

It has 2 buttons Debug and Close, this error happened in the middle of a script task.

This is a classic Microsoft problem. I face this problem often.

These are the scenarios on which I usually get this probelm:

1. If there is less memory on the client system where VB studio is open, and trying lot of mouse clicks frequently.

2. It is observed more when in Debug mode, when you try to scroll using the middle wheel of the mouse.

After I upgraded my desktop RAM to 3GB, and often system restart at the start of the day, I observed this error is less.

Also always saving and building frequently of the packages will help to retain your work. Other than these, there is no real solution from what I observed.

funny error - the parameter menu screen...

Here is a funny one:
When scrolling through the dropdown box using the up and down arrow
keys, the following error is received:
Steps to reproduce: select an item in the dropdownbox. Change the
selected item by scrolling through the dropdown box using the up and
down arrow keys.
error
There are too many people accessing the Web site at this timeHello Harry,
If you are on XP, then I suspect that what is happening is that you are
locked down by default to a connection limit of 10 to IIS, and you are
running out of connections.
In the Hitchhiker's Guide to SQL Server 2000 Reporting Services, Bill and I
show how you can up the connection limit to 40 using the MetaEdit tool. We
include the details in Appendix D - pages 703 - 705 and also on the DVD
Video content.
This Guide me! demonstration is an example taken from the book's DVD and
explains how to up that connection limit to 40.
http://www.sqlreportingservices.net/SampleGuideMe.htm
Peter Blackburn
Hitchhiker's Guide to SQL Server 2000 Reporting Services
www.sqlreportingservices.net
"Harry" <harshwardhan@.mailcity.com> wrote in message
news:e48fb32a.0410191647.36ed5dcc@.posting.google.com...
> Here is a funny one:
> When scrolling through the dropdown box using the up and down arrow
> keys, the following error is received:
> Steps to reproduce: select an item in the dropdownbox. Change the
> selected item by scrolling through the dropdown box using the up and
> down arrow keys.
> error
> There are too many people accessing the Web site at this time

Funny DateTime Issues

Hello this is weird when I run this on a Friday
SELECT DATENAME(dw,5) --> returns 'Saturday'
Select DATEPART(dw,GETDATE()) --> returns 5
Can anyone explain why this would occur?Check your @.@.DATEFIRST value. It might be set to 1 ( Monday ). You can
change it using SET DATEFIRST statement.
Anith|||I think the problem in the first query is that sql see the number that you
pass as the day of the month or a Julian date. The value of the second
parameter to DATENAME should be a valid date. If you run SELECT DATENAME(dw,
GETDATE()) then you will get "Friday". The second query you have returns the
wday number. For example Sunday = 1...Saturday = 7. That can be changed
by SET DATEFIRST. But by default 5 is the wday number for Friday.
Hope that helps
Tim
"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:ewb3BkG7FHA.2628@.TK2MSFTNGP11.phx.gbl...
> Check your @.@.DATEFIRST value. It might be set to 1 ( Monday ). You can
> change it using SET DATEFIRST statement.
> --
> Anith
>|||The second parameter for DATENAME is a date - this call is getting the
day of the w for 1900-01-06, which is a Saturday. The implicit
conversion is based on 0=1900-01-01, ergo 5=1900-01-06.
As Anith has said, DATEPART is dependent on DATEFIRST, which is probably
set to Monday in your system.
yurps wrote:
> Hello this is weird when I run this on a Friday
> SELECT DATENAME(dw,5) --> returns 'Saturday'
> Select DATEPART(dw,GETDATE()) --> returns 5
> Can anyone explain why this would occur?
>|||Ok, if this is the case, try this out and explain why it works
set datefirst 1
declare @.bd datetime
select @.bd = '2005-12-01 00:00:00';
with dd (FullDateAlternateKey,
DayNumberOfW,HourNumber,EnglishDayNam
eOfW)
as
(
select @.bd,datepart(dw,@.bd),datepart(hh,@.bd),da
tename(dw,@.bd)
union all
select dateadd(hh,1,FullDateAlternateKey)
,datepart(dw,dateadd(hh,1,FullDateAltern
ateKey))
,datepart(hh,dateadd(hh,1,FullDateAltern
ateKey))
,datename(dw,day(dateadd(dw,2,dateadd(hh
,1,FullDateAlternateKey))))
from dd
where FullDateAlternateKey<='2005-12-31'
)
select * from dd
option (maxrecursion 0)
You will notice that I have added a dateadd(dw,2,...) in the recursive part.
Try pulling it out you will find (at least that is what happens in my
system) that the day returned is two days back from the actual day.
Am I doing something wrong?
"Trey Walpole" wrote:

> The second parameter for DATENAME is a date - this call is getting the
> day of the w for 1900-01-06, which is a Saturday. The implicit
> conversion is based on 0=1900-01-01, ergo 5=1900-01-06.
> As Anith has said, DATEPART is dependent on DATEFIRST, which is probably
> set to Monday in your system.
> yurps wrote:
>