SQL Express, Saving Queries?

Jan 30, 2007

I opened up a new project using Visual Basic Express, and selected the SQL object to start creating a database. Well I finished putting all of my tables together and started making the queries but for some reason I can't save them like when I finished making the tables. When I finished making the tables I could just click the disk icon and name the table and it would appear in a drill down menu on the left. However when I do that with the queries it just says it's saving in the lower left corner but it doesn't do anything?

I am new to VB & SQL so any help is appreciated. Thank you.

View 7 Replies


ADVERTISEMENT

Saving Queries

Jun 20, 2007

I just started using Visual Studio 2005. How do you actually save your queries to use again? Also, is there a way to export results in a user friendly format?



thanks!

View 6 Replies View Related

Saving Output From Multiple Queries

Sep 15, 2005

Greetings,I have what seems a simple problem....I want to save the output from the following queries in 1 file in'SQL Query Analyser', but I can only save each 'grid' separately.I have about 30 queries in total. 'Messages' tells me the number ofrows affected but I need the data.So can I save all the grids together at the same time in 1 file ?ThanksMikePRINT 'HEAT 3510'SELECT f.persfirstname AS First_Name,f.perslastname AS Last_Name,a.rsrchqnumber AS Personal_nr,b.asgtassignmentid AS Contract_nr,ISNULL(c.tishcode,'') AS TS_Id,ISNULL(d.tpitpayrollcode,'6900') AS Pay_Code,d.tpitdaydate AS Payroll_Date,c.tishactualenddate AS TS_end_dateFROM resources aINNER join assignments b ON b.asgtrsrcguid = a.rsrcguidINNER join timesheets c ON c.tishasgtguid = b.asgtguidINNER join users e ON e.userguid = a.rsrcuserguidINNER join persons f ON e.userpersguid = f.persguidLEFT OUTER join timesheetpayrollitems d ON d.tpittishguid =c.tishguidWHERE a.rsrchqnumber = 80000147and b.asgtassignmentid = 0000001234and c.tishactualenddate > '20050614'and (d.tpitdaydate > '20050614'or d.tpitdaydate IS null)order by d.tpitdaydateSELECT f.persfirstname AS First_Name,f.perslastname AS Last_Name,a.rsrchqnumber AS Personal_nr,b.asgtassignmentid AS Contract_nr,ISNULL(c.tishcode,'') AS TS_Id,c.tishactualenddate AS TS_end_date,g.thisdaydate AS TSH_dateFROM resources aINNER join assignments b ON b.asgtrsrcguid = a.rsrcguidINNER join timesheets c ON c.tishasgtguid = b.asgtguidINNER join users e ON e.userguid = a.rsrcuserguidINNER join persons f ON e.userpersguid = f.persguidINNER join timesheethistory g ON g.thistishguid = c.tishguidWHERE a.rsrchqnumber = 80000147and b.asgtassignmentid = 0000001234and c.tishactualenddate > '20050619'order by g.thisdaydatePRINT 'HEAT 3213'

View 3 Replies View Related

Saving Tables That Are Generated By Queries As HTML File Or Sub-tables

Oct 17, 2006

I have a trade data tables (about 10) and I need to retrieve information based on input parameters. Each table has about 3-4 million rows.

The table has columns like Commodity, Unit, Quantity, Value, Month, Country

A typical query I use to select data is "Select top 10 commodity , sum(value), sum(quantity) , column4, column5, column6 from table where month=xx and country=xxxx"

The column4 = (column2)/(total sum of value) and column 5=(column3)/(total sum of quantity). Column6=column5/column4.

It takes about 3-4 minutes for the query to complete and its a lot of time specially since I need to pull this information from a webpage.

I wanted to know if there is an alternate way to pull the data from server ?

I mean can I write a script that creates tables for all the input combinations i.e month x country (12x228) and save them in table (subtable-table) with a naming convention so from the web I can just pull the table with input parameters mapped to name convention and not running any runtime queries on database ??

OR

Can I write a script that creates a html files for each table for all input combinations save them ?

OR

Is there exists any other solution ?

View 1 Replies View Related

Saving SQL Express Databases?

Apr 4, 2006

Hello,
I have Visual Studio 2005 Professional.
I was wondering if there were any way to save the .dbo databases created in it to upload to my website? Do the databases must be save as a specific filetype according to the website configuration?
Do most people actually connect to their site's database to modify it or something? Or do they usually connect to an external database and then upload it to their site?
Sorry, but I am kind of new to all of this.
Thanks,
Eng

View 1 Replies View Related

Saving Text With Special Character Into SQL Express Table

Jun 22, 2007

Hi, fellows!



When I need to save a text into a SQL Express table I use the character ' to encote the text. (ex: 'myText' )



How to procedure when the text has already the character ' ? (ex: how to enconte the text Color's car ) ?



Many thanks to any kind of help!

View 3 Replies View Related

Automating A Query And The Saving Saving Of Subsequent Results

Dec 13, 2007

Hi Guys,

I am trying to automate a basic task using SQL Server 2005 Express.

Currently I have a query script that I run and then save the results as a CSV file. I need to do this on a daily basis and so I am looking to find out how best to go about this. There are a multitude of third party tools that claim to be able to do this - can anyone recommend this or enlighten me of the best way to set up this automation.

All ideas gratefully received!

View 1 Replies View Related

Slow Queries In SQL Express

Jul 17, 2007

Some queries take a long time to complete.

Setup is:

- SQL Express SP2

- Windows Vista Business

- 2 GB RAM

- Core 2 Duo processor

- Connecting to (local) server with SQL Authentication

- only 1 Instance of MSSQLSERVER

Simple queries (SELECT * FROM TableName) wher the table has only a few records. This query may take up to 30 or more to execute. This slowness is consistent to certain tables. Other much larger tables run queries fine.

If a different computer logs in to the same server, queries provide instantaneous results.



View 4 Replies View Related

SQL 2005 Express Timeout On Simple Queries

May 5, 2007

Hi everybody!



I have made a simple application with VB6 and SQL 2005 Express.



And after testing it in a network simulated with Virtual-Machine Workstation, the "real world" application was first getting slower and slower, and finally giving timeout errors.



It is even difficult to connect. The application times out always at 30 secs although the ado connection timeout was established longer (45)



I have checked on the machine where the server is installed, just in case the slow down was due to network problems, but it fail locally too.



Any help is wellcome







View 6 Replies View Related

MS Access Adp Queries And SQL Serv 2005 Express

Sep 16, 2006

I have upsized some Access 2002 tables to Sql Server 2005 express. I put together a query and when I try to execute it, it tells me the MS Access is an earlier version prior to SQL server 2005 and it will not save the queries. When I try to run them anyway, I get the repeated message and the query never executes. I'm taking a T-SQL class and this is how the instructor. Is they a fix for SQL Server or Access to get around this or do I have to revert back to MDSE 2000?? Can MDSE 2000 and SQL Server be loaded onto the same machine (laptop)? Help!!!!! I am very new at this...

View 5 Replies View Related

How Can I Perform Some Basic Queries Using VB2008 Express And MS SQL SD (or CE)?

Mar 1, 2008

I am using Visual Basic 2008 Express Edition and Microsoft SQL Server Database (or CE 3.5), and I need to be able to:


Create an open connection

Insert rows of data

Read rows of data

Delete rows of data

Close and dispose of the connection
I found some code examples out there, but nothing current and specific to VB2008 and MS SQL SD (or CE). If you could point me to sample code that covers this for the 2008 versions of VB and SQL that would be great!
Thanks.Techno

View 1 Replies View Related

Concurrent Queries In SQL Server 2005 Express

Nov 9, 2006

If applicable, what's the limit on concurrent queries supported by SQL Server 2005 Express? Also, if there's a limit, does next connection after the max errors out or merely queues up?



Thanks,

Phillip

View 3 Replies View Related

Unattended SQL 2005 Express Install Enabling Ad Hoc Remote Queries

Jul 6, 2006

Hi there,



I am trying to create an un-attended SQL 2005 Express install. I have successfully made my own template.ini file to install SQL the way I like but I cannot find a way to make it install with the "Ad hox remote queries" option enabled.

Is there anyway to do this? I can't seem to find any switches in the INI file to allow this.

Thanks



Joseph Beckett

View 7 Replies View Related

Long Memory Grant Queue Waits In SQL Server Express SP2 Causes Slow Queries

Sep 10, 2007



I have a 2GHZ cpu with 1GB of RAM. I occassionally see very slow (long) queries against a local SQL Server 2005 Express (SP2) database. The issue occurs against different SQL Queries, but all queries are rather basic select statements Perfmon shows that the SQL Server counter for the "MEMORY GRANT QUEUE WAIT Avg MS" gets extremely high (25000+ ms). Perfmon also also shows that PAGING is not occuring, and the system is not under unsual stress. The problem is not reproducible with MSDE.

Has anyone seen this issue, or have any recommendations for a next course of action?

View 1 Replies View Related

SOLUTION! - VB.NET 2005 Express And SQL Server 2005 - NOT Saving Updates To DB - SOLUTION!

Nov 30, 2006

VB.NET 2005 Express and SQL Server 2005 Express - NOT saving updates to DB - SOLUTION!

-----------------------------------

The following article is bogus and confusing:

How to: Manage Local Data Files - Setting 'Copy to Output Directory' to 'Do not copy'
http://msdn2.microsoft.com/en-us/library/ms246989.aspx

You must manually copy the database file to the output directory
AFTER setting 'Copy to Output Directory' to 'Do not copy'.

Do not copy








The file is never copied or overwritten by the project system. Because your application creates a dynamic connection string that points to the database file in the output directory, this setting only works for local database files when you manually copy the file yourself.

You must manually copy the database file to the output directory
AFTER setting 'Copy to Output Directory' to 'Do not copy'.

-----------------------------------

The above article is bogus and confusing.

This is rediculous!

This is the most vague and convoluted bunch of nonsince I've ever come accross!

Getting caught out on this issue for the 10th time!
And not being able to find an exact step-by-step solution.

--------------------------

I've tried it and it doesn't work for me.

Please don't try what the article eludes to as I'm still sorting out exactly what is supposed to be happening.



If you have a step-by-step procedure that can be reproduced this properly please PM me.

I would like to test its validity then update this exact post as a solution rather than just another dicussion thread.

Many thanks.



This is the exact procedure I have come up with:

NOTE 1: DO NOT allow VB.net to copy the database into its folders/directorys.

NOTE 2: DO NOT hand copy the database to a folder/directory in your project.

Yes, I know its hard not to do it because you want your project nice and tidy.
I just simply could NOT get it to work.
You should NOT have myData.mdf listed in the Solution Explorer. Ever.

Create a folder for your data following NOTE 2.

Copy your data to that folder. * mine was C:mydatamyData.mdf



Create a NEW project.

Remove any Data Connections. ( no matter what)

Save it.

Data | View Data Sources

Add New Data Source

select NEW CONNECTION ( No Matter what, do it!

Select the database. * again mine was C:mydatamyData.mdf

Answer NO to the question:
Would you like to copy the file to your project and modify the connection?
- NO ( no matter what - ANSWER NO ! - Absolutely NO )
Then select the tables you want in the DataSet.
and Finish.



To Test ----------

From the Solution Explorer | click the table name drop down arrow | select details
Now Drag the table name onto the form.

The form is then populated with a Navigation control
and matching Labels with corresponding Textboxes for each field in the table.

Save it.

1) Run the app.

Add one database record to the database by pressing the Add(+) icon

Just add some quick junk data that you don't mind getting lost if it doesn't save.

YOU MUST CLICK THE SAVE ICON to save the data you just entered.

Now exit the application.

2) Run the app again.

And verify there is one record already there.

Now add a second database record to the database by pressing the Add (+) icon.

NOW add some quick junk data that you WILL intentionally loose.

*** DO NOT *** press the save icon.

Just Exit the app.

3) Again, Run the app.

Verify that the first record is still there.

Verify that the Second record is NOT there.
Its NOT there because you didn't save the data before exiting the app.

Proving that YOU MUST CLICK THE SAVE ICON to save the data you just entered.

Also proving you must add your own code to catch the changes
and ask the user to save the data before exitiing or moving to another record.

As a side note, since vb.net uses detached datasets,
(a copy/snapshot of the dataset in memory and NOT directly linked to the database)
the dataset will reflect all changes made when moving around the detached datasets.
YOU MUT REMEMBER TO SUBMIT YOUR CHANGES TO THE DATABASE TO SAVE THEM.
Otherwise, they will simply be discarded without notice.

Whewh!

I hope this saves me some time the next time I want to start a new database project.

Oh, and uh, for anyone else reading this post.

Thanks,
Barry G. Sumpter

Currently working with:
Visual Basic 2005 Express
SQL Server 2005 Express

Developing Windows Forms with
101 Samples for Visual Basic 2005
using the DataGridView thru code
and every development wizard I can find within vb.net
unless otherwise individually stated within a thread.

View 17 Replies View Related

Parameterized Queries Running Slower Than Non-parameterized Queries

Jul 20, 2005

HelloWhen I use a PreparedStatement (in jdbc) with the following query:SELECT store_groups_idFROM store_groupsWHERE store_groups_id IS NOT NULLAND type = ?ORDER BY group_nameIt takes a significantly longer time to run (the time it takes forexecuteQuery() to return ) than if I useSELECT store_groups_idFROM store_groupsWHERE store_groups_id IS NOT NULLAND type = 'M'ORDER BY group_nameAfter tracing the problem down, it appears that this is not preciselya java issue, but rather has to do with the underlying cost of runningparameterized queries.When I open up MS Enterprise Manager and type the same query in - italso takes far longer for the parameterized query to run when I usethe version of the query with bind (?) parameters.This only happens when the table in question is large - I am seeingthis behaviour for a table with > 1,000,000 records. It doesn't makesense to me why a parameterized query would run SLOWER than acompletely ad-hoc query when it is supposed to be more efficient.Furthermore, if one were to say that the reason for this behaviour isthat the query is first getting compliled and then the parameters aregetting sent over - thus resulting in a longer percieved executiontime - I would respond that if this were the case then A) it shouldn'tbe any different if it were run against a large or small table B) thisperformance hit should only be experienced the first time that thequery is run C) the performance hit should only be 2x the time for thenon-parameterized query takes to run - the difference in response timeis more like 4-10 times the time it takes for the non parameterizedversion to run!!!Is this a sql-server specific problem or something that would pertainto other databases as well? I there something about the coorect use ofbind parameters that I overall don't understand?If I can provide some hints in Java then this would be great..otherwise, do I need to turn/off certain settings on the databaseitself?If nothing else works, I will have to either find or write a wrapperaround the Statement object that acts like a prepared statement but inreality sends regular Statement objects to the JDBC driver. I wouldthen put some inteligence in the database layer for deciding whetherto use this special -hack- object or a regular prepared statementdepending on the expected overhead. (Obviously this logic would onlybe written in once place.. etc.. IoC.. ) HOWEVER, I would desperatelywant to avoid doing this.Please help :)

View 1 Replies View Related

Not Saving

Nov 22, 2006

Please i need to save records using DataSet. I created the connectionstring as a global variable. In th button_Click event i have this :
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim InsAdapter As New SqlDataAdapter
Dim StrInsert As String = "insert into Products(CategoryId,ProductName,ProductCode,ProductPrice,) values(@CategoryId,@ProductName,@ProductCode,@ProductPrice)"
Dim ObjComm As New SqlCommand(StrInsert, ObjConn)
ObjComm.Parameters.Add("@CategoryId", SqlDbType.Int).Value = drpCategory.SelectedValue
ObjComm.Parameters.Add("@ProductName", SqlDbType.NVarChar, 30).Value = txtName.Text
ObjComm.Parameters.Add("@ProductCode", SqlDbType.NVarChar, 10).Value = txtCode.Text
ObjComm.Parameters.Add("@ProductPrice", SqlDbType.Int).Value = txtPrice.Text
InsAdapter.InsertCommand = ObjComm
End Sub
But on clicking the button, the record is never saved. Please help

View 4 Replies View Related

Saving To SQL

Nov 29, 2007

I am currently migrating my application from Access to SQL. It looks like it's working good but one thing I cannot understand is why when I have created a varchar(40) field and after I insert a field that is less then 40 characters long, the rest of the string is filled with the leading spaces. I have also create an nchar(40) that did not solve it ether. For example: the text is "Hello World". The text is 11 characters long but the data saved to the table is: "Hello Wolrd" + 29 spaces. Am I doing something wrong?Thanks for your help in advance. 

View 6 Replies View Related

DTS Not Saving

Dec 5, 2007

When I open a DTS package, save it as a bas file, make changes, close the package and save it when prompted, where are my changes saved?

The answer appears to be nowhere. When I reopen the package it's back to it's original setup. When I check the bas file it's as it was when I originally saved it.

Any ideas? Like where my mornings work is gone?

View 3 Replies View Related

Saving Changes

Feb 27, 2008

We have a table with 3.5 million records in it. We have been forced to add two fields and set indexes on those fields. But when we try to save the changes it times out. When we try to generate a change script it also times out. Is this a memeory issue? Any ideas on whats causing this or how to fix it woudl be greatly appriciated.

View 4 Replies View Related

Saving Changes

Nov 20, 2007

Hi, all.This might be a silly question... but I am very new to programming inSQL so please bear with me :)So. I'm using MS SQL Server 2005 Management Studio Express. I have atable that was created via an existing .sql file. Included were abunch of stored procedures. I went in to re-format these procedures.(They were written in haste by another programmer. It is my task to goback and improve their readabilities.) However, I am having difficultyfiguring out how to save the changes to these stored procedures. Thusfar, I have been individually saving each stored procedure in itsown .sql file. This is obviously not the way to go... but it's atemporary solution (so as not to lose the changes I have made todozens of procedures).Can someone please explain to me how I commit these changes to thedatabase?Thanks,Allie

View 1 Replies View Related

Saving Changes In MDX

Feb 22, 2007

Hi,

I have written a report in Reporting Services 2005 which gets its data from a cube.

I want to edit the mdx generated by the Mdx builder in RS 2005, so I click on the "design mode" button to do this.

However, when i make the changes, i cannot save it. How can I do this?

Thanks,

Ashleys.

View 1 Replies View Related

Saving

Feb 1, 2007

Good day

Using vb 2005 express I have my grid veiw on the form and a icon to click to save my work.

But is there a passage of code I can write to pop up a message box to remind me to save my work when I close my form. Similar to ms office forms when you close they ask you if you want to save any changes.

Thanks

Rob

View 3 Replies View Related

Saving Pictures

Sep 13, 2006

Is it better to have users that upload pictures have them saved to SQL server or to a folder?  I have a site where users enter things that they own (and each item has a unique id) and now I would like to add the functionality to add a picture.  I am sure I should use the fileUpload control, but should this save to a folder created for each user or to the SQL record itself?  Or possibly a separate SQL table just for pictures?Thanks for the help.

View 1 Replies View Related

Saving Date Into SQL

Nov 6, 2007

Hi,
      I want to save date into SQL server pls help me how to save this date into server. its give me syntax error that converting datetime to character string. and also I want to save date only in mm/dd/yy format in a sql not including time.
The following code I am using
  sub SaveEvent(sender as object, e as EventArgs)         Dim dt As DateTime = DateTime.Parse(eventdate.Text)
         lbl.text=dt   dim con as new SQLConnection("server=london-home; Database=tony; uid=rashid2; pwd=test; ")
      dim cmd as new SQLCommand("insert into events values('" & dt & "','" & desc.text & "')",con)           con.open()     cmd.executenonquery()   con.close()       end sub 
 
 
 

View 13 Replies View Related

SQL For Saving A Value In A Variable

Jun 15, 2008

 Hello Im having a little problem getting some values from a database.....
What I need is to get the value of the keyfield of the last entry introduced, I know how to to do the SQL statement for this, the problem is that i dont know how to save this value in a variable. I need to save this value in a variable in the session object or in a hidden field, and then use this variable in another different page. That's way i need to save this ID value, later in the other page I introduce data in a different table and one of the fields has to be this ID value which I have as a foreign key in the table so I need to use the same value in all the rows i introduce(Id value).
If you know how to accomplish this let me know, many thanks, Sergio

View 6 Replies View Related

Saving Files In DB

Apr 14, 2006

In my system, I generate invoices as PDF for my clients and I need to email them and save them on the database. What is the best approach for achieving that?!
 
Shall I save the files path in the SQL server 2000 as ( varchar ) and save files in a folder in the server or there is another approach?! is there any recommendation or advice about the procedure to send emails shall i save them first then send them or ...!??
 
Appreciate your advice!

View 1 Replies View Related

Saving Values

Aug 10, 2007

Hi All
2 post in a row first time in ages so i must be getting better but i get stuck on crappy little things like this hopefully
I have data in the following format
4.1399999999999997
4.2400000000000002
5.4800000000000004
5.1799999999999997
6.7699999999999996
i want to select the data as such
4.13
4.24
5.48
5.17
6.76
I keep chasing my tale on this one around and around any one got a simple idea i am missing, you would not believe how much time i have spent on this.
Cheers
Phil

View 15 Replies View Related

Saving In Database

Sep 12, 2007

Hey Guys need your help please!

we are now on our second week back log...

database file is not full and not limited to growth. As a matter of fact batch transactions are done but our proble is very slow. 28 records has been successfully save after 45 mins. Before it's just 5 minutes. Then some other process are not working. Is there anything that I must do? We have 460 tables in our software using SQL server 2000 and our application is using VB 6.0

View 3 Replies View Related

Saving HTML To Sql

Oct 25, 2007

hello,

Im not really sure if this is the right thing to do. But i want to save a copy of the html from my invoice to sql so that i can keep a history of the invoices in case their are changes done to them. Anybody know what would be the best way to do this?

Thank you,

~ Mauricio

View 3 Replies View Related

Saving Backups

Feb 18, 2008

my backups are huge.. my database is huge

is there anyway of saving each month and incremental backup - like only that months info and changes and not all the previous months?

what do you normally do when the backup gets real large?

View 7 Replies View Related

Saving .mdf Database

Apr 10, 2006

Hello,I use SQL Server 2005 Express and I would liketo save on db of mine...Have I only to save the .mdf and .ldf data fileor I need to stop some service or other programs?Can I use some utility to schedule this?ThanksM.

View 4 Replies View Related

Saving Text To MS-SQL...

Jul 20, 2005

If you use the command UPDATE <tablename> SET <fieldname> = ' ... ' toupdate a CHAR or TEXT field there are some characters that can causeproblems such as a single quote. Are there any other type of charaters likethat?TIA

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved