Showing posts with label save. Show all posts
Showing posts with label save. Show all posts

Thursday, March 8, 2012

"Save" and "Open" in Query Designer

As far as I can tell, there is no way to save a query and open it later
in Query Designer, right?
As far as I know, outside of the flawed and obsolete MSQuery, there is
no ad hoc data editor in SQL Server 2000 tools besides Query Designer,
right?
By now, you probably see what I'm getting at- I need a tool like Query
Designer that can be used to edit data without having to go through the
overhead of recomposing the query or cutting and pasting it into Query
Designer. My conception of it would be to have something like the DTS
folder in EM for queries where they could be created or opened.
Just wanted to check that I am not missing something.
Thanks,
JP
SocSecTrainWreck@.earthlink.net wrote:
> As far as I can tell, there is no way to save a query and open it later
> in Query Designer, right?
> As far as I know, outside of the flawed and obsolete MSQuery, there is
> no ad hoc data editor in SQL Server 2000 tools besides Query Designer,
> right?
> By now, you probably see what I'm getting at- I need a tool like Query
> Designer that can be used to edit data without having to go through the
> overhead of recomposing the query or cutting and pasting it into Query
> Designer. My conception of it would be to have something like the DTS
> folder in EM for queries where they could be created or opened.
> Just wanted to check that I am not missing something.
> Thanks,
> JP
>
Use Query Analyzer. That's what it's for. And you can save your
scripts and rerun them whenever you want to.
Simon Worth
|||Simon Worth wrote:[vbcol=seagreen]
> SocSecTrainWreck@.earthlink.net wrote:
later[vbcol=seagreen]
is[vbcol=seagreen]
Designer,[vbcol=seagreen]
Query[vbcol=seagreen]
the[vbcol=seagreen]
Query[vbcol=seagreen]
DTS
> Use Query Analyzer. That's what it's for. And you can save your
> scripts and rerun them whenever you want to.
I guess I was missing something. All these years of using
ISQL/ISQLW/Query Analyzer and I never realized that you could edit data
with it. Thanks.
JP
|||SocSecTrainWreck@.earthlink.net wrote:
> Simon Worth wrote:
>
> later
>
> is
>
> Designer,
>
> Query
>
> the
>
> Query
>
> DTS
>
> I guess I was missing something. All these years of using
> ISQL/ISQLW/Query Analyzer and I never realized that you could edit data
> with it. Thanks.
> JP
>
You can edit it as long as there is a primary key supplied within the query.
Simon Worth
|||I think I misunderstood what you were saying.
When you refer to Query Designer, what tool are you referring to? The
tool that is built into EM (IE right click table, goto Open Table > Query)?
In Query Analyzer, if you right click a table and click Open, it will
return the contents of the table. You can modify the data within the
table if there is a primary key assigned.
I'm not sure if you can edit views through QA, but I doubt it.
Sorry for the confusion there.
Simon Worth
Simon Worth wrote:
> SocSecTrainWreck@.earthlink.net wrote:
> You can edit it as long as there is a primary key supplied within the
> query.
>
|||Simon Worth wrote:
> I think I misunderstood what you were saying.
> When you refer to Query Designer, what tool are you referring to?
The
> tool that is built into EM (IE right click table, goto Open Table >
Query)?
That's the one.

> In Query Analyzer, if you right click a table and click Open, it will

> return the contents of the table. You can modify the data within the

> table if there is a primary key assigned.
I don't see how either one will allow you to open a saved select
statement on a table, run it, and then edit the results. In the Query
Designer in EM you can edit the SQL statement to return whatever data
you want and then edit the result set. Changes are saved as you move
from one cell to another. But you can't save the select statement and
then reopen it later if you need to repeat the process for whatever
reason.
I was not aware that there was any way to edit tables in QA; is there
any way at all to restrict or order the results?

> I'm not sure if you can edit views through QA, but I doubt it.
I didn't want to have to create actual views. I wanted to be able to
save the select statement to a file that I could open and run.
|||QA won't let you run a script and edit the results, so that won't work.
But an option could be (not a good one however), to save the SQL script
in any text editor, and when you want to edit again in Query Designer,
just copy/paste the script from the text file into the SQL pane in Query
Designer.
Simon Worth
SocSecTrainWreck@.earthlink.net wrote:
> Simon Worth wrote:
>
> The
>
> Query)?
> That's the one.
>
>
>
>
> I don't see how either one will allow you to open a saved select
> statement on a table, run it, and then edit the results. In the Query
> Designer in EM you can edit the SQL statement to return whatever data
> you want and then edit the result set. Changes are saved as you move
> from one cell to another. But you can't save the select statement and
> then reopen it later if you need to repeat the process for whatever
> reason.
> I was not aware that there was any way to edit tables in QA; is there
> any way at all to restrict or order the results?
>
>
> I didn't want to have to create actual views. I wanted to be able to
> save the select statement to a file that I could open and run.
>
|||Enterprise Manager has never been build to edit data. Either you'll have to
use the application that's using the database, or you'll have to use Query
Analyser and then learn SQL so you are able to edit/update the data the way
you need.
Personally I'd say that editing data "outside" you application, is only for
the cases where you need to do mass changes of data or something has went
wrong with the "logic" in the data, so the application isn't able to handle
the data. In both cases you should only mess with the data manually if you
know SQL - and then it's no problem to run the proper commands in Query
Analyzer...:-).
Regards
Steen
SocSecTrainWreck@.earthlink.net wrote:
> Simon Worth wrote:
> That's the one.
>
>
> I don't see how either one will allow you to open a saved select
> statement on a table, run it, and then edit the results. In the Query
> Designer in EM you can edit the SQL statement to return whatever data
> you want and then edit the result set. Changes are saved as you move
> from one cell to another. But you can't save the select statement and
> then reopen it later if you need to repeat the process for whatever
> reason.
> I was not aware that there was any way to edit tables in QA; is there
> any way at all to restrict or order the results?
>
> I didn't want to have to create actual views. I wanted to be able to
> save the select statement to a file that I could open and run.

Tuesday, March 6, 2012

"Not enough Storage"

When I tried to save a stored proedure (in SQL Server 2005 Express), I got a
n
error saying "The operation could not be completed. Not enough storage is
available to complete this operation."
Any idea what is causing this error to pop up? I still have about 4GB disk
space left.
Thanks.SQL Express has a 4GB limit on the database size so if you're at that limit
you are out of space no matter how much disk space is left.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Swami" <Swami@.discussions.microsoft.com> wrote in message
news:E6536E4F-31BE-4609-9DFC-FFCC5C6A1CD2@.microsoft.com...
> When I tried to save a stored proedure (in SQL Server 2005 Express), I got
> an
> error saying "The operation could not be completed. Not enough storage is
> available to complete this operation."
> Any idea what is causing this error to pop up? I still have about 4GB
> disk
> space left.
> Thanks.|||My whole MSSQL folder is only 148 MB and my particular database in question
is only 2MB in size. I actually have very little data...about 7-8 tables
which are mostly empty and about 25 stored procedures, each of them quite
short. Any ideas?
Thanks.
"Roger Wolter[MSFT]" wrote:

> SQL Express has a 4GB limit on the database size so if you're at that limi
t
> you are out of space no matter how much disk space is left.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "Swami" <Swami@.discussions.microsoft.com> wrote in message
> news:E6536E4F-31BE-4609-9DFC-FFCC5C6A1CD2@.microsoft.com...
>
>|||Well, one guess is you might have choosen the option
Do not autogrow
right click on database -> properties -> datafiles
check - Automatically grow file.
and also
maximum file size -> unrestricted file growth.
Do the same in log files. And see.
Hope this helps.
And I believe this is your test database. (and not production :)|||What tool are you using to create the stored procedure? You might try
saving the proc script to a file and creating with the SQLCMD.EXE
command-line utility.
Hope this helps.
Dan Guzman
SQL Server MVP
"Swami" <Swami@.discussions.microsoft.com> wrote in message
news:E6536E4F-31BE-4609-9DFC-FFCC5C6A1CD2@.microsoft.com...
> When I tried to save a stored proedure (in SQL Server 2005 Express), I got
> an
> error saying "The operation could not be completed. Not enough storage is
> available to complete this operation."
> Any idea what is causing this error to pop up? I still have about 4GB
> disk
> space left.
> Thanks.|||this message indicated a bug referenced in sql server 2000 if you are using
lookups...
try your error message with google
Nicolas Guinet
"Swami" <Swami@.discussions.microsoft.com> a crit dans le message de news:
E6536E4F-31BE-4609-9DFC-FFCC5C6A1CD2@.microsoft.com...
> When I tried to save a stored proedure (in SQL Server 2005 Express), I got
> an
> error saying "The operation could not be completed. Not enough storage is
> available to complete this operation."
> Any idea what is causing this error to pop up? I still have about 4GB
> disk
> space left.
> Thanks.|||You may want to check out this link too.
http://support.microsoft.com/defaul...;166840&sd=tech

Monday, February 13, 2012

"downgrade" edition ?

Hi
I save SQLServer 7.0 enterprise edition installed on NT
4.0 PDC.
And now i want to install SQLServer 2000 standard edition
and upgrade default instance. When i run SQLServer 2000
setup, the option "Upgrade..." is not available.
I think it happens because different version: enterprise
and standart (or not ?)
How i can "downgrade" SQLServer edition ?
Or i should backup all 7 databases, install SQLServer 2000
and restore all databases from backup,include master (to
preserve logins)?I can point you in the direction of a good article on this subject :-
http://www.sqlteam.com/item.asp?ItemID=9066
--
HTH
Ryan Waight, MCDBA, MCSE
"Slava Melnikov" <melnikov@.pochta.ru> wrote in message
news:0a0201c38eed$a99fee90$a301280a@.phx.gbl...
> Hi
> I save SQLServer 7.0 enterprise edition installed on NT
> 4.0 PDC.
> And now i want to install SQLServer 2000 standard edition
> and upgrade default instance. When i run SQLServer 2000
> setup, the option "Upgrade..." is not available.
> I think it happens because different version: enterprise
> and standart (or not ?)
> How i can "downgrade" SQLServer edition ?
> Or i should backup all 7 databases, install SQLServer 2000
> and restore all databases from backup,include master (to
> preserve logins)?

Friday, January 27, 2012

help! how to save user inputs from checkbox list to database?

Hi,

I'm new to ASP.NET 2.0. I'll like to ask how do one save user input from txtbox, radiobttnlist or checkboxlist into database?

Im implementing a suvrey form here by the way.

-any reference webs,

-any pointers from experts?

Thank you for your time in reading this email

Kayln

Hi,

here is an example:

Private Sub btnSubmit_Click(ByVal sender As Object, ByVal e As eventArgs) Handles btnSubmit.Click

SqlDataSource1.InsertParameters.Add("DataBase_Field_Name", System.TypeCode.String, CheckBoxList1.SelectedValue)

SqlDataSource1.Insert()

End Sub

Hope it helps,

Regards

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

Please do not forget to mark as answered the correct answer. Thanks

|||

HiStoian Bucovich,

I do not understand your example. Do i implement it in the source code or do i attach it to what I already have if so where do i place it exactly?

Thnk you for your time

Kayln

|||

HiPrincessKitana,

in my example I am using separate file for code behind (it doesn't realy matter)

- in .aspx file you should have sqldatasource1 connecting you to your database table and allowing you to insert, delete, update and for sure your CheckBoxList1 with its items set by value="1" for example + a button (btnSubmit)

- in your code behind file .aspx.vb you should place the above code to handle after the checkbox was selected and button was clicked event all you have to configure is to set the proper DB column name ("DataBase_Field_Name") and the typecode that you will insert in this example I am showing String

Hope it helps

Regards

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

Please do not forget to mark as answered the correct answer. Thanks

|||

Dear Stoian,

lets go through this real slowly, cos Im still very green in this.

1) I have tocreate a database table say icecream flavor. so my options can are vanilla, chocolate or strawberry.

2) Ineed to place sqldatasource in my web form to retrieve this database.

3)Go on which my question ie which flavor do you like..then i have a checkboxlist with its datasource set to my sqldatasource.I do not understand "your CheckBoxList1 with its items set by value="1""

4)then I place a button , have it ID property: btnSubmit, Textbutton: Submit

5)then Idble click on the submit button to place an event handler, ie copy and paste below into my event handler?

********Private Sub btnSubmit_Click(ByVal sender As Object, ByVal e As eventArgs) Handles btnSubmit.Click

SqlDataSource1.InsertParameters.Add("DataBase_Field_Name", System.TypeCode.String, CheckBoxList1.SelectedValue)

SqlDataSource1.Insert()

End Sub***********

6) I do not understand ""all you have to configure is to set the proper DB column name ("DataBase_Field_Name") and the typecode that you will insert in this example I am showing String"

Distressed Kayln [:( ]

|||

Hi PrincessKitana,

First of all nice nick name, second I am sorry for my late replay, and third the answer:

- first you have to make your database lets name it "flavors" and create table in it lets say its name will be "icecreams" and this table must have the following entries:

1. ID data type "int" allow null "unchecked" set as primary key and autoincrement "yes"

2. Flavors data type "nvarchar(100)" allow null "checked"

Thats all for the data base

So long so good, next is to set the sqldatasource in your lets say Default.aspx file (just drag and drop the control named "SqlDataSource" and select your database and credentials etc. (p.s. if you need help about this please feel free to ask)

Then its time to make your CheckBoxList control and set its values:

<asp:CheckBoxListID="CheckBoxList1"runat="server">

<asp:ListItemSelected="true"Value="Vanilla">Vanilla</asp:ListItem>

<asp:ListItemValue="chocolate">chocolate</asp:ListItem>

<asp:ListItemValue="strawberry">strawberry</asp:ListItem>

</asp:CheckBoxList>

Then build your submit button

<asp:Button ID="btnSubmit" runat="server" Text="Submit" />

Its time to do some work in code behind (I am using VB in this example), double click the submit button in design view and you will see:

Private Sub bntSubmit_Click(ByVal sender As Object .........etc.

End Sub

Paste in it the code that I show you above and change only the field "DataBase_Field_Name" to "Flavors"

Thats it hope it helps

Regards

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

Please do not forget to mark as "Answer" the correct answer. Thanks

|||

Dear Stoian,

yes thank you for the compliment. anyway thanks to you, i managed to figure out your example but i have this problem that came up.

dun really know what it is??

SqlDataSource1.InsertParameters.Add("flavors", System.TypeCode.String, CheckBoxList1.SelectedValue)

{ SqlDataSource1.Insert() }------>>Inserting is not supported by data source 'SqlDataSource1' unless InsertCommand is specified.

CHeeRs,

Kayln

|||

Hi,

I guess you didn't checked Insert/Delete/Update field when you make your SqlDataSource connection any way, here is the complete code

- Default.aspx

<%@.PageLanguage="VB"AutoEventWireup="false"CodeFile="Default.aspx.vb"Inherits="_Default" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

</head>

<body> <formid="form1"runat="server">

<div>

<!-- Here is the sql data source -->

<asp:SqlDataSourceID="SqlDataSource1"

runat="server"

ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

DeleteCommand="DELETE FROM [icecreams] WHERE [ID] = @.ID"

InsertCommand="INSERT INTO [icecreams] ([Flavors]) VALUES (@.Flavors)"

SelectCommand="SELECT * FROM [icecreams]"

UpdateCommand="UPDATE [icecreams] SET [Flavors] = @.Flavors WHERE [ID] = @.ID">

<DeleteParameters>

<asp:ParameterName="ID"Type="Int32"/> </DeleteParameters>

<UpdateParameters>

<asp:ParameterName="Flavors"Type="String"/>

<asp:ParameterName="ID"Type="Int32"/>

</UpdateParameters>

<InsertParameters> </InsertParameters>

</asp:SqlDataSource>

<!-- here is the check box list -->

<asp:CheckBoxListID="CheckBoxList1"runat="server">

<asp:ListItemSelected="true"Value="Vanilla">Vanilla</asp:ListItem>

<asp:ListItemValue="chocolate ">chocolate</asp:ListItem>

<asp:ListItemValue="strawberry">strawberry</asp:ListItem>

</asp:CheckBoxList>

<br/>

<!-- here is the button -->

<asp:ButtonID="btnSubmit"runat="server"Text="Submit"/>

</div>

</form> </body>

</html>

- Default.aspx.vb code

PartialClass _Default

Inherits System.Web.UI.Page

PrivateSub btnSubmit_Click(ByVal senderAsObject,ByVal eAs EventArgs)Handles btnSubmit.ClickSqlDataSource1.InsertParameters.Add("Flavors", System.TypeCode.String, CheckBoxList1.SelectedValue)

SqlDataSource1.Insert()

EndSub

EndClass

- and web.config

<?xmlversion="1.0"?><!--

Note: As an alternative to hand editing this file you can use the

web admin tool to configure settings for your application. Use

the Website->Asp.Net Configuration option in Visual Studio.

A full list of settings and comments can be found in

machine.config.comments usually located in

\Windows\Microsoft.Net\Framework\v2.x\Config

-->

<configuration> <connectionStrings>

<addname="ConnectionString"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\flavors.mdf;Integrated Security=True;User Instance=True"

providerName="System.Data.SqlClient" />

</connectionStrings>

<appSettings/>

<system.web>

<!--

Set compilation debug="true" to insert debugging

symbols into the compiled page. Because this

affects performance, set this value to true only

during development.

Visual Basic options:

Set strict="true" to disallow all data type conversions

where data loss can occur.

Set explicit="true" to force declaration of all variables.

-->

<compilationdebug="true"strict="false"explicit="true">

</compilation>

<pages>

<namespaces>

<clear/>

<addnamespace="System"/>

<addnamespace="System.Collections"/>

<addnamespace="System.Collections.Generic"/>

<addnamespace="System.Collections.Specialized"/>

<addnamespace="System.Configuration"/>

<addnamespace="System.Text"/>

<addnamespace="System.Text.RegularExpressions"/>

<addnamespace="System.Web"/>

<addnamespace="System.Web.Caching"/>

<addnamespace="System.Web.SessionState"/>

<addnamespace="System.Web.Security"/>

<addnamespace="System.Web.Profile"/>

<addnamespace="System.Web.UI"/>

<addnamespace="System.Web.UI.WebControls"/>

<addnamespace="System.Web.UI.WebControls.WebParts"/>

<addnamespace="System.Web.UI.HtmlControls"/>

</namespaces> </pages>

<!--

The <authentication> section enables configuration

of the security authentication mode used by

ASP.NET to identify an incoming user.

--> <authenticationmode="Windows"/>

<!--

The <customErrors> section enables configuration

of what to do if/when an unhandled error occurs

during the execution of a request. Specifically,

it enables developers to configure html error pages

to be displayed in place of a error stack trace.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

<error statusCode="403" redirect="NoAccess.htm" />

<error statusCode="404" redirect="FileNotFound.htm" />

</customErrors>

--> </system.web>

</configuration>

All you have to do is to make the database as told you above :)

Hope it helps

Regards

Stoian