Showing posts with label couple. Show all posts
Showing posts with label couple. Show all posts

Friday, March 23, 2012

Fuzzy Lookup problems.

Fuzzy lookup seems to be causing some problems to me. It seems to work at times and doesn't at other times. It would work a couple of times fine and give me the desired results but then without changing anything in the dataflow or the data the next few times it would not run at all and fail the pre-execute of the.

Now I'm currently getting the following error:

[Fuzzy Lookup [248]] Error: An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Login timeout expired". An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.". An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Named Pipes Provider: Could not open a connection to SQL Server [233]. ".

[DTS.Pipeline] Warning: A call to the ProcessInput method for input 249 on component "Fuzzy Lookup" (248) unexpectedly kept a reference to the buffer it was passed. The refcount on that buffer was 2 before the call, and 1 after the call returned.

[DTS.Pipeline] Error: The ProcessInput method on component "Fuzzy Lookup" (248) failed with error code 0xC0202009. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.

Any help would be appreciated.

It looks to be a connectivity issue. My first avenue of investigation would be to use Profiler to see if you can see the connection attempt coming into SQL Server.

-Jamie

sql

Friday, March 9, 2012

function problem, referring to another function

I'm trying to create a couple of functions and am running into a problem
that I cannot explain. This uses Northwind database.
First of all, this one works:
---
ALTER FUNCTION fnCustomers
(
@.Initial VARCHAR(1)
)
RETURNS @.Cust TABLE
(
CustomerID VARCHAR(100)
)
AS
BEGIN
INSERT @.Cust
SELECT CustomerID from Customers where CustomerID LIKE '%' + @.INITIAL +
'%'
RETURN
END
---
and I can execute this:
SELECT * from dbo.fnCustomers('A')
and get results. Cool.
Now I want to extend this with another function that counts the results from
the first function:
---
ALTER FUNCTION fnCustomersCount
(
@.Initial VARCHAR(1)
)
RETURNS VARCHAR(10)
AS
BEGIN
DECLARE @.CustCount INT
SELECT @.CustCount = CustomerID
FROM fnCustomers(@.Initial)
GROUP BY CustomerID
RETURN @.CustCount
END
---
But thatdoesn't seem to work.
Select * from fnCustomersCount ('A')
gives me an error: Invalid object name 'fnCustomersCount'.
what am I doing wrong?Hello, mrmagoo
When invoking scalar UDF-s, you must use the UDF in an expression (not
in the FROM clause) and you must specify the object owner, like this:
SELECT dbo.fnCustomersCount ('A')
And by the way, why does your function return a varchar(10) instead of
an int ?
Razvan|||Try dbo.fnCustomersCount
Regards
Roji. P. Thomas
http://toponewithties.blogspot.com
"mrmagoo" <-> wrote in message
news:eHB%23no%23SGHA.4900@.TK2MSFTNGP09.phx.gbl...
> I'm trying to create a couple of functions and am running into a problem
> that I cannot explain. This uses Northwind database.
> First of all, this one works:
> ---
> ALTER FUNCTION fnCustomers
> (
> @.Initial VARCHAR(1)
> )
> RETURNS @.Cust TABLE
> (
> CustomerID VARCHAR(100)
> )
> AS
> BEGIN
> INSERT @.Cust
> SELECT CustomerID from Customers where CustomerID LIKE '%' + @.INITIAL +
> '%'
> RETURN
> END
> ---
> and I can execute this:
> SELECT * from dbo.fnCustomers('A')
> and get results. Cool.
> Now I want to extend this with another function that counts the results
> from
> the first function:
> ---
> ALTER FUNCTION fnCustomersCount
> (
> @.Initial VARCHAR(1)
> )
> RETURNS VARCHAR(10)
> AS
> BEGIN
> DECLARE @.CustCount INT
> SELECT @.CustCount = CustomerID
> FROM fnCustomers(@.Initial)
> GROUP BY CustomerID
> RETURN @.CustCount
> END
> ---
> But thatdoesn't seem to work.
> Select * from fnCustomersCount ('A')
> gives me an error: Invalid object name 'fnCustomersCount'.
> what am I doing wrong?
>
>|||Thanks.
You're right. Originally it was returning an INT. I played around with it
and forgot to change it back.
Appreciate your help!
"Razvan Socol" <rsocol@.gmail.com> wrote in message
news:1142837800.513726.290670@.i39g2000cwa.googlegroups.com...
> Hello, mrmagoo
> When invoking scalar UDF-s, you must use the UDF in an expression (not
> in the FROM clause) and you must specify the object owner, like this:
> SELECT dbo.fnCustomersCount ('A')
> And by the way, why does your function return a varchar(10) instead of
> an int ?
> Razvan
>|||Hi
I don't think you need the second UDF. I think you would like to count the
customers , am I right?
ALTER FUNCTION fnCustomers
(
@.Initial VARCHAR(1)
)
RETURNS @.Cust TABLE
(
CustomerID VARCHAR(100)
)
AS
BEGIN
INSERT @.Cust
SELECT CustomerID from Customers where CustomerID LIKE @.INITIAL +'%'
RETURN
END
SELECT COUNT(*) FROM dbo.fnCustomers('A%')
"mrmagoo" <-> wrote in message
news:OM0BMx%23SGHA.4608@.tk2msftngp13.phx.gbl...
> Thanks.
> You're right. Originally it was returning an INT. I played around with it
> and forgot to change it back.
> Appreciate your help!
>
> "Razvan Socol" <rsocol@.gmail.com> wrote in message
> news:1142837800.513726.290670@.i39g2000cwa.googlegroups.com...
>

Sunday, February 26, 2012

Fully editable datagrid

I have been trying to formulate a fully editabe datagrid for a couple of days with no luck. I have used code from 4guys and some other sites and am at the point where I can render the datagrid correctly (as a bouncolumn and template column-textbox) but when I try to update the database it all falls apart. I am getting "input string was not in a correct format" and the error references ...
Dim id as Integer = Convert.ToInt32(sls.DataKeys(dgi.ItemIndex))

I suspect the problem lies in the area of primary indexes and such. The table I am using is a simple two-column table with usernames, passwords. Username is the primary field. Here is the actual code I am using...
<code>
<%@. Page Explicit="True" Language="VB" Debug="True" %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.OleDb" %>
<html>

<script runat="server">
Dim Connect As OleDbConnection = New OleDbConnection
Dim Adapter As OleDbDataAdapter = New OleDbDataAdapter
Dim DS As DataSet = New DataSet
Dim ConnectString, SelectStatement As String

Sub Page_Load(Sender As Object, E As EventArgs)

If Not IsPostBack Then
SelectStatement = "Select * From Table"
ConnectString = "Provider=SQLOLEDB;UID=;PWD=;" & "Data Source=;Initial Catalog=;"

Connect.ConnectionString = ConnectString
Adapter.SelectCommand = New oleDbCommand(SelectStatement, Connect)
Adapter.SelectCommand.Connection.Open
Adapter.Fill(DS, "Items")
sls.Datasource = DS.Tables("Items")
Page.Databind
Connect.Close()
End If
End Sub

Sub Click(sender As Object, e As EventArgs)

Dim myConnection as New OleDbConnection(ConnectString)
Dim updateSQL as String = "UPDATE Table SET password = @.Password WHERE Username = @.ID"
Dim myCommand as New oleDbCommand(updateSQL, myConnection)

Dim dgi as DataGridItem
For Each dgi in sls.Items
'Read in the Primary Key Field
Dim id as Integer = Convert.ToInt32(sls.DataKeys(dgi.ItemIndex))
Dim password as String = CType(dgi.FindControl("txtPass"), TextBox).Text


'Issue an UPDATE statement...

myCommand.Parameters.Clear()
myCommand.Parameters.Add("@.ID", id)
myCommand.Parameters.Add("@.Password", password)


myCommand.ExecuteNonQuery()
Next

End Sub


</script>
<body>
<form runat="Server">

<asp:datagrid id="sls" runat="server" AutoGenerateColumns="False" datakeyfield="Username">

<Columns>
<asp:BoundColumn HeaderText="UserName" datafield="Username"/>


<asp:TemplateColumn HeaderText="Password">
<ItemTemplate>
<asp:TextBox runat="server" id="txtPass" Columns="10"
Text='<%# DataBinder.Eval(Container, "DataItem.Password") %>' />
</ItemTemplate>
</asp:TemplateColumn>

</Columns>
</asp:datagrid><asp:button id="Update" text="Update All" runat="Server" onclick="Click"/>
</form>
</body>
</html>
</code>
Anyone have any idea as to why the id variable (error message above) is causing problems?

Hi Choochmcgee,
You have the DataKeyField="UserName" in your datagrid setup rather than the Id...
<asp:datagrid id="sls" runat="server" AutoGenerateColumns="False" datakeyfield="Username">
So when you try to pass the key field to the procedure with this line...
Dim id as Integer = Convert.ToInt32(sls.DataKeys(dgi.ItemIndex))
it's going to error because it can't covnert an alphanumeric username to an int32. Change the DataKeyField to match your ID field and that should clear it up.|||

RJA,
Thanks for the response. I have datakeyfield set to "Username" because "Username" is the unique (primary key) column in that table. There are only two columns, username and password. I understand what you are saying about converting alphanumeric to integer but what would I use as the "ID field" you mentioned at the end of your post?

Thanks,
CM

Full-text working sporadically

I have full-text running on one database only. This index seems to have
issues about once every couple of weeks. Normally, a search can be done (via
webpage) on a keyword - and it works fine. But there are times that no
keyword (or other options) searches will work. The only option that is
searchable is "records updated in the last x number of days". So it's like
the full-text searching 1/2 works.
I have ran the stored procedure to ensure FTS was installed properly.
The MSSearch server is running under the local system account (as it should
be per MS).
I have deleted and rebuilt it complete. I have tried to rebuild the index
via the wizard and by right-clicking on the Full-Text Catalog -- neither
fixed the issue.
I've ran the stored procedure to ensure it was enabled.
Anyone have any idea why my FTS will work completely one day and work "a
little" the next?
Thanks!
Key
Can you check the gatherer logs to see if they reveal anything?
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.
This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.
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
"KEY" <key.hammonds@.gmail.com> wrote in message
news:F6E6798B-FA95-4C20-BBE7-104CE05B4B80@.microsoft.com...
>I have full-text running on one database only. This index seems to have
> issues about once every couple of weeks. Normally, a search can be done
> (via
> webpage) on a keyword - and it works fine. But there are times that no
> keyword (or other options) searches will work. The only option that is
> searchable is "records updated in the last x number of days". So it's
> like
> the full-text searching 1/2 works.
> I have ran the stored procedure to ensure FTS was installed properly.
> The MSSearch server is running under the local system account (as it
> should
> be per MS).
> I have deleted and rebuilt it complete. I have tried to rebuild the index
> via the wizard and by right-clicking on the Full-Text Catalog -- neither
> fixed the issue.
> I've ran the stored procedure to ensure it was enabled.
> Anyone have any idea why my FTS will work completely one day and work "a
> little" the next?
> Thanks!
> Key

Fulltext search won't repopulate when running on batteries

Here's one that had me stumped for a good couple of hours.
While working on my laptop, I was trying to rebuild a fulltext search
catalog. I tried numerous times repopulating, deleting and rebuilding.
whenever I tried to start it populating, I got messages in the event
log saying the crawl had started, but no sign of any disk or CPU
activity.
Eventually, I just had a hunch to try and plug it into the mains power
and all of a sudden the indexing sprung into life. Seens it won't
start the indexing process when running on batteries!!
I've searched all over the documentation and the web but I can't find
any other references to this feature.
Andy
Your observation is correct. The indexing process does pause when your
computer is on batteries.
Have a look at
www.microsoft.com/exchange/ techinfo/deployment/2000/bestindexing.doc
Which is for exchange which uses the same indexing and querying engine that
SQL FTS uses. It has this reference.
Microsoft Gatherer: Reason to back off This counter shows the code
describing why the gathering service halted the population.
0 - Up and running
1 - High IO rate
4 - Back off on user activity (by default this is disabled in server
install)
5 - Battery low (currently, if running on battery, not on AC power)
"Andy Fish" <ajfish@.blueyonder.co.uk> wrote in message
news:c925c3dc.0501090219.7dda3d6a@.posting.google.c om...
> Here's one that had me stumped for a good couple of hours.
> While working on my laptop, I was trying to rebuild a fulltext search
> catalog. I tried numerous times repopulating, deleting and rebuilding.
> whenever I tried to start it populating, I got messages in the event
> log saying the crawl had started, but no sign of any disk or CPU
> activity.
> Eventually, I just had a hunch to try and plug it into the mains power
> and all of a sudden the indexing sprung into life. Seens it won't
> start the indexing process when running on batteries!!
> I've searched all over the documentation and the web but I can't find
> any other references to this feature.
> Andy
|||Andy,
You might want to checkout the links under "SQL Server 2000 Full-Text Search
Resources and Links" at:
http://spaces.msn.com/members/jtkane/Blog/cns!1pWDBCiDX1uvH5ATJmNCVLPQ!305.entry
Specifically, 323739 "INF: SQL Server 2000 Full-Text Search Deployment White
Paper"
Regards,
John
SQL Full Text Search Blog
http://spaces.msn.com/members/jtkane/
"Andy Fish" <ajfish@.blueyonder.co.uk> wrote in message
news:c925c3dc.0501090219.7dda3d6a@.posting.google.c om...
> Here's one that had me stumped for a good couple of hours.
> While working on my laptop, I was trying to rebuild a fulltext search
> catalog. I tried numerous times repopulating, deleting and rebuilding.
> whenever I tried to start it populating, I got messages in the event
> log saying the crawl had started, but no sign of any disk or CPU
> activity.
> Eventually, I just had a hunch to try and plug it into the mains power
> and all of a sudden the indexing sprung into life. Seens it won't
> start the indexing process when running on batteries!!
> I've searched all over the documentation and the web but I can't find
> any other references to this feature.
> Andy
|||Hmm, so to find out why it's stopped gathering, I'm expected to look in
performance monitor - now that is a bit obscure :-)
"John Kane" <jt-kane@.comcast.net> wrote in message
news:ueyAY5o9EHA.1264@.TK2MSFTNGP12.phx.gbl...
> Andy,
> You might want to checkout the links under "SQL Server 2000 Full-Text
> Search
> Resources and Links" at:
> http://spaces.msn.com/members/jtkane/Blog/cns!1pWDBCiDX1uvH5ATJmNCVLPQ!305.entry
> Specifically, 323739 "INF: SQL Server 2000 Full-Text Search Deployment
> White
> Paper"
> Regards,
> John
> --
> SQL Full Text Search Blog
> http://spaces.msn.com/members/jtkane/
>
> "Andy Fish" <ajfish@.blueyonder.co.uk> wrote in message
> news:c925c3dc.0501090219.7dda3d6a@.posting.google.c om...
>
|||Andy,
Yep, as before this paper was published (I was a *contributor*), there was
no other documentation on monitoring the MSSearch gathering process, so
obscure or not, it is at least public now! Look for more blog entries on
this topic at my blog!
Regards,
John
SQL Full Text Search Blog
http://spaces.msn.com/members/jtkane/
"Andy Fish" <ajfish@.blueyonder.co.uk> wrote in message
news:O9bO1TJ#EHA.2568@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> Hmm, so to find out why it's stopped gathering, I'm expected to look in
> performance monitor - now that is a bit obscure :-)
> "John Kane" <jt-kane@.comcast.net> wrote in message
> news:ueyAY5o9EHA.1264@.TK2MSFTNGP12.phx.gbl...
http://spaces.msn.com/members/jtkane/Blog/cns!1pWDBCiDX1uvH5ATJmNCVLPQ!305.entry
>