As Navaneeth says, SQL Server stored procedures are optimised no differently from other, ad-hoc queries. However, the resulting query plan is given more weight so it is more likely still to be in the cache when the procedure is next executed.
You must be a bit careful that you do not have massively divergent behaviour depending on different values for parameters. The reason for this is that SQL Server will use the previously compiled query plan regardless of the parameters supplied. If a query plan works well for some values of some parameters but not for others - perhaps an index which is very selective for some values but not for others, such as where a column mostly contains the same value but has a few exceptions - you can get better performance by asking SQL Server to recompile the query. Use WITH RECOMPILE with the EXEC statement to do this on a one-off basis, or specify WITH RECOMPILE in the CREATE PROCEDURE/ALTER PROCEDURE statement to force the plan to be recompiled every time.
DoEvents: Generating unexpected recursion since 1991
BigInt and you think you're going to run out of IDs??
You can't possibly tell me that your table is going to hold more than 9,223,372,036,854,775,807 (time 2 for negative numbers) records. I'd like to see the storage drive array that's going to hold this database, not to mention the backup scheme you've got.
i write a sp to create a temprory table with a select query and then with special column of myTemp table update another table.
i can access myTemp table after create it in a select query:
CREATE TEMPORARY TABLE
select wgrade.idApplicant from wgrade where ;
it works ok.
but when i use update query:
CREATE TEMPORARY TABLE
i have this error:
Unknown column 'wgrade.idApplicant' in 'where clause'
Can any one help me?
i create the form1
Private Sub form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
and create module1
Public myConnection As New SqlConnection()
Public Sub AttachDB()
myConnection.ConnectionString = " Data Source=.\SQLEXPRESS;AttachDbFilename=C:\WindowsApplication1\SQLDB\ATM.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
and in run time stop the project and say there error in "AttachDB()
and error is "The type initializer for 'WindowsApplication1.Module1' threw an exception"
In couple of procedures we are passing xml formatted data and inserting into temporary tables using sp_xml_preparedocument. Is there any other approach without using sp_xml_preparedocument procedure we can insert data from xml formatted data. We are looking for better performance. I hope somebody can help on this.
You need to write some code to take the raw data and convert it into an image format. There are numerous samples around that show how to do this, but without knowing which languages you are familiar with, I can't refine this down for you.
Deja View - the feeling that you've seen this post before.
I'm generally familiar with SQL Server 2005 and I know there's an IMAGE data type that I can use to store pictures in the db. Can MySQL do the same? I'll be heading to the book store tomorrow to pick up a book and read up on this, but any experience in this area, particularly including taking pictures that are saved on my local disk and storing them in a web-based MySQL db would be greatly appreciated. I've seen sample apps for SQL Server 2005 that do this, but not MySQL and get the impression it's not nearly as easy, but probably possible.
Thanks Paul. I also have the ability to use Access, and have samples for storing & retrieving files from that. Any advantage to MySQL, since I don't have MySQL, but do have Access? i.e., it'll cost me some money to use MySQL, where I can use Access for free, and this is a personal web site for storing photo's, etc.
Go ahead and use Access. Shouldn't be any problems. Since you are going to be storing photos, the best approach with a database is to save just the path on the server to the photos rather than putting the photos in the database.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
That would certainly make it easier, but won't having a database and an "add picture and keywords" type of functionality make it easier to store, retrieve, and catalog? I have literally thousands and thousands of travel photos from all over the world, and want to be able to give friends and family the ability to search by subject, then return those that match the criteria, which would then show thumbnails, and a click would bring up the full size image....