|
Hi all .
I wount to restore the DataBase But the restore operation is Feild and get me the Error int message : " System.Data.SqlClient.SqlError : The Operating System returned the error '5(error not found)' while attempting 'Restore Container :: ValidationTargetForCreation' on (Microsoft.SqlServer.Express.Smo)" .
What is the Error Meaning and How i Can Solve it ??
Thanks For Any boudy hellp me
Thaer
|
|
|
|
|
Most likely the file you're trying to restore does not exist or the directory is wrong. Remember that when you issue a restore command, the file must be defined in a way how SQL Server service sees it.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
How to Following the steps that I define aconnection Between My Server And The Client Pc ..
thanks...
jetwll
|
|
|
|
|
Try here [^]
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I want to retrieve top 2 of maximum salary records.What wud be the qeury???
|
|
|
|
|
If you've got only one table containing all salaries, your answer is as simple as this:
SELECT TOP(2) Salary
FROM TABLE
ORDER BY Salary DESC
_
|
|
|
|
|
Can u plz tell if I want to get minimum of top 2.
|
|
|
|
|
Order the records in ascending order and select top two
|
|
|
|
|
select top 2 salary from tbl_salary order by salary desc
select top 2 salary from tbl_salary order by salary asc
Errors are like Mini Skirts, shorter they get, more revealing they become.
|
|
|
|
|
Now I got a question for you; Imagine you want to retrieve the top 3 salary records. How would you go about and do that?
|
|
|
|
|
you din understand my question and now making fun of me.'minimum of top 2' means the lesser of the top 2 that is the second largest salary.Now if you are too smart tell this eddyvluggen.
|
|
|
|
|
joindotnet wrote: making fun of me
I was, wasn't I?
joindotnet wrote:
What wud be the qeury???
You just wanted someone to write a query for you, and someone did. Have you actually tried writing the query? If so, why didn't you post the piece that you already wrote?
|
|
|
|
|
I can write the queries by myself. I just wanted to know whether there is a simplification for it
select min(salary) from (select top 2 salary from order by salary desc)
By the way this place is for professionals not for people like u who r here to have fun.
|
|
|
|
|
I didn't know professionals could not have fun. If you ask an oversimple question or break the forum guidelines, you will get flamed.
Blog link to be reinstated at a later date.
|
|
|
|
|
I need to copy rows from datatable to database by using SQLBulkCopy. I am using ODBC connection. How can I use ODBC connection with SQLBulkCopy.
|
|
|
|
|
SQLBulkCopy is a class that is used with native SQL Server connection (SQLConnection). It cannot be used with ODBC connection. If you're using Microsoft ODBC driver for SQL Server, it has enhancements that make it possible to use bulk copy operations, but then the functionality is the same as in bcp, not the same what is defined for SQLBulkCopy.
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Hi..
My function is to extract only number from given string.
i m using mysql database and i m new to the syntax.
is there anyone help me pls?
thanks in advance!
=====================
BEGIN
DECLARE @Count INT
DECLARE @IntNumbers VARCHAR(1000)
SET @Count = 0
SET @IntNumbers = ''
WHILE @Count <= LEN(@String)
BEGIN
IF SUBSTRING(@String,@Count,1) >= '0'
AND SUBSTRING(@String,@Count,1) <= '9'
BEGIN
SET @IntNumbers = @IntNumbers + SUBSTRING(@String,@Count,1)
END
SET @Count = @Count + 1
END
RETURN @IntNumbers
=============================================
The following error Message is shown.
Script line: 4 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@locator VARCHAR(20))
RETURNS INT
AS
BEGIN
DECLARE @cnt INT
DECLARE' at line 1
|
|
|
|
|
|
thanks.
i referenced this function.
and it shown the error as i mentioned.
|
|
|
|
|
It's working in SQL Server dude. Since you are trying to execute it on MySql, you probably have to find which line should be replaced with the proper corresponding sql syntax in MySql.
_
|
|
|
|
|
Background:
I've been requested to make an app that keeps track of complaint files that come in. These are non-standard and come in the form of PDF, doc, txt and xls. What needs to be tracked would be things like PO, Employee, Customer, etc. There can be multiple values to each of these or no value at all.
Problem:
Since I don't want to try to read from all of these files, I figure a categorized tagging system through SQL server might work. I'm somewhat reluctant to develop such a system, however, due to performance reasons.
Possible solutions:
The first solution I had in mind is using 3 tables. One table contains the file information. Another table contains the tag names. The third table relates to the file and tagname tables and holds the values of a tag associated with a file. I was thinking I could just index the column containing the tag values and query through it.
The second solution involves one table containing the file name, delimited string of tag names and a delimited string of tag values.
Issues:
I'm not sure how costly the first solution will be on the server. I'm not wanting full text indexing, just an index on one varchar(30-ish) column.
The second solution would be pretty simple to use regular expressions in my front-end to search through the values. But I wouldn't want to query against this since string comparisons are costly enough when they're straight 1-1.
Which of these would be the better way to go? Would I absolutely be raping my server if I implementing my first solution?
Any input is appreciated.
|
|
|
|
|
The first one is definitely better.
You have far more options to tune the statements if you encounter bottlenecks when you have done database modelling as it should be done. The second one leads to several problems. Slow queries, poor maintainability, non-efficient indexing etc.
Just to throw another possibility, you could also consider xml-field on the same table as document names. It can be easily updated, using at client side is typically very straightforward and also it can be indexed.
Hope this helps,
Mika
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Awesome.
Thanks for the input.
|
|
|
|
|
You're welcome
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
Most definately agree with Mika, option 1 is the way to go. As for performance, it shouldn't be a big problem unless you expect hundreds of millions of records - in which case you may want to look at partitioned tables.
Bob
Ashfield Consultants Ltd
|
|
|
|