Adding Fields To A Table

Oct 17, 2007

I am new to SQL Server 2005 and I am trying to add two fields to an existing table. The table has 15 Million records in it and the save is not completing. How do I add the new fields?

View 14 Replies


ADVERTISEMENT

Script For Adding Fields To Table

Jul 23, 2005

How can I create a script that updates a table with new fields withoutlosing the data in the table (i.e., without dropping and recreating thetable)?Thanks.

View 5 Replies View Related

Adding New Column Fields Into A Big Table Issue

Aug 13, 2004

I have an existing table which has about 70 columns with 3 million rows in it. I was asked to add additional 50 new columns into the table. I have tried to add them in through the Enterprise manager design table but experiencing some problems. The adding process seemed never going to be end. Is there any good efficient way to do it??? I appreciate the help!


J8

View 4 Replies View Related

Adding Identity Fields

Nov 2, 1998

I have a table that I need to add an identity field to. I created a field in the table as an INT and added values to all of the existing records. When I try to change it to an IDENTITY field I continually get an error saying 'Invalid cursor state' . The help function tells me that this is caused by not having enough space in the transaction log but I don't understand this b/c the trans log is configured to expand as needed. Anyone know how I can do this?

Thanks,
Tony

View 2 Replies View Related

Help With SQL If Statement And Adding Fields Together

Jul 23, 2005

I have a query that I need a hand on. I am trying to add togther somefiends based on values of another.What I would like to add a billing total by saying more or less thefollowing:SELECT labor_hours, labor_cost, expidite_fee, flat_rate,include_repair_cost, include_cal, include_flat_rate, include_parts,cur_bill,(labor_hours * labor_cost) AS labor_total,(ISNULL((SELECT TOP 1 cal_cost FROM calID WHERE orderID=79559 ORDER BYdateCAL DESC),0)) AS cal_total,(ISNULL((SELECT SUM((qty * cost) + premium_charge) AS gptotal FROMrepair_partsID WHERE orderID=79559),0) +ISNULL((SELECT SUM(qty_needed * cust_cost) AS gnptotal FROMmisc_part_assocID WHERE orderID=79559),0)) AS parts_total,((labor_hours * labor_cost) + expidite_fee + flat_rate +ISNULL((SELECT TOP 1 cal_cost FROM calID WHERE orderID=79559 ORDER BYdateCAL DESC),0) +ISNULL((SELECT SUM((qty * cost) + premium_charge) AS gptotal FROMrepair_partsID WHERE orderID=79559),0) +ISNULL((SELECT SUM(qty_needed * cust_cost) AS gnptotal FROMmisc_part_assocID WHERE orderID=79559),0)) AS actual_total,(expidite_feeIF include_repair_cost = 1+ (labor_hours * labor_cost)IF include_flat_rate = 1+ flat_rateIF include_cal = 1+ ISNULL((SELECT TOP 1 cal_cost FROM calID WHERE orderID=79559 ORDERBY dateCAL DESC),0)IF include_parts = 1+ ISNULL((SELECT SUM((qty * cost) + premium_charge) AS gptotal FROMrepair_partsID WHERE orderID=79559),0) +ISNULL((SELECT SUM(qty_needed * cust_cost) AS gnptotal FROMmisc_part_assocID WHERE orderID=79559),0)) AS billing_totalFROM view_inventoryWHERE orderID=79559I know the IF part is whacked, that's where I need the help. Is thistype of thing even possible? Or even efficent? Is it wise to subqueryfor totals (not like I have a choice based on the applicationrequirements)? help.

View 2 Replies View Related

Adding Calculated Fields

Jul 20, 2005

I have a table with some fields. break_mon, lunch_mon, dinner_mon, ent_mon,break_tue, lunch_tue, dinner_tue, ent_tue, .....etcI want to output the sum of the four monday columns as well as the sum ofthe four tuesday columns.I did this withSELECT break_mon+lunch_mon+dinner_mon+ent_mon AS mon_tot,break_tue+lunch_tue+dinner_tue+ent_tue AS tue_totFROM expense_reportI now want to add mon_tot and tue_tot AS total, but SQL is telling me thatit can not find mon_tot. Is there a way to do this? Thanks!DarrenMCP

View 4 Replies View Related

Adding Additional Fields To ASPNETDB.mdf

Dec 28, 2006

I am attempting to add additional fields and data to the default users database that is created as a result of enabling roles on my website.  Is it possible to add additional data fields to this file?  Where can I find the commands to do this?

View 2 Replies View Related

Adding Data From Fields To Get A Total

Apr 11, 2006

EX:  I have a table for products, and each product has a quantity.  How can I add up the QTY field in all the rows to find out the total QTY of all the products.Any help would be greatly appreciated.gkc

View 4 Replies View Related

Adding Description To Tables And Fields

Oct 27, 2000

Can I add a description to a table or field? The way access gives you to add a description to a field.


Thanks!

View 1 Replies View Related

Adding New Fields To Transaction Replication.

May 19, 2006

I need help to add new fields in Transaction replication & also want to know how it will be replicated to Subscriber.

View 1 Replies View Related

Adding Conditions (if/else) When Selecting Fields

Aug 18, 2004

We have three fields in a table: firstname, Surname & Organisation. Firstname & surname will always be filled but in most cases organisation is NULL.

Part of what these fields will be used for is a mailshot. If there is no organisation data then the mailshot will open with 'Dear Firstname Surname, ' but if the organisation is present they would like 'Dear Organisation'.

Is it possible to create a select state that checks the organisation field, and if a value is present return that value else return the firstname, surname combination? I have tried various things but I cannot get it to work.

I know the ideal situation would be to do this type of condition check at scripting level (PHP, ASP, Visual Basic) but my bosses would like to try it at SQL level.

View 1 Replies View Related

Adding User Define Fields Together

Apr 5, 2004

This is driving me crazy! The SQL Statement refenced is shown at the end of this email.

When I try and run the statement, an error is raised saying that Undrawn_GT5MIL_LE365Days is invalid (likewise for Undrawn_LE5MIL_LE365Days). From what I can gather, it is saying that I cannot include a User Defined variable in another argument. This is unlike Access. Any suggestions?


SQL View.......

SELECT TOP 100 PERCENT QRY_FacNew_Term.Category, QRY_FacNew_Term.Fac_No, QRY_FacNew_Term.Client_Number, QRY_FacNew_Term.Client_Name,

Undrawn_GT5MIL_LE365Days = CASE WHEN Undrawn_CDN >= 5000000 AND Term <= 365 THEN Undrawn_CDN ELSE 0 END,

Undrawn_GT5MIL_GT365Days = CASE WHEN (Undrawn_CDN >= 5000000 AND Term > 365) OR

(Cr_Limit_CDN IN (0, 1)) THEN Undrawn_CDN ELSE 0 END, [Undrawn_GT5MIL_LE365Days]+[Undrawn_GT5MIL_GT365Days] AS Total

FROM dbo.QRY_FacNew_Term

WHERE (Exclude <> 'Y')

ORDER BY Category, Client_Name

View 1 Replies View Related

A Problem With Adding Fields In Ssems

Jun 1, 2007

hi,
i have a DB and it has some tables that the tables has related link (diagram).now when i wanna to change a table's field , the Sql Server errors that the table is not empty.when i try to delete the table's content , Sql server errors that the table is use a relation with another table.
so can i change a table's structure?
by the way before i forget , the Sql Server's error is below:

'UserManagement' table
- Unable to modify table.
ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition specified, or the column being added is an identity or timestamp column, or alternatively if none of the previous conditions are satisfied the table must be empty to allow addition of this column. Column 'isadmin' cannot be added to non-empty table 'UserManagement' because it does not satisfy these conditions.


thanks,
M.H.H

View 2 Replies View Related

Adding A Calculated Field By Using Two Fields From Different Data Sets

Oct 1, 2007



Can I make a calculated field by using two fields from different data sets?(I'm talking about SSRS data sets)

I tried to do that. But I got a error message.




"Report item expressions can only refer to other report items within the same grouping scope or a containing grouping scope."


Please can some one help me out?

View 5 Replies View Related

Creating A Table In SQL Server With Fields From Other Tables And Some Fields User Defined

Feb 20, 2008

How can I create a Table whose one field will be 'tableid INT IDENTITY(1,1)' and other fields will be the fields from the table "ashu".
can this be possible in SQL Server without explicitly writing the"ashu" table's fields name.

View 8 Replies View Related

Reporting Services :: Adding All Columns To Table Without Adding One By One

Sep 3, 2015

Is there any way or option to get the all columns of dataset added to table when we add a table in data region. It will take lot of time to add one by one and also there are chances to add one column ore than once.

View 7 Replies View Related

Using LIKE To Find Any Of Fields In One Table In Fields Of Another

Jul 31, 2013

I have a list of items in one table and a field (pageName) in another table that may contain one of the aforementioned items somewhere within that field. There is no fixed position within the field where the itemNo may be so I can't just use SUBSTRING(pageName,2,5) in(select itemNo from tblItem).

Logically, it's like I need to combine IN and LIKE: select pageName where pageName LIKE IN %select itemNo from tblitemNo%..LIKE can only handle one comparison string.

View 5 Replies View Related

Adding A Full Text Search Across Multiple Tables (with Text Fields)

Sep 7, 2007

Hi, i'm trying to do a full text search on my site to add a weighting score to my results.  I have the following database structure:
Documents: - DocumentID (int, PK) - Title (varchar) - Content (text) - CategoryID (int, FK)
Categories: - CategoryID (int, PK) - CategoryName (varchar)
I need to create a full text index which searches the Title, Content and CategoryName fields.  I figured since i needed to search the CategoryName field i would create an indexed view.  I tried to execute the following query:
CREATE VIEW vw_DocumentsWITH SCHEMABINDING ASSELECT dbo.Documents.DocumentID, dbo.Documents.Title, dbo.Documents.[Content], dbo.Documents.CategoryID, dbo.Categories.CategoryNameFROM dbo.Categories INNER JOIN dbo.Documents ON dbo.Categories.CategoryID = dbo.Documents.CategoryID
GOCREATE UNIQUE CLUSTERED INDEX vw_DocumentsIndexON vw_Documents(DocumentID)
But this gave me the error:
Cannot create index on view 'dbname.dbo.vw_Documents'. It contains text, ntext, image or xml columns.
I tried converting the Content to a varchar(max) within my view but it still didn't like.
Appreciate if someone can tell me how this can be done as surely what i'm trying to do is not ground breaking.

View 2 Replies View Related

Automatically Adding Records To Child Table When Record Added To Parent Table

Aug 19, 2006

In SQL Server 2000, I have a parent table with a cascade update to a child table. I want to add a record to the child table whenever I add a table to the parent table. Thanks

View 1 Replies View Related

Importing Access Table Into SQL Server 2005 Express Table And Adding One Field

Feb 16, 2007

Hi all,

Hopefully I am posting this question in the correct forum. I am still learning about SQL 2005. Here is my issue. I have an access db that I archive weekly into and SQL server table. I have used the dst wizard to create an import job and initally that worked fine. field I have as the primary key in the access db cannot be the primary key in the sql table since I archive weekly and that primary key field will be imported several time over. I overcame this initally by not having a primary key in the sql table. This table is strictly for reference. However, now I need to setup a unique field for each of the records in the sql table. What I have done so far is create a recordID field in the sql table that is an int and set as yes to Identify (auotnumber). That worked great and created unique id for all existing records. The problem now is on the import. When I try to import the access table i am getting an error because of the extra field in the sql table, and the error is saying cannot import null value into this field. So... my final question is how can I import the access table into the sql table with one extra field which is the autonumber unique field? Thanks a bunch for any asistance.

Bill

View 7 Replies View Related

Query Based Off Primary Key Of Parent Table - Adding Child Table

Jan 28, 2012

I need to add a child table that will tell us who the participants counselor is, what I did was I did a Make Table query based off the primary key of the Parent table and made that the link (foreign key) for the People_tbl and the Counselor_tbl, so if the counselor changes then the user adds the record to the counselor tbl and then puts in the Effective date. The problem is that when I run a report it doesn't show the present counselor always shows the old counselor?

Code:
SELECT Student_ind.StudentFirstName, Student_ind.StudentLastName, Student_ind.[Student ID], People_tbl.[Family ID], People_tbl.FirstName,
People_tbl.LastName, People_tbl.[Parent ID]
FROM People_tbl RIGHT OUTER JOIN
Student_ind ON People_tbl.[Family ID] = Student_ind.[Family ID]
WHERE (People_tbl.LastName = @Enter_LastName) AND (People_tbl.FirstName = @Enter_FirstName)

View 5 Replies View Related

SQL Tools :: Adding Column To A Table Causes Copying Data Into Temp Table

Sep 23, 2015

If on the source I have a new column, the script generated by SqlPackage.exe recreates the table on the background with moving the data into a temp storage. If the table is big, such approach can cause issues.

Example of the script is below: in the source project I added columns [MyColumn_LINE_1]  and [MyColumn_LINE_5].

Is there any way I can make it generating an alter statement instead?

BEGIN TRANSACTION;
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SET XACT_ABORT ON;
CREATE TABLE [dbo].[tmp_ms_xx_MyTable] (
[MyColumn_TYPE_CODE] CHAR (3) NOT NULL,

[Code] ....

The same script is generated regardless the table having data or not, having a clustered or nonclustered PK.

View 7 Replies View Related

How To Do-table 1 That Check Table 2 And Adding Missing Dates

Dec 20, 2007

can sql server do this ?
table 1 that check table 2 and adding missing dates
this my employee table

table 1
table Employee on work
------------------------
empid basedate shift
----------------------------
12345678 01/04/2007 1
12345678 02/04/2007 1
12345678 03/04/2007 1
12345678 04/04/2007 1
12345678 05/04/2007 1
12345678 06/04/2007 1
12345678 07/04/2007 1
12345678 08/04/2007 1
12345678 09/04/2007 1
12345678 10/04/2007 1

98765432 20/04/2007 1
98765432 21/04/2007 3
98765432 22/04/2007 3
98765432 23/04/2007 5
98765432 25/04/2007 4
98765432 26/04/2007 4
98765432 27/04/2007 4
98765432 28/04/2007 4
98765432 30/04/2007 4
-----------------------------------------------------------------------------------
and i need to see the missing dates lkie this

in table 2
------------------------------------------------------
table 2 (adding missing dates with zero 0)
table Employee_all_month
------------------------
empid basedate shift
----------------------------
12345678 01/04/2007 1
12345678 02/04/2007 1
12345678 03/04/2007 1
12345678 04/04/2007 1
12345678 05/04/2007 1
12345678 06/04/2007 1
12345678 07/04/2007 1
12345678 08/04/2007 1
12345678 09/04/2007 1
12345678 10/04/2007 1
12345678 11/04/2007 0
12345678 12/04/2007 0
12345678 13/04/2007 0
12345678 14/04/2007 0
12345678 15/04/2007 0
12345678 16/04/2007 0
12345678 17/04/2007 0
12345678 18/04/2007 0
12345678 19/04/2007 0
12345678 20/04/2007 0
.................................and adding missing dates with zero 0 until the end of the month
.................................
12345678 31/04/2007 0


98765432 01/04/2007 0
98765432 02/04/2007 0
98765432 03/04/2007 0
98765432 04/04/2007 0
98765432 05/04/2007 0
98765432 06/04/2007 0
98765432 07/04/2007 0
98765432 08/04/2007 0
98765432 09/04/2007 0
..............................and adding missing dates with zero 0 only whre no dates in this month
.......................

98765432 20/04/2007 1
98765432 21/04/2007 3
98765432 22/04/2007 3
98765432 23/04/2007 5
98765432 25/04/2007 4
98765432 26/04/2007 4
98765432 27/04/2007 4
98765432 28/04/2007 4
98765432 30/04/2007 4


TNX


View 4 Replies View Related

Finding Rows In One Table But Not In Another Table Based On 2 Fields

Apr 23, 2008



I have 2 tables with 2 fields in common between them. How do I get a count of rows in table 1 but not in table 2 matching those 2 fields? Thanks.

View 7 Replies View Related

Creating Table Fields Dynamically From Another Table Row

Aug 31, 2006

Hello all:

Is it possible to creates fields of the table dynamically?. I have this situation in my project. This is just a small sample. I have row of length 140. I don't wan't to declare all this fields manually using the create table command.

The description of table is as, in this table all the field are of type varchar only, there are like 140 columns.

create dummy emp (
field1 VARCHAR(100), field2 varchar(200), field3 VARCHAR(100).... )

Table: Dummy
================================================== ==
field1 field2 field3..........
Empid Empname empaage1 sam 23...........
2 rai 22............
.
.
.
n raj 45.............
================================================== ==
Now I want to create another table as "EMP" , with proper data type
fields too..

create table emp (
empid int, empname varchar(100), empage int....)

The table should look like as:

Table: EMP
================================================== ==
Empid Empname empaage............
1 sam 23...............
2 rai 22................
.
.
.
n raj 45.................
================================================== ==

I want to do this dynamically.....
Some how I need to extract those field from table[dummy]; the first row acts as a column header for the table[Emp] and the subsequent row acts as a record for the table[Emp]

A small rough snippet of the code will be appreciated....

Waiting for replies........
saby

View 1 Replies View Related

I Want To Update My Table But It Has 30 Fields So How Can I Modify My Table I Have To

May 29, 2008

I want to update my Table but it has 30 fields so how can i modify my table i have to add some fields in it


I need that query for alter table

in it


reply me soon

View 14 Replies View Related

HT Insert Table A Record Fields Into Table B

Jun 13, 2008

All- Supposing I have table_a and table_b. Table_a has fields FIRST_A and LAST_A for people's first and last names. Similarly, table_b has FIRST_B and LAST_B for people's first and last names.

How would I create a record in table_b for each record in table_a, such that for each added record, the values of FIRST_A is copied to FIRST_B and LAST_A is copied to LAST_B. (Table_b will have other fields that are left unfilled.)

Thanks!

-Kurt

View 1 Replies View Related

Adding A New Row To SQL Table

Oct 2, 2007

Hi all,
I have a database setup with a few rows and i would like to allow a user to create a new row of data. After some googling, I've deduced that I need to somehow use an onclick command to perform an insert command. here is my code as of right now:
 protected void ItemAdd_Click(object sender, EventArgs e)
{int newnum = 4;int POnum = newnum ++;
 
 string Item = textbox3.Text.ToString();
string Quantity = textbox4.ToString();string Part = textbox5.ToString();
string Description = textbox6.Text.ToString();string Price = textbox7.Text.ToString();string UOM = textbox8.Text.ToString();
SqlDataSource2.InsertParameters.Clear();
SqlDataSource2.InsertParameters.Add("@Item", Item);SqlDataSource2.InsertParameters.Add("@Quantity", Quantity);
SqlDataSource2.InsertParameters.Add("@Part", Part);SqlDataSource2.InsertParameters.Add("@Description", Description);
SqlDataSource2.InsertParameters.Add("@Price", Price);SqlDataSource2.InsertParameters.Add("@UOM", UOM);
SqlDataSource1.InsertCommand = "insert into ItemMaster "+"values (12, @Item, @Quantity, @Part, @Description, @Price, @UOM)";
SqlDataSource2.Insert();
 
 
}
 
here's the aspx:
 
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="createpo.aspx.cs" Inherits="Subpgs_Purchasing_createpo" Title="Create A PO" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table style="width: 600px; position: relative; top: 30px; height: 253px" cellpadding="10px">
<tr>
<td style="width: 180px; text-align: left;" rowspan="2">
Select Vendor<br />- or -<br /><asp:LinkButton ID="Linkbutton1" runat="server" OnClick="Linkbutton1_Click">Create Vendor</asp:LinkButton></td>
<td style="width: 100px" rowspan="2">
<asp:ListBox ID="ListBox2" runat="server" DataSourceID="SqlDataSource1" DataTextField="Name"
DataValueField="ID" OnSelectedIndexChanged="ListBox2_SelectedIndexChanged"></asp:ListBox><asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [Vendor_info]"></asp:SqlDataSource>
</td>
<td style="width: 180px; text-align: left;">
Job/Req.S.O. No.</td>
<td style="width: 100px">
<asp:TextBox ID="Job" runat="server"></asp:TextBox></td>
</tr>
<tr>
 
<td style="width: 180px; text-align: left;">
Terms</td>
<td style="width: 100px">
<asp:TextBox ID="Terms" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 180px; text-align: left;">
F.O.B.</td>
<td style="width: 100px">
<asp:TextBox ID="FOB" runat="server"></asp:TextBox></td>
<td style="width: 180px; text-align: left;">
Ship To:<br />
Address:<br />
City / State / Zip:</td>
<td style="width: 100px">
<asp:TextBox ID="Ship1" runat="server"></asp:TextBox>
<asp:TextBox ID="Ship2" runat="server"></asp:TextBox>
<asp:TextBox ID="Ship3" runat="server"></asp:TextBox></td>
</tr>
</table>
 
<br />
<br />
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Purchase_Orders.mdf;Integrated Security=True;User Instance=True;Context Connection=False"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT [Item], [Quantity], [Part], [Description], [Price], [UOM], [Ammount], [PONumber] FROM [ItemMaster]" DeleteCommand="DELETE FROM [ItemMaster] WHERE [PONumber] = @PONumber" InsertCommand="INSERT INTO [ItemMaster] ([Item], [Quantity], [Part], [Description], [Price], [UOM], [Ammount], [PONumber]) VALUES (@Item, @Quantity, @Part, @Description, @Price, @UOM, @Ammount, @PONumber)" UpdateCommand="UPDATE [ItemMaster] SET [Item] = @Item, [Quantity] = @Quantity, [Part] = @Part, [Description] = @Description, [Price] = @Price, [UOM] = @UOM, [Ammount] = @Ammount WHERE [PONumber] = @PONumber">
<DeleteParameters>
<asp:Parameter Name="PONumber" Type="Decimal" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Item" Type="String" />
<asp:Parameter Name="Quantity" Type="Decimal" />
<asp:Parameter Name="Part" Type="String" />
<asp:Parameter Name="Description" Type="String" />
<asp:Parameter Name="Price" Type="Decimal" />
<asp:Parameter Name="UOM" Type="String" />
<asp:Parameter Name="Ammount" Type="Decimal" />
<asp:Parameter Name="PONumber" Type="Decimal" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Item" Type="String" />
<asp:Parameter Name="Quantity" Type="Decimal" />
<asp:Parameter Name="Part" Type="String" />
<asp:Parameter Name="Description" Type="String" />
<asp:Parameter Name="Price" Type="Decimal" />
<asp:Parameter Name="UOM" Type="String" />
<asp:Parameter Name="Ammount" Type="Decimal" />
<asp:Parameter Name="PONumber" Type="Decimal" />
</InsertParameters>
</asp:SqlDataSource>
<br />
<table>
<tr>
<td>Item #</td>
<td><asp:TextBox ID="textbox3" runat=server></asp:TextBox></td>
<td>Quantity</td>
<td><asp:TextBox ID="textbox4" runat=server></asp:TextBox></td>
<td>Part Number</td><td><asp:TextBox ID="textbox5" runat=server></asp:TextBox></td>
</tr>
<tr>
<td>Description</td>
<td><asp:TextBox ID="textbox6" runat=server></asp:TextBox></td>
<td>Unit Price</td>
<td><asp:TextBox ID="textbox7" runat=server></asp:TextBox></td>
<td>Unit of Measure</td>
<td><asp:TextBox ID="textbox8" runat=server></asp:TextBox></td>
</tr>
<tr>
<td colspan="6" align="center"><asp:Button ID="ItemAdd" runat=server text="Add Item" OnClick="ItemAdd_Click" /></td>
</tr>
</table>
&nbsp;<br />
<br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="PONumber"
DataSourceID="SqlDataSource2">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="Item" HeaderText="Item" SortExpression="Item" />
<asp:BoundField DataField="Quantity" HeaderText="Quantity" SortExpression="Quantity" />
<asp:BoundField DataField="Part" HeaderText="Part" SortExpression="Part" />
<asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
<asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
<asp:BoundField DataField="UOM" HeaderText="UOM" SortExpression="UOM" />
<asp:BoundField DataField="Ammount" HeaderText="Ammount" SortExpression="Ammount" />
<asp:BoundField DataField="PONumber" HeaderText="PONumber" ReadOnly="True" SortExpression="PONumber"
Visible="False" />
</Columns>
</asp:GridView>
<br />
<br />
<br />
<asp:Button ID="Button1" runat="server" Text="Submit Data" OnClick="Button1_Click" />&nbsp;<br />
<br />
<asp:Label ID="Label1" runat="server" Text="Please Verify Information below!" Visible="False"></asp:Label><br />
<br />
<table align="left">
<tr>
<td style="width: 200px; text-align: left;">
<asp:Label ID="Label4" runat="server" Text="Job/REQ.S.O. No." Visible="false"></asp:Label></td>
<td style="width: 200px; text-align: left;">
<asp:Label ID="Label5" runat="server"></asp:Label></td>
</tr>
<tr>
<td style="width: 200px; text-align: left;">
<asp:Label ID="Label7" runat="server" Text="Terms" Visible="false"></asp:Label></td>
<td style="width: 200px; text-align: left;">
<asp:Label ID="Label8" runat="server"></asp:Label></td>
</tr>
<tr>
<td style="width: 200px; text-align: left;">
<asp:Label ID="Label10" runat="server" Text="F.O.B." Visible="false"></asp:Label></td>
<td style="width: 200px; text-align: left;">
<asp:Label ID="Label11" runat="server"></asp:Label></td>
</tr>
</table>
 
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataSourceID="SqlDataSource1"
Height="50px" Visible="False" Width="260px" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2" DataKeyNames="ID" ForeColor="Black">
<FooterStyle BackColor="#CCCCCC" />
<EditRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="White" />
<PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
<Fields>
<asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:BoundField DataField="Street" HeaderText="Street" SortExpression="Street" />
<asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
<asp:BoundField DataField="State" HeaderText="State" SortExpression="State" />
<asp:BoundField DataField="Zip" HeaderText="Zip" SortExpression="Zip" />
<asp:BoundField DataField="Telephone Number" HeaderText="Telephone Number" SortExpression="Telephone Number" />
<asp:BoundField DataField="Contact Information" HeaderText="Contact Information"
SortExpression="Contact Information" />
<asp:BoundField DataField="E-mail address" HeaderText="E-mail address" SortExpression="E-mail address" />
<asp:BoundField DataField="Fax Number" HeaderText="Fax Number" SortExpression="Fax Number" />
<asp:BoundField DataField="Comments" HeaderText="Comments" SortExpression="Comments" />
</Fields>
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
</asp:DetailsView>
<br />
<br />
<br />
<asp:Button ID="Button2" runat="server" Text="E-Mail PO" Visible="False" OnClick="Button2_Click" />
 
 
 
</asp:Content>
 
whenever I run this, I receive the following error and am not sure how to correct it:
 
System.Data.SqlClient.SqlException: Must declare the scalar variable "@Item".
 
If someone could please explain to me the process here of what is going ion it would be greatly appreciated.  My understanding is the @item is just a variable if you will so i'm not sure why its stating i need to declare it.
 
Thank you all!
 

View 4 Replies View Related

SP To Add Fields To Table

Feb 14, 2006

I want to let a user a fields and select the data type and size from a short list. For example: nvarchar(?), Money, Int, or Bit. These are most likely the only choices for now. There will be a web page that lets them enter a field name and select a data type.
Can someone suggest how the sproc might look? Here is what I have so far.
CREATE PROCEDURE [dbo].AddCustomField ASALTER TABLE MyDataSQL.dbo.tblCustomFields ADD @FieldName @FieldDataType NULLGO
Thank you,

View 1 Replies View Related

How Do I Copy A Fields From Another Table Into A New Table?

Oct 23, 2007



I want to put fields from four tables into one table. I created a new table, but how do i get the same fields from the other tables to this table along with primary and foreign keys.


Table Fields

Tbl_Date_Dimension [Date_Dimension_Year], [Date_Dimension_Period], [Date_Dimension_Fiscal_Week]
Tbl_Report_Level Report_Level_Id
Tbl_Customer Customer_Code
[Sales Fact] [Gross Turnover] , Quantity, Consolidated_Sales_Tables_Id


The new table is called Tbl_Sales_Growth
Here's the information on the new table:






Code Block
[Date_Dimension_Year] [int] NOT NULL,
[Date_Dimension_Period] [int] NOT NULL,
[Date_Dimension_Fiscal_Week] [int] NULL,
[Report_Level_Id] [int] NOT NULL,
[Customer_code] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Consolidated_Sales_Tables_Id] [tinyint] NOT NULL,
[Quantity] [decimal](18, 0) NOT NULL,
[Gross turnover] [decimal](18, 0) NOT NULL
) ON [PRIMARY]




View 2 Replies View Related

Adding Data To More Than One Table

Jul 10, 2006

Hi there,I am currently setting up a registration system where customers can registers their details and the details of the product, using ASP.net and MS SQL.There is a column called customerID in the Custoemrs table, and a column of the same name in the Products table, so that I can have relationships between the tables.For obvious reasons (ie. people that quit half-way through), I want to hold all the information until the end. The ID in the Customer  table is unique, and auto-increasing, and therefore not assigned until the data enters the database.However, I wish to submit information to the Products table at the same time, but what shall I put in for the custoemrID (which hasn't yet been assigned)Thank you in advance for your help,Nathair

View 2 Replies View Related

Adding Photos To SQL Table

Jul 23, 2006

Hello all I am new to this site.
I am trying to use ASP.NET to build an application but I am not sure
how to add photos and other data to the sql table that I have created.

Thanks in advance.

View 2 Replies View Related

Adding Indexes To Table

Feb 18, 2007

I'm looking for information on how to add indexes to a table in a SQL Server 2000 Database, why add them etc? Any source of good information on the web regarding this?

View 6 Replies View Related







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