Friday, March 9, 2012

Hem! Query Problem

I may not be using this right, so if I am not, be gentle

Im in Visual Basic Express, I went to the database explorer and right clicked on my table thats in the database and selected new query.

I noticed Query1 at the top, anyhow I laid out my query like I wanted, and went to save

Guess What, I couldnot find a save but, all I found was save all.

I did choose that, but I cannot find the query now.

Started a another query and I noticed ,Query2, so it had to have saved it, but where?

Is this not the right approach?

Very Confused at this point

Davids Learning

hi,

AFAIK, the "Save All" button is there for all other type of activities (vb/c# code) but not for the query itself..

the query you want to save can obviously not be saved on the SQL Server instance you are connected to as only procedures, views, udfs can be saved in the database metadata and not a "free text" query..

actually my thought is you should be prompted to save the query to a txt/sql file, but it seems not to be the case... perhaps you can try asking in VS2005 forum, but my thinking is the "free text" query can not be saved at all, as the "Save selected item" is grayed out..

regards

|||

Andrea is correct. The New Query functionality is used to allow you to run ad hoc queries against your database. I'm guessing that what you're actually looking for is the ability to save a new object in your database that you can later use in you application.

To do this, you would add the type of object that you want to add to your database, for example, for a simple select statement, you would add a new View. On the Data menu, point to Add New and then click View. Once you create your select statement, you will notcie that the Save Selected Item is available and when clicked you will have the oportunity to name your new View. The new View will show up in the View folder of your database.

Hope this helps.

Mike

No comments:

Post a Comment