|
Sorry .. i didnt try any one from your clever ideas before...I think you should put your question as a new thread.
I hope one of the forum professional answer your question.
I am too late but i will never give up
|
|
|
|
|
Hi..
I have used Full-Text Search in a stored procedure with English words whithout any problems..But when i use it with Arabic words it gives me THE Error:
Server: Msg 7619, Level 16, State 1, Procedure SearchProject, Line 19
Execution of a full-text operation failed. A clause of the query contained only ignored words.
The stored procedure :
CREATE PROCEDURE SearchProject
(
@SearchString nvarchar(500),
@CultureName nvarchar(50),
@HowManyResults int OUTPUT
)
AS
CREATE TABLE #SearchTable
(
FieldNO int,
ProjectNO int,
ProjectName nvarchar(200),
ProjectDescription nvarchar(1000),
ProjectImage nvarchar(1000),
CultureID int
)
INSERT INTO #SearchTable (FieldNO,ProjectNO,ProjectName,ProjectDescription,ProjectImage,CultureID)
SELECT P.FieldNO, PL.ProjectNO,PL.ProjectName,PL.ProjectDescription,P.ProjectImage,PL.CultureID
FROM FREETEXTTABLE(Project_Locale,*,@SearchString) AS FT JOIN Project_Locale AS PL ON FT.[KEY]=PL.ProjectCultureID
JOIN Project AS P ON P.ProjectNO=PL.ProjectNO
WHERE PL.CultureID=dbo.GetCultureID(@CultureName)
INSERT INTO #SearchTable (FieldNO,ProjectNO,ProjectName,ProjectDescription,ProjectImage,CultureID)
SELECT P.FieldNO, PL.ProjectNO,PL.ProjectName,PL.ProjectDescription,P.ProjectImage,PL.CultureID
FROM Project_Locale AS PL ,Project AS P,
ProjectField_Locale AS FL,
FREETEXTTABLE(ProjectField_Locale,*,@SearchString) AS FT2
WHERE FL.FieldNO=P.FieldNO
AND FL.FieldCultureID=FT2.[KEY]
AND PL.ProjectNO=P.ProjectNO
AND PL.CultureID=dbo.GetCultureID(@CultureName)
AND FL.CultureID=dbo.GetCultureID(@CultureName)
INSERT INTO #SearchTable (FieldNO,ProjectNO,ProjectName,ProjectDescription,ProjectImage,CultureID)
SELECT P.FieldNO, PL.ProjectNO,PL.ProjectName,PL.ProjectDescription,P.ProjectImage,PL.CultureID
FROM Project_Locale AS PL ,Project AS P,
Feature_Locale AS PFEA,
ProjectFeature AS FP,
Feature AS F,
FREETEXTTABLE(Feature_Locale,*,@SearchString) AS FT3
WHERE FT3.[KEY]=PFEA.FeatureCultureID
AND FP.ProjectNO=P.ProjectNO
AND FP.FeatureNO=PFEA.FeatureNO
AND PL.ProjectNO=P.ProjectNO
AND F.FeatureNO=PFEA.FeatureNO
AND PFEA.CultureID=dbo.GetCultureID(@CultureName)
AND PL.CultureID=dbo.GetCultureID(@CultureName)
SELECT @HowManyResults=COUNT(DISTINCT ProjectNO) FROM #SearchTable
SELECT DISTINCT * FROM #SearchTable
RETURN
GO
I called the stored procedure using the following(in the Query Analayzer) :
USE nabeel1eagle
DECLARE @HowManyResults int
EXEC SearchProject 'ملفات','ar-SA',@HowManyResults OUTPUT
but when I use the previous code directly(without calling the stored procedure using EXEC) in the Query Analyzer it works fine.Like the following (part of the code)code:
SELECT P.FieldNO, PL.ProjectNO,PL.ProjectName,PL.ProjectDescription,P.ProjectImage,PL.CultureID
FROM FREETEXTTABLE(Project_Locale,*,'ملفات') AS FT JOIN Project_Locale AS PL ON FT.[KEY]=PL.ProjectCultureID
JOIN Project AS P ON P.ProjectNO=PL.ProjectNO
WHERE PL.CultureID=dbo.GetCultureID('ar-SA')
Could any one help and tell me how to solve this problem?
|
|
|
|
|
I am building software for controlling test stands with Borland C++ Builder 2006. This program uses a database. I like to create a new database during runtime with SQL-commands.
How can I realize this?
|
|
|
|
|
hi all i would like to know how to insert an image in a column which data type is binary and also how to retrieve such data
thank u all for ur help and support
abdelhameed81
|
|
|
|
|
|
well actualy i don't know how to do it with this binary or whatever but i did it by creating a column as text
i affected the root of the image in this field then i do some codes in vb.net
& it works
try to be good if you can't be the best
|
|
|
|
|
We are using .net application with oracle 9i database,we are trying to run a join query through our application but we are getting Server Application Unavailable error after the program runs for 5 minutes. we are using Windows 2003 operating system.how to increase the query performance through .net application.
There are three queries that run the aspx (output is a report in aspx). The first query returns between 9 - 18 records and is displayed horizontally.
The second query returns around 150 records. The third query returns one record for the combination of first and second query.
Thanks
|
|
|
|
|
Have you put a break point in your code, or trace statements to verify what is taking the time? If it is the database queries (when you get the data through the DataAdapter or DataReader) then the problem is likely with your database. How long does it take to run these queries through Oracle's tools?
If it takes a long time to run the queries then consider adding indexes. The columns specified in the where clause and the join are generally good candidates. If Oracle has a query profiler to assist in index tuning you might want to use that to see where the bottlenecks in the query are.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
HI EVERY BODY I'VE A PROBLEM IN MY CONNECTION TO SQLSERVER DATABASE THE ERROR I GOT IS
Device activation error the physical file name is incorrect
|
|
|
|
|
Possibly because some other application has the files open when SQL Server tries to "activate" the files. For example, Windows indexing tools like Windows Desktop Search or Google Desktop. Try shutting these down and retrying your operation.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
So I got 2 classes one I wrote to interrogate databases using normal ADO:
Mine:
<br />
SqlConnection myConnection = new SqlConnection(m_sConnectionString);<br />
<br />
SqlCommand myCommand = new SqlCommand(sQuery, myConnection);<br />
myCommand.CommandTimeout = 120;
<br />
myConnection.Open();<br />
<br />
SqlDataReader result = myCommand.ExecuteReader(CommandBehavior.CloseConnection);<br />
<br />
<br />
return result;<br />
Microsoft Way
<br />
SqlDatabase dbSvc = new SqlDatabase(m_sConnectionString);<br />
<br />
DbCommand dbCommand = dbSvc.GetSqlStringCommand(sQuery);<br />
<br />
return ((SqlDataReader)dbSvc.ExecuteReader(dbCommand));<br />
What's faster?
My way:
<br />
SqlConnection myConnection = new SqlConnection(m_sConnectionString);<br />
<br />
SqlCommand myCommand = new SqlCommand(sQuery, myConnection);<br />
myCommand.CommandTimeout = 120;
<br />
SqlDataAdapter myAdapter = new SqlDataAdapter(myCommand);<br />
<br />
DataTable myTable = new DataTable();<br />
myAdapter.Fill(myTable);<br />
<br />
myConnection.Close();<br />
myConnection.Dispose();<br />
myConnection = null;<br />
<br />
return (myTable);<br />
Microsoft Way:
<br />
SqlDatabase dbSvc = new SqlDatabase(m_sConnectionString);<br />
<br />
DbCommand dbCommand = dbSvc.GetSqlStringCommand(sQuery);<br />
<br />
DataTable dtData = null;<br />
DataSet dsData = dbSvc.ExecuteDataSet(dbCommand);<br />
<br />
dtData = dsData.Tables[0];<br />
<br />
return (dtData);<br />
Comments? Ideas?
Al
My eMail control
My Blog
|
|
|
|
|
|
When doing performance tests it is often very difficult to see small difierences on a single operation. I usually try several hundred iterations (accumulating the timing results with each iteration using a high precision timer class that calls QueryPerformanceCounter) and look at the average performance. This smoothes out minor jitter caused by the OS doing stuff, and usually gives a better measure, especially when the individual operation times are small.
We need to graduate from the ridiculous notion that greed is some kind of elixir for capitalism - it's the downfall of capitalism. Self-interest, maybe, but self-interest run amok does not serve anyone. The core value of conscious capitalism is enlightened self-interest.
Patricia Aburdene
|
|
|
|
|
Hi,
I have a ComboBox displays Status values which are three strings set at design-time. They are Active, Suspended, Disabled. Also I have a DataSet named dsUser which contains a DataTable named tblUser. tblUser has a DataColumn named Status. I navigate through the record in tblUser using a BindingNavigator and a BindingSource component which are automatically created for me by the designer. If I bind the SelectedItem property to tblUserBindingSource´s Status filed, everytime I move from one record to another fires OnColumnChanged event for the Status column. That makes DataRow modified although in fact, it is not modified so when I use dsUser.HasChanges(), it always returns true. How can I prevent this problem? On FormClosing event, I want to ask the user to save changes if tblUser is modified but this wrong firing makes it always modified wrongly. Please help!!!!!!!!!
|
|
|
|
|
Not sure if I have the right forum but really stuck and in need of help.
Problem: I have an SQL Server Table containing records. I load these records into a recordset. I then create a DBF Table. After creation I now want to load the SQL Records into the newly created DBF table. Simple enough but I keep getting errors. Here is my code:
<br />
'Create Table<br />
cnn.Open( _<br />
"Provider=Microsoft.Jet.OLEDB.4.0;" & _<br />
"Data Source=C:\;" & _<br />
"Extended Properties=dBase III;")<br />
<br />
strSQL = "CREATE TABLE Test" & _<br />
"(ID Text(50),")<br />
<br />
'Create Connection<br />
conn2 = CreateObject("ADODB.Connection")<br />
conn2.Open("Provider=Microsoft.Jet.OLEDB.4.0;" & _<br />
"Data Source=" & Path & ";" & _<br />
"Extended Properties=""DBASE III;"";")<br />
-<br />
-<br />
rs2 = conn2.Execute("SELECT * FROM Test")<br />
<br />
' Create Connection To SQL<br />
-<br />
-<br />
rss2.OpenRecordSet("SELECT * FROM SQL_Table")<br />
<br />
'Portion that gives a problem.<br />
<br />
While Not rss2.EOF<br />
rs2.AddNew()<br />
rs2.Fields("ID").Value = rss2!ID<br />
rs2.Update()<br />
rss2.MoveNext()<br />
End While<br />
<-/code><br />
<br />
All of the connections work. The table is created. Now I have a problem transferring the recordsets from the SQL Recordset to the DBF. An error says: "Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype."<br />
<br />
Any way to fix this using the existing code? Any help is REALLY appreciated. Thanks in advance.
|
|
|
|
|
OpenRecordSet has some additional parameters for type, options,etc. Not sure what the defaults might be for DBASE provider,(access would be forwardonly, readonly) but you might not have a recordset that supports updates. This is particularly likely with a recordset opened with Connection.Execute().
Try opening a recordeset on the DBASE table by createing a new Recordset object, opening it with
Rsnew.Open("select * from Test", conn2, adOpenDynamic,adLockOptimistic,adCmdText)
We need to graduate from the ridiculous notion that greed is some kind of elixir for capitalism - it's the downfall of capitalism. Self-interest, maybe, but self-interest run amok does not serve anyone. The core value of conscious capitalism is enlightened self-interest.
Patricia Aburdene
|
|
|
|
|
That would make sense. I tried the code you supplied, but had an error, those three objects are not declared. I assume I need to add a reference. I am using Visual Studios 2005. Any idea which reference it is? Or how to declare "adOpenDynamic,adLockOptimistic,adCmdText" ? - Thanks again.
|
|
|
|
|
If you are using .Net, you should use System.Data.OleDb class, rather than the "old" ado stuff.
I suspect you must have added a reference to msado.dll in order to get the Ado classes, probably need some of the other dlls to get the enumerations exposed( or they're there but need the enumeration prefix - CursorType.adDynamic, etc.)
Use SqlClient classes for SQL Server, they're much faster than the OleDb (although you can use either for SQL, just a bit more overhead in the oleDb.
We need to graduate from the ridiculous notion that greed is some kind of elixir for capitalism - it's the downfall of capitalism. Self-interest, maybe, but self-interest run amok does not serve anyone. The core value of conscious capitalism is enlightened self-interest.
Patricia Aburdene
|
|
|
|
|
hi all,
i want to take backup my database with query. pls help
and give me query
vipin
|
|
|
|
|
I assume your using SQL Server 2000
Construct a DTS package that will do the backup.
This can be run with TSQL
Example below of running a DTS package via TSQL
exec master.dbo.xp_cmdshell 'dtsrun -E -Sserver1 -N"Export Invoices"'
Google has lots of examples on how to do this.
Look where you want to go not where you don't want to crash.
Bikers Bible
|
|
|
|
|
You can use BACKUP[^]
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Hi
I want to use a blank (empty string but not null) as a default value for varchar column in SQL server 2000. Is this possible and if it is, how do I do it (in Enterprise Manager if possible)?
Just so that I don’t get a lot of why do you want to do that answers. The underlying data access layer I use need blank values or it won’t create a correct xml files.
Thanks
Johan
|
|
|
|
|
Simply use "Create table Table1(col1 int, col2 varchar default ' ')
Ramya
-- modified at 5:53 Friday 12th May, 2006
|
|
|
|
|
hertz_j wrote: in Enterprise Manager if possible)
In the Columns Property Page put SPACE(0) as the Default Value.
----------
There go my people. I must find out where they are going so I can lead them.
- Alexander Ledru-Rollin
|
|
|
|
|
Hi Eric,
I'll try that, thank you.
|
|
|
|
|