|
Have got any one source,example or link about Full Text Search Services in SQL Server 2005.I have been searched that but i found all in sql server 2000...
|
|
|
|
|
hi to all,
I create a web application in asp.net with sql server 2000, I use always close connection in .net code as my consern but when run my application then visit page to page give a error "General network error " message . then i check lots of connection is sleeping state in process info in sql manegment(current activity) Now i open the particular processId in Process info show open connection with any storeprocedure name and show .net sqlclient data provoider referance as open connection which is fetch the data from sql then i check in code find really the connection which is got data by that store procedure is not close properly and i close it. This is ok but one problem is that some procesId show blank info with .net sql client data provoider. so how can i find where these conneciton is open in my applicaton because this processId doesn't give any clue for it , it show nothing only blank but status is sleeping. If any help have this context then quick feedback.
Thanks
hi_arv
|
|
|
|
|
I am working on getting data out of a datagrid, and save it to a SQL data base. I have the following code:
// Create parameters for the QA_Setup dataset via Sqlcommand
SqlCommand cmd = new SqlCommand();
// Define the params for each column in QA_SetUp
// cmd.Parameters.Add("@CompanyName", SqlDbType.VarChar, 50, ds.Tables("CompanyName").column("CompanyName"));
cmd.Parameters.Add("@CompanyName", SqlDbType.VarChar, 50, "CompanyName");
cmd.Parameters.Add("@CompanyCode", SqlDbType.VarChar, 50, "CompanyCode");
cmd.Parameters.Add("@InspectionPrefix", SqlDbType.VarChar, 50, "InspectionPrefix");
cmd.Parameters.Add("@TestPrefix", SqlDbType.VarChar, 50, "TestPrefix");
cmd.Parameters.Add("@DefectPrefix", SqlDbType.VarChar, 50, "DefectPrefix");
cmd.Parameters.Add("@AuditTrail", SqlDbType.Bit, 1, "AuditTrail");
//define connection and stored proc name
cmd.Connection = conn;
cmd.CommandText = sproc;
// call insert command for the cmd
dap.InsertCommand = cmd;
When I run the app I and try and save I get a syntax error(System.Data.SQLClient.SQLException) as follows:
Line1: Incorrect Syntax near 'prc_QA_Setup_ins'. This is the sproc name that is passed in. Not sure what my issue is, any idea?
the sproc is declared as string sproc="prc_QA_Setup_ins"; which is passed over to my DAL which is where the code above resides.
-- modified at 21:52 Tuesday 13th June, 2006
|
|
|
|
|
|
Perfect it was the cmd.CommandType = CommandType.StoredProcedure line that I was missing... thanks!
|
|
|
|
|
hi,
i need to deploy a database with several replications on about 500 machines. does anybody has an idea how to manage or automate that process?
thanks in advance.
|
|
|
|
|
Hello!
I have a website and a standalone aplication, both written in C#. This applications are both using the same database. The problem is that if i start the standalone application and then I close it (or not), the web page is throwing an SQL Exception : "can't connect to physical file ****.mdf .... it is used by another process" or something like that. The only solution is to restart the SQL server. If I start the website first the same thing is happening with the standalone application. The only thing I can do is to restart the SQL server on and on after each use of one of this 2 application. What could be the problem? What can I do?
|
|
|
|
|
What does your connection string look like? Is this SQL Server or SQL Express?
Jim Conigliaro
jconigliaro@ieee.org
|
|
|
|
|
my connection string:
"Data Source=82.208.150.83,1419;Initial Catalog=D:\\WWW\\ADMINISTRARE\\APP_DATA\\LICENTA.MDF;User ID=sa;Password=pass"
it is SQL Express
|
|
|
|
|
I can't say that I've personally had this problem, but I do know of people that have had issues with SQL Express and they have almost always been fixed by changing the connection string. Try using the following connection string:
"DataSource=<MACHINENAME>;AttachDbFilename=<file>;User ID=<user>; Password=<password>;User Instance=false"
or
"DataSource=.\SQLExpress;AttachDbFilename=<file>;User ID=<user>; Password=<password>;User Instance=false"
Jim Conigliaro
jconigliaro@ieee.org
|
|
|
|
|
what the meaning of QUOTED_IDENTIFIER ,ANSI_NULLS in this view(sqlserver 2000)
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
-
-select *.........
--
-
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
vivek
|
|
|
|
|
|
HI all
I have 50 tables in my database
In 50 tables the fields are same(Name,year,date these 3 fields only)
Now i want write query to retrive all 50 tables information in 1 QUERY
Can any one plz help me
THX
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
|
Hi!
You can generate the query you need using the following SQL-Statement:
select 'select [name], [year], [date] from '+table_schema+'.'
+table_name+' union all '
from INFORMATION_SCHEMA.TABLES
Execute this statement with result type = text, copy the result to a new query windoe and delete the last "union all". It will give you a union all of all your tables -> your 50 tables combined into one.
Hope this helps.
Regards,
Rainer
Rainer Stropek
Visit my blog at http://www.cubido.at/rainers
|
|
|
|
|
HI
Both of u THX for replying
My problum is
i have an query to search and display
so i given query like this
select name from '" & textbox1.text & "' where date = ''....
table name come from textbox which is enter by client.
now i want to do is to i have to remove the client textbox.
And
by date or any thing i have search the names which is in 50 tables
50 table names i have to display
PLZ help me
THX
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
Hi!
Ok, I think I understand your problem. You have to change my SQL generation query like this:
select 'create view MyHelperView as '
union all
select 'select [name], [year], [date], '
+''''+table_name+''' as tablename from '+table_schema+'.'
+table_name+' union all '
from INFORMATION_SCHEMA.TABLES
This query generates a helper view that you can use in your program. It contains a new colum named "tablename" that you can display. Therefore your query could look like this:
select tablename, name from MyHelperView where date = ...
Hope this helps!
Regards,
Rainer.
Rainer Stropek
Visit my blog at http://www.cubido.at/rainers
|
|
|
|
|
The solution provided by r.stropek is good.
Basically I surprise, why do you maintain 50 tables of same structure? Can you not combine all the 50 tables into one table (with one additional column as TableName or Type or Category or anything like that)? (r.stropek suggests to do this through a view.)
I guess combining tables will solve maintenance problem, and help normalization too!
|
|
|
|
|
I am getting the following error while building the dynamic sql query
Server: Msg 245, Level 16, State 1, Procedure proc_sch_ReceivedMails_Sort, Line 45
Syntax error converting the varchar value 'INSERT INTO @tblTemp(
and the dynamic query is with one parameter +@pProjectPK
DECLARE @tblTemp TABLE
(
TempPK INT IDENTITY(1,1),
ContactTypeCodeFK tinyINT,
ContactTypeDesc VARCHAR(50),
ProjectFK INT
)
set @queryString = 'INSERT INTO @tblTemp
(
ContactTypeCodeFK,
ContactTypeDesc,
PartFK
)
(
SELECT ContactTypeCodeFK,
ContactTypeDesc,
PartFK,
PartMaster.PartDesc
FROM tbl_Correspondence CORES
INNER JOIN tbl_PartCode
ON CORES.PartCodeFK = tbl_PartCode.PartCodePK
WHERE CORES.ProjectFK = "'+@pProjectPK+'")'
Print @querystring
exec @querystring
Kalyan
|
|
|
|
|
What I don't understand is why you are even using dynamic SQL for this? You use Dynamic SQL when you need to do something that cannot be done otherwise because of the security risks involved.
INSERT INTO @tblTemp
(
ContactTypeCodeFK,
ContactTypeDesc,
PartFK
)
SELECT ContactTypeCodeFK,
ContactTypeDesc,
PartFK,
PartMaster.PartDesc
FROM tbl_Correspondence CORES
INNER JOIN tbl_PartCode
ON CORES.PartCodeFK = tbl_PartCode.PartCodePK
WHERE CORES.ProjectFK = @pProjectPK
This will work fine like this without being "dynamic"
Scottish Developers upcoming sessions include:
.NET debugging, tracing and instrumentation by Duncan Edwards Jones and Code Coverage in .NET by Craig Murphy
My: Website | Blog
|
|
|
|
|
Actaually this is a part of query only and I am using the dynamic query because I aslo have sort column this will be changed based on the column that the user selects from the screen.
Regards,
Kalyan
-- modified at 18:27 Monday 12th June, 2006
|
|
|
|
|
|
Hi!
Sorry, I don't think that your query will work. You cannot insert into a table variable from inside a dynamic query. Try the following:
declare @test table ( MyId int )
insert into @test values (5)
declare @stmt varchar(128)
set @stmt = 'insert into @test values (6)'
exec( @stmt )
The dynamically executed statment will not work because it does not know about the table var @test.
Additionally I saw that you forgot the ( ) in your exec-statement. exec @querystring cannot execute a dynamic query; you have to write exec ( @querystring ) . Otherwise SQL Server will think you want to execute a stored procedure with the name stored in @querystring. See Transact-SQL-Reference for EXECUTE in Books Online for details.
Regards,
Rainer.
Rainer Stropek
Visit my blog at http://www.cubido.at/rainers
|
|
|
|
|
I have an problem in sequel query. i.e I have 2 table where master child relationship exits
Table1 CorrespondentCodePK, ContactCode,PartNo,
the data in Table1 is 1,1,1
2,1,1
3,1,2
Table2 CorrespondentCodeFK,PartNo,PartName,
the data in Table2 is 1,1,Part1
1,1,Part2
2,1,Part1
and I want the result in the bellow mentioned format i.e
CorrespondentCodePK,ContactCode,PartName (i.e all part names for the CorrespondentCodePK should come in PartName column as a one record)
1,1,Part1Part2
2,1,Part1
|
|
|
|
|
First, make a function:
NOTE: The lengths of the varchar variables will depend upon your data.
CREATE FUNCTION GetPartNames (@nCorrCode int)
RETURNS varchar(1000) AS
BEGIN
DECLARE @cPartNames varchar(1000)
DECLARE @cPartName varchar(50)
SELECT @cPartNames = ''
DECLARE partcursor CURSOR FOR
SELECT DISTINCT PartName
FROM table2
WHERE correspondentcodefk = @nCorrCode
OPEN partcursor
FETCH NEXT FROM partcursor INTO @cPartName
WHILE @@FETCH_STATUS = 0
BEGIN
select @cPartNames = @cPartNames + @cPartName
FETCH NEXT FROM partcursor INTO @cPartName
END
CLOSE partcursor
DEALLOCATE partcursor
RETURN(@cPartNames)
END
Next, use this SQL:
SELECT correspondentcodepk, contactcode, dbo.GetPartNames(correspondentcodepk) AS PartNames FROM table1
----------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|