|
|
Hi,
I have follow the steps:-
To restart an instance of SQL Server
In Registered Servers or Object Explorer, right-click the server instance you want to restart, and then click Restart.
A message box asks whether you are sure you want to restart SQL Server on the server instance you chose.
Click Yes.
A green arrow on the icon next to the server name indicates that the server restarted successfully.
Still it not restarted???
|
|
|
|
|
Have you checked the event logs on the server? maybe the issue is something else
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
I am going to create dynamic temp table
and I am looking for the columns available in that temp table for the same session id.
you can refer code below for the same.
ALTER procedure abc
as
create table #tmp_table
(id int , name varchar(450) )
select c.* ,t.name from tempdb.sys.columns c
INNER JOIN tempdb.sys.tables t
on c.object_id = t.object_id
where t.name = '#tmp_table'
drop table #tmp_table
return 0
|
|
|
|
|
From this article[^]
Quote: Another oddity of the local temporary table (and the local temporary stored procedure) is that it has a different name in the metadata to the one you give it in your routine or batch. If the same routine is executed simultaneously by several processes, the Database Engine needs to be able to distinguish between the identically-named local temporary tables created by the different processes. It does this by adding a numeric string to each local temporary table name left-padded by underscore characters. Although you specify the short name such as #MyTempTable, what is actually stored in TempDB is made up of the table name specified in the CREATE TABLE statement and the suffix. Because of this suffix, local temporary table names must be 116 characters or less. If you remove the where from your code you will see that the table name is actually
#tmp_table__________________________________________________________________________________________________________000000000002 So you do need to use a like clause but not the one you have commented out. Like this
where t.name LIKE '#tmp_table%'
|
|
|
|
|
That will return all copies of that temporary table for all sessions. Filtering by object_id would probably work better.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Yep - good point
|
|
|
|
|
instead of separate where condition use the condition in join statement only
select c.* ,t.name from tempdb.sys.columns c
INNER JOIN tempdb.sys.tables t
on (c.object_id = t.object_id
and t.name = '#tmp_table');
|
|
|
|
|
Same problem will apply for the same reason I gave earlier - the table name does not equal '#tmp_table' so for this suggestion to work the ON clause will need to have
and t.name LIKE '#tmp_table%'
or
and t.object_id = OBJECT_ID('tempdb..#tmp_table') (Credit to @Richard Deeming)
|
|
|
|
|
Try filtering by object_id :
select c.* ,t.name from tempdb.sys.columns c
INNER JOIN tempdb.sys.tables t
on c.object_id = t.object_id
where t.object_id = OBJECT_ID('tempdb..#tmp_table')
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I learn something most days, got my 5!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
thanks .. It's working fine..
|
|
|
|
|
HI,
EveryBody
I am getting the following error when trying to do a contains search on an indexed table:
Msg 30046, Level 16, State 1, Procedure sp_fulltext_service, Line 163
SQL Server encountered error 0x80070218 while communicating with full-text filter daemon host (FDHost) process. Make sure that the FDHost process is running. To re-start the FDHost process, run the sp_fulltext_service 'restart_all_fdhosts' command or restart the SQL Server instance.
when i run the sp_fulltext_service 'restart_all_fdhosts' command, i get the same error as shown above.
|
|
|
|
|
Did you restart the SQL Server instance?
|
|
|
|
|
You're still getting this error four years after you first posted it?
I am getting the following error when trying to do a contains search on an indexed table:
Msg 30046, Level 16, State 1, Procedure sp_fulltext_service, Line 163
SQL Server encountered error 0x80070218 while communicating with full-text filter daemon host (FDHost) process. Make sure that the FDHost process is running. To re-start the FDHost process, run the sp_fulltext_service 'restart_all_fdhosts' command or restart the SQL Server instance.
select * from table1 where contains (MyText, 'fire')
i checked to see and my index service is running, it is also using "Local Account" to run (same as the SQL Server Agent)
when i run the sp_fulltext_service 'restart_all_fdhosts' command, i get the same error as shown above.
Edited by - xrum on 09/15/2011 09:52:27
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
sniff sniff ... methinks there is the odour of urine extraction around here somewhere. He's had me for a sucker
|
|
|
|
|
Wow did you remember this from the first time he asked? Elephant something (in the original use of the word)
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
No, my memory's not that good!
It just came up on a Google search for the error message.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi i want to convert msaccess pivot query to mssql server 2005 pivot query can anybody help me?
TRANSFORM Sum([Kartella1-meion].[m]) AS ΆθροισμαΤουm
SELECT [Kartella1-meion].[PEL_PRO_CODE], Sum([Kartella1-meion].[m]) AS meion
FROM [Kartella1-meion]
GROUP BY [Kartella1-meion].[PEL_PRO_CODE]
PIVOT Format([HME_PAR],"mmm") In ("Ιαν","Φεβ","Μαρ","Απρ","Μαϊ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ");
|
|
|
|
|
|
Thanks for the answer .
Issue resolved.
|
|
|
|
|
|
I am writing a utility to copy tables from one DB to another. This can be from MySQL, MS SQL Server, MS Access DB, or SQLite DB to another DB of one of the above types. The program handles any of the above combinations. For example, the user can choose to copy a table from MySQL server to an MS Access database. I am using ADO.NET to write this app.
Currently I create a DataReader using the query "Select * from ", and then call its GetSchemaTable() method to obtain the field info of the source table. This method returns a DataTable that contains each field's basic info such as field name, type, size, whether or not it is a key, etc. These allow me to do the data type match and create the fields in the target DB.
My question is how to obtain the source table's index info. The above DataTable object seems not sufficient for this purpose. Can you give me a pointer as to how this can be done? Thanks!
|
|
|
|
|
There's no unified API for that. You will have to implement it for each of those database systems individually. For SQL-Server you could either query the INFORMATION_SCHEMA or use SQL Server Management Objects (SMO). For MS Access there are also queryable schema-tables (MSys_xxx). No idea regarding the other database systems though, would have to ask Google.
|
|
|
|
|
Hi,
I have employee_benefits MySQL table with the following fields:
employee_benefit_id --- autonumber
employee_id
benefit_category
benefit_description
benefit_amount
I want to loop through all records in the above table and insert the values into salary_slips table which has the following fields:
salary_slip_id --- autonumber
document_id ---- forget this it's just UUID
employee_id -- from employee_id in employee_benefits
slip_month -- from SP variable param_slip_month
slip_year -- from SP variable param_slip_year
and then I want to insert data into salary_slips_details:
salary_slip_details_id --- autonumber
salary_slip_id -- the id from salary_slips table
slip_details_description -- benefit_description from employee_benefits table
slip_details_amount -- benefit_amount from employee_benefits table
How can I do this complicated query please?
Thanks,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|