|
Yes u r right Alexei, the problem was from my sql server.I stumbled on a piece that taught me how to really configure it and it works perfectly now.
Again, Thanks a lot for ur time.
U are the best!!!!.
see links that helped me, may be another person might be having the same issue like i had:
<a href="http://netcf2.blogspot.com/2005/12/accessing-sql-server-express-from.html">
|
|
|
|
|
Glad to hear that
Thats the same post that helped me a lot when i was trying to connect to sql2000 from pocket pc
Accessing SQL Server Express from the emulator (or PDA) [^]
If you see the comments, the third and fifth are mine
Unfortunatelly i searched for that post to give it to you but i coulnt find it again, i tought it had been deleted or something because if you see the date, it is like 2 or more years old
Alexei Rodriguez
|
|
|
|
|
true, u said!
but do u know when i uninstalled the microsoft virtual machine that i installed in the course of setting up the emulator, and tried to run the emulator again, i got a message saying that i should install a virtual machine.so i think virtual machine is also vital for complete set up.I had to re-install the virtual machine.
|
|
|
|
|
nedusmile wrote: MessageBox.Show(ex.Message)
Don't use Exception.Message
use Exception.ToString(), it provides much more and very useful information.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I now used the Exception call u mentioned but i dont know if the message generated will be of any help to u in assisting me.hope it does as I did report the exception message on my replied post to Alexie.
Thanks again!!
|
|
|
|
|
How New_Id() Function Work in Back Ground i.e how it random ally Generate the Number
when used with order by clause. then what is critiera For Random Generate Number.
Dinesh Sharma
|
|
|
|
|
newid() doesn't actually generate random numbers, it generates GUIDs, which have a random part to them, and serve their purpose well for random ordering.
NEWID()
--------
- NEWID() generates GUID's instead of random numbers which is of type in a uniqueidentifier.
Try this:
SELECT NEWID() AS 'NEWID'
Output:
NEWID
-----
259ED1EE-AE35-41D2-9FCA-9FA9538AE5FF
- NEWID is guaranteed to be unique
RAND()
------
- Returns float value between 0 to 1.
Try this:
SELECT RAND() AS 'RANDOM NUMBER'
Output:
RANDOM NUMBER
------------
0.0431138996610296
- RAND() is not guaranteed to be unique
- SQL Server estimation plan says, sorting with NewId() is more time
consuming than Rand(). Rand() number generation is based on time factor
If we sort records with Rand(),the records will get same rand number and
result will be the same as previous.
e.g.
SELECT RAND() RANDOMCOLUMNS,COL1
FROM MYTABLE
ORDER BY RANDOMCOLUMNS
Output:
RANDOMCOLUMNS COL1
--------------------------------------------------------
0.227066653916067 1
0.227066653916067 2
0.227066653916067 3
0.227066653916067 4
As you can make out that the "RANDOMCOLUMNS" values are same through out.
Because random generation factor does not change during record selection.
Whereas, the same query with NEWID() will give the following
RANDOMCOLUMNS COL1
--------------------------------------------------------
B953F9A9-BE22-4651-8669-5CC6A5269911 4
50293D75-4139-4A75-883F-81DAA91ED4E6 1
0A9B1D56-68FD-4060-AA6B-89791DAF8924 3
4C3A2765-4EA2-493B-8AA9-EBA414D7AAC2 2
As you can make out that, unique GUID's has been created in this case.
So in a simple query, doing a simple "ORDER BY RAND()" will not randomly
order the results at all.In this context,NEWID() is much better, though
not more efficient.
For more information on "Generate random sets in SQL Server with NewID()", you can go through this tutorial
http://articles.techrepublic.com.com/5100-10878_11-6089823.html#[^] by by Arthur Fuller.
More on RAND()
http://msdn.microsoft.com/en-us/library/ms177610.aspx[^]
and NEWID()
1)
http://msdn.microsoft.com/en-us/library/aa276822(SQL.80).aspx[^]
2)http://www.sqlmag.com/Article/ArticleID/97032/sql_server_97032.html[^]
3)http://www.sqlmag.com/Article/ArticleID/99807/sql_server_99807.html[^]
N.B.~RAND() sorts on the constant (per SELECT)
NEWID() sorts on a dynamic (per row)
That is why if you look carefully, the COL1 values has been changed in
the 2nd case while it is same in the first.
For information about how are GUIDs sorted by SQL Server, look here
http://sqlblog.com/blogs/alberto_ferrari/archive/2007/08/31/how-are-guids-sorted-by-sql-server.aspx[^]
Hope this helps.
Niladri Biswas
modified on Sunday, July 5, 2009 8:04 AM
|
|
|
|
|
I need to execute the stored procedure recursively..but i am getting an error there is limit of 32 to execute it repeatedly.... how to handle this problem...Any solution
|
|
|
|
|
It becomes a design issue, 32 is the depth of the proc stack, you need to redesign the way you are processing the data, possibly move it to the client or change the way the proc is called.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Why in the world would you switch from an iterative version to a recursive one?
So not only are you incurring more memory overhead, but let's not forget you are running this *IN* SQL SERVER
Try not to use recursive function
Anyway, could you please send the stored proc so that we can have a look on that and tell you a suggestive approach!
Regards,
Niladri Biswas
Niladri Biswas
|
|
|
|
|
You replied to my reply - you may want to move this to the OP so as to get/give some feedback
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
ello everyone.
I have an application that communicate with a database in sql server 2005, sometimes I have sql query that fails knowing that they are simple requests for updates. I give an example
I have a person table with a column name
I happen to change the names properly, may at one time given a specific name, a clear line in my table is blocked.
when looking around the net I have found that piece is a lock problem.
because once I restart my application everything works well with this line, but I still fall on another line that is blocked.
the query is:
[Code] SELECT
*
FROM
master.dbo.sysprocesses processlist
INNER JOIN master.dbo.sysdatabases DATABASELIST
ON PROCESSLIST.dbid = DATABASELIST.dbid
WHERE
(DATABASELIST.name = N'VISION_DB ')
[/ CODE]
lastwaitintype=LCK_M_X or LCK_M_X
I started with sql server and I do not know how to not have to lock every time
|
|
|
|
|
First of all I am not a database developer and therefore I may well have misunderstood your question.
However:
Morad SAJID wrote: I have a person table with a column name
what is the name of the database containing the person table?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Maybe try defining an explicit transaction before you do your updates and use a Try ... Catch block for error handling. If the update fails then you can execute a rollback, if the update succees, then execute a commit. By using explicit transactions, you should be more confident that locks are not staying around unwanted.
Database updates require locks to be performed, this is unavoidable. Give it a try.
|
|
|
|
|
hello
i am using SQL server 2005 as my back end
now i want report of like from this date to this date...for that i wrote query like
format of my date is dd/MMM/yyyy
If optn1.Checked = True Or optn3.Checked = True Then
sqlstr="select * from des_mast"
sqlstr = sqlstr & "where pickup_date between '" & Me.dtp1.Value & "' and '" & Me.dtp2.Value & "'"
End If
but while executing this query shows an error message like
"incorrect syntax near the keyword 'between'"
please suggest i cant get where the problem is
thank you
|
|
|
|
|
Try to debug and follow debugger line and then you will find the problem.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
nazimghori wrote: format of my date is dd/MMM/yyyy
The format of your sql or the format of your datetimepicker?
nazimghori wrote: If optn1.Checked = True Or optn3.Checked = True Then
You dont need to compare a booleanvalue with true or false
Just do it like this:
If optn1.Checked Or optn3.Checked Then
Or even better:
If optn1.Checked OrElse optn3.Checked Then
nazimghori wrote: sqlstr="select * from des_mast"
sqlstr = sqlstr & "where pickup_date between '" & Me.dtp1.Value & "' and '" & Me.dtp2.Value & "'"
After concatenating this, i dont think youll get a space between des_mast and where, youll get des_mastwhere
Also, have you tryed using # for the date values: between #12/12/2009# and #12/12/2009#
If you still cant get it to work, you can test manually the query in sql server managment studio
Alexei Rodriguez
|
|
|
|
|
Hi to all,
Here is a problem I am facing in a table design in ms access.I am accessing the database through vb.net application.
All I need to get an efficient way to enter the marks for each students for each subject.Now, my number of subjects may increase or decrease.
Can I do this by adding or deleting the columns in the table(student which will contais all the details of the students with subjects as its column). If so please provide me the syntax for altering a table(adding /deleting columns)
Please advice me, if any other efficient method exist for the same.
Thanks in advance.
HimangshuS
-----------------------------
I am a beginner
|
|
|
|
|
Instead of altering the table that contains the student and his scores per class, create 2 tables. Students and StudentScores
The Student table could look something like this:
StudentID (primary key)<br />
Name<br />
GraduatingYear<br />
etc
The Course table would be:
CourseID (primary key)<br />
CourseName
The StudentScores table would look something like this:
StudentID (combination of StudentID,CourseID and CourseDate would be the primary key)<br />
CourseID<br />
CourseDate <br />
Score
By introducing a CourseDate, the student could take the course multiple times and have different grade for each time it was taken.
Also, this design allows for an unlimited number of Courses and each Student could take any number of courses offered.
This design is by no means complete, but it should give you something to think about.
Good luck with your project.
David
|
|
|
|
|
thanks a lot David,
I think thats the solution...Thanks a lot.
But what do you mean by
"This design is by no means complete"
Scared of that..
Please do reply for that. Since I need to create those table..
regards,
HimangshuS
-----------------------------
I am a beginner
|
|
|
|
|
You may want to inlcude more information in the tables than I have given, for example in the Student Table you could have the parent's name and contact numbers. In the StudentScores table you may want to store multiple scores, quizes, tests, mid-terms, final, etc. I don't know exactly what you need, but I'm sure you can think of ways to expand this basic design.
|
|
|
|
|
Hi,
I just wanted to know that is it possible to retrieve data without rollback or declaring any transaction point in sql 2005.
Rock Star
|
|
|
|
|
Yes.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
So how can I solve this issue.
It will be great if you can guide me for it.
Thank you!
Rock Star
|
|
|
|
|
The answer is to not declare any transaction, just do the select.
For example: select ID,FullName from Customer
This will retrieve the data and not create any implicit or explicit transactions. No need to commit or rollback anything.
|
|
|
|