|
That's not a very descriptive error message. And my experience with mysql is none.
But I can see one error in the USING query, you have "Country" in the SELECT but not in the GROUP BY .
|
|
|
|
|
HI Jorgen,
I think this is not the cause for error. since it only not include the country in Grouping.
|
|
|
|
|
You're right, it seems that the problem is that MySQL isn't supporting the Merge command.
But no problem, they have one of their own instead[^].
|
|
|
|
|
HI Jorgen,
My problem is solved. please check this thread.
Thanks for suggest new way of update and Insert. I was not aware of this way.
|
|
|
|
|
Difference between varchar and Nvarchar?
|
|
|
|
|
Tags : Varchar ,NVarchar ,Varchar(n),NVarchar(n),SQL Server,String,Length,Difference.
Hi Friends,in this post i would like to explain difference between Varchar & NVarchar in SQL Server.
* The data type Varchar and NVarchar are the sql server data types, both will used to store the string values.
Differences :
1 Character Data Type
Varchar - Non-Unicode Data
NVarchar - Unicode Data
2 Character Size
Varchar - 1 byte
NVarchar - 2 bytes
3 Maximum Length
Varchar - 8,000 bytes
NVarchar - 4,000 bytes
4 Storage Size
Varchar - Actual Length (in bytes)
NVarchar - 2 times Actual Length (in bytes)
* The abbreviation for Varchar is Variable Length character String.
* The abbreviation of NVarchar is uNicode Variable Length character String.
Thank You...
|
|
|
|
|
infobeena wrote: 3 Maximum Length
Varchar - 8,000 bytes
NVarchar - 4,000 bytes
Wrong.
It is characters not bytes.
And both types in newer versions allow for a size of 'max' which allow for very large sizes.
|
|
|
|
|
|
N
Bastard Programmer from Hell
|
|
|
|
|
That's not the difference. N is what you get when you divide NVarchar by Varchar.
|
|
|
|
|
The difference is: varchar - Nvarchar
|
|
|
|
|
I m facing some problem in execution of sqlite's fail algorithm. Its definition says that it don't rollback changes made prior to encountering constraint voilation and changes to that row where constraint voilation is occured and beyond never occur. I executed it. But when I update values after the row which is encountering constraint voilation,it do that. But definition is saying different thing. What can be the problem. Please tell by an example that how it is executed. Thanks.
|
|
|
|
|
|
I have been working on this one for week and I need help. It is complicated but I will try to explain what is going on and show a little code. What I have is a Silverlight application that communicates via WCF to the database. Now, the complicated part is that a windows job sends a UDP alert packet to each of the Silverlight clients to trigger an update of a DataGrid on the main page which does it update via the same WCF service Async call. This means that if I have 50 Silverlight clients when the alert packet is fired each of the 50 clients will make the same WCF call to the database. I have checked and insured that each client receives the UDP call. The problem is that when the clients all make the same call It gives me a wcf service error on some, but not all, of the clients. The code below shows the basic concept of the code in WCF service database call and Silverlight code. Of course the code is broken up into several sections, but you should get the main idea.
(WCF CODE)
List<customer> clist = new List<customer>();
...
_sqlcommand = new SQLCommand();
_sqlcommand = new SQLCommand();
_sqlcommand.Connection = _database.connectionString;
_sqlcommand.CommandType = CommandType.StoredProcedure;
_sqlcommand.CommandText=”GetCustomers”;
try
{
Customer customer;
_reader = _sqlcommand.ExecuteReader();
While (_reader.Read())
{
customer = new Customer();
customer.Name = _reader[“Name”].ToString();
…
…
…
clist.Add(customer);
}
}
catch (exception e)
{
…
}
}
return clist;
(SILVERLIGHT CODE)
observableCollection<customer> obsCollection = new observableCollection<customer>();
private getmethod()
{
current.client.GetCustomerServiceCompleted += new EventHandler(ServiceReference.GetCustomerServiceCompleteEventArgs(client_GetCustomerServiceCompleted);
current.client.GetCustomerServiceAsync();
}
void client_GetCustomerServiceCompleted (sender, ServiceReference. GetCustomerServiceCompleteEventArgs e)
{
obsCollection = e.Results;
this.CustomerGrid.ItemsSource = obsCollection;
}
Thank you very much!
Steve Holdorf
|
|
|
|
|
Just a suggestion. If you're using Windows XP and Http Binding, XP has a limitation of 10 concurrent Http connections.
|
|
|
|
|
Thanks for the quick response; however, we are using Windows 7 all the way around. Still not sure. My DBA used the NO LOCK for the stored procedure but still no luck.
Thanks,
Steve Holdorf
|
|
|
|
|
To solve the problem all I did was put a using(connection = new SQLConnection ...) statment around the code using the sql connection so the unmanaged resources were garbage collected.
Thanks,
Steve Holdorf
|
|
|
|
|
Here is my problem: I have a job posting board that displays job postings for a certain about of time. Each posting in the database has a start date and an end date. Both are datetime fields that contain the time of 00:00:00.0000. Now, when i go to display these jobs on the site I use the following query to get them:
SELECT TOP (10) Jobs.jobID, Job_Display.displayID, Jobs.title, Entity.entityName, Jobs.location
FROM Entity INNER JOIN
Jobs ON Entity.entID = Jobs.entID INNER JOIN
Job_Display ON Jobs.jobID = Job_Display.jobID
WHERE datediff(dd, getdate(), job_display.endDate) > -1 AND (Job_Display.display = 1)
order by job_display.displayID desc
Here is there the problem is: Say a job ended today (11/30/2011) it won't show up on the site, but what is intended is that it will be on the site until 12/1/2011. What do I need to change in the where clause to fix this issue?
|
|
|
|
|
Just a suggestion. The call to getDate is also going to include the current time. Have the time component truncated or set to '00:00:00.0000' as well.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
I would suppose....
where (getdate() < job_display.endDate)
|
|
|
|
|
How about WHERE GETDATE() BETWEEN startDate AND endDate ? BETWEEN is inclusive.
Also, (if SQL Server) maybe look nito the DATE datatype.
|
|
|
|
|
Convert GetDate() to a date to get rid of the time component (assumes SQL Server 2008).
SELECT CONVERT(DATE,GETDATE())
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I have one main database (for my user). now when i change the database(SP,View,Tables,....) from my side I wanna make possible the i create some scripts and when i run the scipt all the changes make for the user database without changing the data of user.
//if needed to delete SP,Create View , Delete Table,Create Column ,.... every thing that changed.
thanks!
|
|
|
|
|
Thsi may help: Database Publishing Wizard in VS 2010 Professional[^].
It's usually best to generate 2 scripts: one for the objects and one for the data, especially if you have large amounts of data (in which case you probably should look at other methods of doing this).
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
We use Red-Gate SQL Compare but it is paid fr and not particularly cheap.
Never underestimate the power of human stupidity
RAH
|
|
|
|