Showing posts with label column. Show all posts
Showing posts with label column. Show all posts

Tuesday, March 27, 2012

Cannot remove matrix column

Added a subtotal to matrix column. But really wanted subtotal below the columns. Now that subtotal column is permanent. Cannot find a way to remove it.

Nevermind, just select subtotal on context menu again and it goes away. How obvious.

Still, after reading various posts here I realize that it's not obvious at all how to put column subtotals at bottom of a matrix. let's say I have a simple matrix with one row group and one column. All I want is to have total at bottom of each data column.

Sunday, March 25, 2012

Cannot reference derived table from a derived table in a subquery?

The follow generates the error:
Server: Msg 207, Level 16, State 3, Line 19
Invalid column name 'UserID'.
The inner derived table ("dt") cannot reference the outer derived table
("ActiveUsers") ?
Nevermind the contrived example - it is only serving to illustrate the
failing. The real situation is entirely more complex.
IF OBJECT_ID('tempdb..#Users') IS NOT NULL
DROP TABLE #Users
IF OBJECT_ID('tempdb..#Logins') IS NOT NULL
DROP TABLE #Logins
CREATE TABLE #Users (
UserID int,
Name varchar(50),
IsActive tinyint)
CREATE TABLE #Logins (
UserID int,
LoginDate datetime,
WasSecured tinyint)
SELECT
ActiveUsers.*,
( SELECT MAX(LoginDate)
FROM (
SELECT * FROM #Logins
WHERE #Logins.UserID = ActiveUsers.UserID
AND #Logins.WasSecured <> 0
) dt
) AS LastSecuredLogin
FROM (
SELECT *
FROM #Users
WHERE IsActive <> 0
) ActiveUsers
DROP TABLE #Users
DROP TABLE #LoginsTry,
SELECT
ActiveUsers.*,
l.dt AS LastSecuredLogin
FROM
#Users as ActiveUsers
left join
(
SELECT
#Logins.UserID,
MAX(LoginDate) as dt
FROM
#Logins
WHERE
#Logins.WasSecured <> 0
group by
#Logins.UserID
) as l
on l.UserID = ActiveUsers.UserID
WHERE
ActiveUsers.IsActive <> 0
go
AMB
"Ian Boyd" wrote:

> The follow generates the error:
> Server: Msg 207, Level 16, State 3, Line 19
> Invalid column name 'UserID'.
> The inner derived table ("dt") cannot reference the outer derived table
> ("ActiveUsers") ?
> Nevermind the contrived example - it is only serving to illustrate the
> failing. The real situation is entirely more complex.
>
> IF OBJECT_ID('tempdb..#Users') IS NOT NULL
> DROP TABLE #Users
> IF OBJECT_ID('tempdb..#Logins') IS NOT NULL
> DROP TABLE #Logins
> CREATE TABLE #Users (
> UserID int,
> Name varchar(50),
> IsActive tinyint)
> CREATE TABLE #Logins (
> UserID int,
> LoginDate datetime,
> WasSecured tinyint)
> SELECT
> ActiveUsers.*,
> ( SELECT MAX(LoginDate)
> FROM (
> SELECT * FROM #Logins
> WHERE #Logins.UserID = ActiveUsers.UserID
> AND #Logins.WasSecured <> 0
> ) dt
> ) AS LastSecuredLogin
> FROM (
> SELECT *
> FROM #Users
> WHERE IsActive <> 0
> ) ActiveUsers
> DROP TABLE #Users
> DROP TABLE #Logins
>
>|||Right, in your correlated subquery, you have a derived table that references
something outside of the scope of the derived table. Basically you have to
think of derived tables as views. They cannot reference anything from the
current query.
Maybe I am being a bit of a thicky, but I don't see why:
( SELECT MAX(LoginDate)
FROM ( SELECT *
FROM #Logins
WHERE #Logins.UserID = ActiveUsers.UserID
AND #Logins.WasSecured <> 0 ) dt
) AS LastSecuredLogin
cannot be rewritten as:
( SELECT max(loginDate)
FROM #Logins
WHERE #Logins.UserID = ActiveUsers.UserID
AND #Logins.WasSecured <> 0
) AS LastSecuredLogin
The only reason to do what you were doing (I think) is if you were going to
do an aggregate on an aggregate. The where clause and the groupings are
exclusive of one another, so it should work. Am I missing something?
Full Query:
SELECT
ActiveUsers.*,
( SELECT max(loginDate)
FROM #Logins
WHERE #Logins.UserID = ActiveUsers.UserID
AND #Logins.WasSecured <> 0
) AS LastSecuredLogin
FROM ( SELECT *
FROM #Users
WHERE IsActive <> 0 ) as ActiveUsers
----
Louis Davidson - drsql@.hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)
"Ian Boyd" <ian.msnews010@.avatopia.com> wrote in message
news:u462TqHCFHA.3740@.TK2MSFTNGP09.phx.gbl...
> The follow generates the error:
> Server: Msg 207, Level 16, State 3, Line 19
> Invalid column name 'UserID'.
> The inner derived table ("dt") cannot reference the outer derived table
> ("ActiveUsers") ?
> Nevermind the contrived example - it is only serving to illustrate the
> failing. The real situation is entirely more complex.
>
> IF OBJECT_ID('tempdb..#Users') IS NOT NULL
> DROP TABLE #Users
> IF OBJECT_ID('tempdb..#Logins') IS NOT NULL
> DROP TABLE #Logins
> CREATE TABLE #Users (
> UserID int,
> Name varchar(50),
> IsActive tinyint)
> CREATE TABLE #Logins (
> UserID int,
> LoginDate datetime,
> WasSecured tinyint)
> SELECT
> ActiveUsers.*,
> ( SELECT MAX(LoginDate)
> FROM (
> SELECT * FROM #Logins
> WHERE #Logins.UserID = ActiveUsers.UserID
> AND #Logins.WasSecured <> 0
> ) dt
> ) AS LastSecuredLogin
> FROM (
> SELECT *
> FROM #Users
> WHERE IsActive <> 0
> ) ActiveUsers
> DROP TABLE #Users
> DROP TABLE #Logins
>
>|||> Maybe I am being a bit of a thicky, but I don't see why:
Becuase this wasn't my situation. The two tables is a contrived example -
boiled down to still cause the problem.
The "inner" derived table query's 3 tables unioned to 3 more tables.
The "outer" derived table query 3 more separate tables.|||Ah, I thought you weren't going to give us a contrived example :) I see.
Anyhow, you cannot use derived tables like that. You might look at user
defined functions if Alejandro's suggestion doesn't work. You can do a lot
of stuff in there. They work very well in the SELECT clause. Or post
your entire query and who knows, someone may have done the same thing in the
past.
----
Louis Davidson - drsql@.hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)
"Ian Boyd" <ian.msnews010@.avatopia.com> wrote in message
news:%23tnVDIICFHA.3740@.TK2MSFTNGP09.phx.gbl...
> Becuase this wasn't my situation. The two tables is a contrived example -
> boiled down to still cause the problem.
> The "inner" derived table query's 3 tables unioned to 3 more tables.
> The "outer" derived table query 3 more separate tables.
>
>|||The query has been restructured; and it eliminates the reference from one
derived table to the other.

> Or post your entire query and who knows, someone may have done the same
> thing in the past.
Absoutly not. Nobody has ever done anything like it. The query is 3 screens
long.
And i'm not going to be posting DDL, sample inserts, or explanations.
Or the query :)|||> Absoutly not. Nobody has ever done anything like it. The query is 3
> screens long.
Well, not sure how long a screen is, but I am sure you are unlikely to be
the first person to do "anything like it."

> And i'm not going to be posting DDL, sample inserts, or explanations.
> Or the query :)
Then good luck, can't help you out if we can't see what you are doing. :)
Either way, your derived table must be self contained.
----
Louis Davidson - drsql@.hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)
"Ian Boyd" <ian.msnews010@.avatopia.com> wrote in message
news:Oa3IGfICFHA.3644@.TK2MSFTNGP15.phx.gbl...
> The query has been restructured; and it eliminates the reference from one
> derived table to the other.
>
> Absoutly not. Nobody has ever done anything like it. The query is 3
> screens long.
> And i'm not going to be posting DDL, sample inserts, or explanations.
> Or the query :)
>sql

Sunday, March 11, 2012

Cannot modify data

Hi,
Sometimes when I try to modify data in enterprise manager, I get this error:
Key column information is insufficient or incorrect.
Too many rows were affected by
How can I solve this problem?
Many thanks in advance.
Leila
Hi
There are a few issue with modifying data in EM, this seems to be that the
row you are changing can not be distinguished i.e it does not have a Primary
Key. Query analyser is usually a better tool to do larger or more complex
updates.
John
"Leila" <lelas@.hotpop.com> wrote in message
news:uhjs7s6oEHA.1816@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Sometimes when I try to modify data in enterprise manager, I get this
error:
> Key column information is insufficient or incorrect.
> Too many rows were affected by
> How can I solve this problem?
> Many thanks in advance.
> Leila
>
|||I can image that if your PK has multiple columns, you might get this. So as
the previous poster suggests, change it using an update statement.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Leila" <lelas@.hotpop.com> wrote in message
news:uhjs7s6oEHA.1816@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Sometimes when I try to modify data in enterprise manager, I get this
error:
> Key column information is insufficient or incorrect.
> Too many rows were affected by
> How can I solve this problem?
> Many thanks in advance.
> Leila
>

Cannot modify data

Hi,
Sometimes when I try to modify data in enterprise manager, I get this error:
Key column information is insufficient or incorrect.
Too many rows were affected by
How can I solve this problem?
Many thanks in advance.
LeilaHi
There are a few issue with modifying data in EM, this seems to be that the
row you are changing can not be distinguished i.e it does not have a Primary
Key. Query analyser is usually a better tool to do larger or more complex
updates.
John
"Leila" <lelas@.hotpop.com> wrote in message
news:uhjs7s6oEHA.1816@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Sometimes when I try to modify data in enterprise manager, I get this
error:
> Key column information is insufficient or incorrect.
> Too many rows were affected by
> How can I solve this problem?
> Many thanks in advance.
> Leila
>|||I can image that if your PK has multiple columns, you might get this. So as
the previous poster suggests, change it using an update statement.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Leila" <lelas@.hotpop.com> wrote in message
news:uhjs7s6oEHA.1816@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Sometimes when I try to modify data in enterprise manager, I get this
error:
> Key column information is insufficient or incorrect.
> Too many rows were affected by
> How can I solve this problem?
> Many thanks in advance.
> Leila
>

Thursday, March 8, 2012

Cannot KILL SPID

I cannot Kill an SPID in SQL server 2000, what could be the problem? Sp_who shows KILLED/ROLLBACK i n cmd column. Pl helpHi,
As soon you kill a SPID , that process id will be marked for kill, but SQL
server will release the SPID only after rolling back
all the transactions it did. A long rollback will happen if you did a Batch
insert / Update / Delete.
Thanks
Hari
MCDBA
"Brijesh" <Brijesh@.discussions.microsoft.com> wrote in message
news:99556BBB-380E-484D-8818-165571942A82@.microsoft.com...
> I cannot Kill an SPID in SQL server 2000, what could be the problem?
Sp_who shows KILLED/ROLLBACK i n cmd column. Pl help|||Hi
Look at Task Manager for the process. Try END Process and see if it is
disappeared.
"Brijesh" <Brijesh@.discussions.microsoft.com> wrote in message
news:99556BBB-380E-484D-8818-165571942A82@.microsoft.com...
> I cannot Kill an SPID in SQL server 2000, what could be the problem?
Sp_who shows KILLED/ROLLBACK i n cmd column. Pl help|||What ever that SPID was doing is being rolled back... If you look at the
CPU or IO activity it is probably still chugging away.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23qITre7dEHA.1048@.tk2msftngp13.phx.gbl...
> Hi
> Look at Task Manager for the process. Try END Process and see if it is
> disappeared.
>
> "Brijesh" <Brijesh@.discussions.microsoft.com> wrote in message
> news:99556BBB-380E-484D-8818-165571942A82@.microsoft.com...
> > I cannot Kill an SPID in SQL server 2000, what could be the problem?
> Sp_who shows KILLED/ROLLBACK i n cmd column. Pl help
>

Cannot KILL SPID

I cannot Kill an SPID in SQL server 2000, what could be the problem? Sp_who shows KILLED/ROLLBACK i n cmd column. Pl help
Hi,
As soon you kill a SPID , that process id will be marked for kill, but SQL
server will release the SPID only after rolling back
all the transactions it did. A long rollback will happen if you did a Batch
insert / Update / Delete.
Thanks
Hari
MCDBA
"Brijesh" <Brijesh@.discussions.microsoft.com> wrote in message
news:99556BBB-380E-484D-8818-165571942A82@.microsoft.com...
> I cannot Kill an SPID in SQL server 2000, what could be the problem?
Sp_who shows KILLED/ROLLBACK i n cmd column. Pl help
|||Hi
Look at Task Manager for the process. Try END Process and see if it is
disappeared.
"Brijesh" <Brijesh@.discussions.microsoft.com> wrote in message
news:99556BBB-380E-484D-8818-165571942A82@.microsoft.com...
> I cannot Kill an SPID in SQL server 2000, what could be the problem?
Sp_who shows KILLED/ROLLBACK i n cmd column. Pl help
|||What ever that SPID was doing is being rolled back... If you look at the
CPU or IO activity it is probably still chugging away.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23qITre7dEHA.1048@.tk2msftngp13.phx.gbl...
> Hi
> Look at Task Manager for the process. Try END Process and see if it is
> disappeared.
>
> "Brijesh" <Brijesh@.discussions.microsoft.com> wrote in message
> news:99556BBB-380E-484D-8818-165571942A82@.microsoft.com...
> Sp_who shows KILLED/ROLLBACK i n cmd column. Pl help
>

Cannot KILL SPID

I cannot Kill an SPID in SQL server 2000, what could be the problem? Sp_who
shows KILLED/ROLLBACK i n cmd column. Pl helpHi,
As soon you kill a SPID , that process id will be marked for kill, but SQL
server will release the SPID only after rolling back
all the transactions it did. A long rollback will happen if you did a Batch
insert / Update / Delete.
Thanks
Hari
MCDBA
"Brijesh" <Brijesh@.discussions.microsoft.com> wrote in message
news:99556BBB-380E-484D-8818-165571942A82@.microsoft.com...
> I cannot Kill an SPID in SQL server 2000, what could be the problem?
Sp_who shows KILLED/ROLLBACK i n cmd column. Pl help|||Hi
Look at Task Manager for the process. Try END Process and see if it is
disappeared.
"Brijesh" <Brijesh@.discussions.microsoft.com> wrote in message
news:99556BBB-380E-484D-8818-165571942A82@.microsoft.com...
> I cannot Kill an SPID in SQL server 2000, what could be the problem?
Sp_who shows KILLED/ROLLBACK i n cmd column. Pl help|||What ever that SPID was doing is being rolled back... If you look at the
CPU or IO activity it is probably still chugging away.
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23qITre7dEHA.1048@.tk2msftngp13.phx.gbl...
> Hi
> Look at Task Manager for the process. Try END Process and see if it is
> disappeared.
>
> "Brijesh" <Brijesh@.discussions.microsoft.com> wrote in message
> news:99556BBB-380E-484D-8818-165571942A82@.microsoft.com...
> Sp_who shows KILLED/ROLLBACK i n cmd column. Pl help
>

Friday, February 24, 2012

Cannot insert the value NULL into column...

I am trying to create a drop?down?list?with?the?possible?usernames?that?you?can?send?an?email?to.??Everything?works?fine?except?for?the?dropdown?list?and?I?get?the?following?error?message:
Cannot insert the value NULL into column 'EmailTo', table 'db191165913.dbo191165913.Email'; column does not allow nulls. INSERT fails.
The statement has been terminated

My code is below:

<%@. Page Language="VB" MasterPageFile="~/real_world/realworld_MasterPage.master" AutoEventWireup="false" CodeFile="send_messages.aspx.vb" Inherits="send_messages" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Label ID="email_label" runat="server" Visible="False"></asp:Label>
<asp:SqlDataSource ID="emailsend_source" runat="server" ConnectionString="<%$ ConnectionStrings:IMS_DB %>"
DeleteCommand="DELETE FROMEmail WHERE [EmailID] = @.EmailID"
InsertCommand="INSERT INTOEmail ([UserID], [EmailTo], [EmailFrom], [Subject], [Message], [Status], [Reply], [Forward], [UserName], [SentOn], [IP], [BrowserInfo], [DNSInfo]) VALUES (@.UserID, @.EmailTo, @.EmailFrom, @.Subject, @.Message, '@.Status', '@.Reply', '@.Forward', @.UserName, @.SentOn, @.IP, @.BrowserInfo, @.DNSInfo)"
SelectCommand="SELECT * FROMEmail WHERE ([UserID] = @.UserID)"
UpdateCommand="UPDATEEmail SET [UserID] = @.UserID, [EmailTo] = @.EmailTo, [EmailFrom] = @.EmailFrom, [Subject] = @.Subject, [Message] = @.Message, [Status] = @.Status, [Reply] = @.Reply, [Forward] = @.Forward, [UserName] = @.UserName, [BrowserInfo] = @.BrowserInfo, [DNSInfo] = @.DNSInfo WHERE [EmailID] = @.EmailID">
<DeleteParameters>
<asp:Parameter Name="EmailID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="UserID" />
<asp:Parameter Name="EmailTo" Type="String" />
<asp:Parameter Name="EmailFrom" Type="String" />
<asp:Parameter Name="Subject" Type="String" />
<asp:Parameter Name="Message" Type="String" />
<asp:Parameter Name="Status" Type="String" />
<asp:Parameter Name="Reply" Type="String" />
<asp:Parameter Name="Forward" Type="String" />
<asp:Parameter Name="UserName" Type="String" />
<asp:Parameter Name="BrowserInfo" Type="String" />
</UpdateParameters>
<SelectParameters>
<asp:ControlParameter ControlID="email_label" Name="UserID" PropertyName="Text" />
</SelectParameters>
<InsertParameters>
<asp:Parameter Name="UserID" />
<asp:Parameter Name="EmailTo" Type="String" />
<asp:Parameter Name="EmailFrom" Type="String" />
<asp:Parameter Name="Subject" Type="String" />
<asp:Parameter Name="Message" Type="String" />
<asp:Parameter Name="Status" Type="String" />
<asp:Parameter Name="Reply" Type="String" />
<asp:Parameter Name="Forward" Type="String" />
<asp:Parameter Name="UserName" Type="String" />
<asp:Parameter Name="IP" Type="String" />
<asp:Parameter Name="SentOn" Type="datetime" />
<asp:Parameter Name="BrowserInfo" Type="String" />
<asp:Parameter Name="DNSInfo" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="username_email" runat="server" ConnectionString="<%$ ConnectionStrings:IMS_DB %>"
SelectCommand="SELECT [UserName] FROM [Membership] ORDER BY [UserName]">
</asp:SqlDataSource>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="You must fill out the following forms:"
ValidationGroup="email_send" />

<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="EmailID"
DataSourceID="emailsend_source" DefaultMode="Insert" GridLines="None" Height="50px"
Width="125px">
<Fields>
<asp:BoundField DataField="EmailID" HeaderText="EmailID" InsertVisible="False" ReadOnly="True"
SortExpression="EmailID" />
<asp:TemplateField HeaderText="To" SortExpression="EmailTo">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("EmailTo") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="emailsend_source" DataTextField="UserName" SelectedValue='<%# Bind("UserName") %>' AppendDataBoundItems="True" DataValueField="UserName">
<asp:ListItem>-- Receiving User --</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DropDownList1"
Display="Dynamic" ErrorMessage="Message Receiver (To)" ValidationGroup="email_send"></asp:RequiredFieldValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("EmailTo") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="From" SortExpression="EmailFrom">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("EmailFrom") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:LoginName ID="login_name" runat="server" />
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("EmailFrom") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Subject" SortExpression="Subject">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Subject") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" MaxLength="50" Text='<%# Bind("Subject") %>'
ValidationGroup="send_email"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TextBox3"
Display="Dynamic" ErrorMessage="Subject" ValidationGroup="email_send"></asp:RequiredFieldValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("Subject") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Message" SortExpression="Message">
<EditItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Message") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox4" runat="server" Columns="40" MaxLength="500" Rows="10"
Text='<%# Bind("Message") %>' TextMode="MultiLine" ValidationGroup="send_mail"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="TextBox4"
Display="Dynamic" ErrorMessage="Message" ValidationGroup="email_send"></asp:RequiredFieldValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("Message") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField InsertText="Send Message" ShowInsertButton="True" ValidationGroup="email_send" />
</Fields>
</asp:DetailsView>
</asp:Content

What about changing the EmaiTto Parameter to a ControlParameter:

<InsertParameters>
<asp:Parameter Name="UserID" />
<asp:Parameter Name="EmailTo" Type="String" />

<asp:ControlParameter ControlID="DetailsView1$DropDownList1" Name="EmailTo" PropertyName="SelectedValue" />

.....

|||Thanks for helping me solve that problem! ?Do you happen to know the answer to my other question at http://forums.asp.net/thread/1699355.aspx

Cannot insert the value NULL into column 'rowguid'....

Hello
i'm using merge replication in SQL server 2k but when i try to synchronise a
subscriber i get the following error
Cannot insert the value NULL into column 'rowguid'...
This seems to be caused by the fact that the columns are in a different
order
ie. columns we added after the publication
is there a way to cause the publication to name the fields in the insert
therefore eliminating this problem?
Thanks
How did you add the columns after the table was published?
Donna
"kris Palmby" wrote:

> Hello
> i'm using merge replication in SQL server 2k but when i try to synchronise a
> subscriber i get the following error
> Cannot insert the value NULL into column 'rowguid'...
> This seems to be caused by the fact that the columns are in a different
> order
> ie. columns we added after the publication
> is there a way to cause the publication to name the fields in the insert
> therefore eliminating this problem?
> Thanks
>
>
|||I'd like to know this also.
"Donna Lambert" <DonnaLambert@.discussions.microsoft.com> wrote in message
news:E4388B76-FBB2-4F00-8893-1F3F0ACEFB31@.microsoft.com...[vbcol=seagreen]
> How did you add the columns after the table was published?
> Donna
> "kris Palmby" wrote:

Cannot insert the value NULL into column OrderID -- BUT IT IS NOT NULL!

I am getting this error: "Cannot insert the value NULL into column 'OrderID', table 'outman.outman.Contact'; column does not allow nulls. INSERT fails." --But my value is not null. I did a response.write on it and it show the value. Of course, it would be nice if I could do a breakpoint but that doesn't seem to be working. I'll attach a couple of images below of my code, the error, and the breakpoint error.

Server Error in '/' Application.

Cannot insert the value NULL into column 'OrderID', table 'outman.outman.Contact'; column does not allow nulls. INSERT fails.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'OrderID', table 'outman.outman.Contact'; column does not allow nulls. INSERT fails.

Source Error:

Line 89: sContact.Phone = sPhone.Text.TrimLine 90: sContact.Email = sEmail.Text.TrimLine 91: sContact.Save()Line 92: Line 93: Dim bContact As Contact = New Contact()


Source File:F:\Inetpub\wwwroot\Outman Knife\Checkout.aspx.vb Line:91

Stack Trace:

[SqlException (0x80131904): Cannot insert the value NULL into column 'OrderID', table 'outman.outman.Contact'; column does not allow nulls. INSERT fails.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857354 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734966 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838 System.Data.SqlClient.SqlDataReader.HasMoreRows() +150 System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout) +214 System.Data.SqlClient.SqlDataReader.Read() +9 System.Data.SqlClient.SqlCommand.CompleteExecuteScalar(SqlDataReader ds, Boolean returnSqlValue) +39 System.Data.SqlClient.SqlCommand.ExecuteScalar() +148 SubSonic.SqlDataProvider.ExecuteScalar(QueryCommand qry) +209 SubSonic.DataService.ExecuteScalar(QueryCommand cmd) +37 SubSonic.ActiveRecord`1.Save(String userName) +120 SubSonic.ActiveRecord`1.Save() +31 Checkout.btnCheckout_Click(Object sender, EventArgs e) in F:\Inetpub\wwwroot\Outman Knife\Checkout.aspx.vb:91 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102



Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

Please post the code of the Save method of your Contact class, the stored procedure that it calls and the table definition.|||

I am using SubSonic, so I am not sure how I would do this. Here is the entire Contact class:

1Imports System2Imports System.Text3Imports System.Data4Imports System.Data.SqlClient5Imports System.Data.Common6Imports System.Collections7Imports System.Collections.Generic8Imports System.Configuration9Imports System.Xml10Imports System.Xml.Serialization11Imports SubSonic12131415''' <summary>16''' Strongly-typed collection for the Contact class.17''' </summary>18<Serializable> _19Public PartialClass ContactCollection20Inherits ActiveList(Of Contact)2122Private wheresAs List(Of Where) =New List(Of Where)()23Private betweensAs List(Of BetweenAnd) =New List(Of BetweenAnd)()24Private orderByAs SubSonic.OrderBy25Public Function OrderByAsc(ByVal columnNameAs String)As ContactCollection26Me.orderBy = SubSonic.OrderBy.Asc(columnName)27Return Me28 End Function29 Public Function OrderByDesc(ByVal columnNameAs String)As ContactCollection30Me.orderBy = SubSonic.OrderBy.Desc(columnName)31Return Me32 End Function33 Public Function WhereDatesBetween(ByVal columnNameAs String,ByVal dateStartAs DateTime,ByVal dateEndAs DateTime)As ContactCollection34Return Me3536 End Function3738 Public Function Where(ByVal where_RenamedAs Where)As ContactCollection39 wheres.Add(where_Renamed)40Return Me41 End Function42 Public Function Where(ByVal columnNameAs String,ByVal valueAs Object)As ContactCollection43Dim where_RenamedAs Where =New Where()44 where_Renamed.ColumnName = columnName45 where_Renamed.ParameterValue = value46Me.Where(where_Renamed)47Return Me48 End Function49 Public Function Where(ByVal columnNameAs String,ByVal compAs Comparison,ByVal valueAs Object)As ContactCollection50Dim where_RenamedAs Where =New Where()51 where_Renamed.ColumnName = columnName52 where_Renamed.Comparison = comp53 where_Renamed.ParameterValue = value54Me.Where(where_Renamed)55Return Me5657 End Function58 Public Function BetweenAnd(ByVal columnNameAs String,ByVal dateStartAs DateTime,ByVal dateEndAs DateTime)As ContactCollection59Dim betweenAs BetweenAnd =New BetweenAnd()60 between.ColumnName = columnName61 between.StartDate = dateStart62 between.EndDate = dateEnd63 betweens.Add(between)64Return Me65 End Function66 Public Overloads Function Load()As ContactCollection6768Dim qryAs Query =New Query("Contact")69For Each whereAs WhereIn wheres70 qry.AddWhere(where)71Next72 For Each betweenAs BetweenAndIn betweens73 qry.AddBetweenAnd(between)74Next7576 If Not orderByIs Nothing Then77 qry.OrderBy = orderBy78End If7980 Dim rdrAs IDataReader = qry.ExecuteReader()81Me.Load(rdr)82 rdr.Close()8384Return Me85 End Function8687Public Overloads Function Load(ByVal qryAs Query)As ContactCollection8889Dim rdrAs IDataReader = qry.ExecuteReader()90Me.Load(rdr)91 rdr.Close()9293Return Me94 End Function9596 Public Sub New()979899End Sub100101End Class102103''' <summary>104''' This is an ActiveRecord class which wraps the Contact table.105''' </summary>106<Serializable> _107Public PartialClass Contact108Inherits ActiveRecord(Of Contact)109110#Region"Default Settings"111Private Sub SetSQLProps()112If SchemaIs Nothing Then113 Schema = Query.BuildTableSchema("Contact")114End If115 End Sub116 #End Region117118 #Region"Schema Accessor"119Public Shared Function GetTableSchema()As TableSchema.Table120Dim itemAs Contact =New Contact()121Return Contact.Schema122End Function123 #End Region124125 #Region"Query Accessor"126Public Shared Function CreateQuery()As Query127Return New Query("Contact")128End Function129 #End Region130131 #Region".ctors"132Public Sub New()133 SetSQLProps()134 SetDefaults()135Me.MarkNew()136End Sub137138 Public Sub New(ByVal keyIDAs Object)139 SetSQLProps()140MyBase.LoadByKey(keyID)141End Sub142143 Public Sub New(ByVal columnNameAs String,ByVal columnValueAs Object)144 SetSQLProps()145MyBase.LoadByParam(columnName,columnValue)146End Sub147 #End Region148149 #Region"Public Properties"150 <XmlAttribute("OrderID")> _151Public Property OrderIDAs Guid152Get153 Dim resultAs Object =Me.GetColumnValue("OrderID")154Dim oOutAs Guid=Guid.Empty155Try156oOut=New Guid(result.ToString())157Catch158End Try159 Return oOut160161End Get162 Set163 Me.MarkDirty()164Me.SetColumnValue("OrderID", Value)165End Set166 End Property167 <XmlAttribute("Type")> _168Public Property TypeAs String169 Get170 Dim resultAs Object =Me.GetColumnValue("Type")171Dim sOutAs String172 If resultIs Nothing Then : sOut =String.Empty173Else : sOut = result.ToString()174End If175 Return sOut176177End Get178 Set179 Me.MarkDirty()180Me.SetColumnValue("Type", Value)181End Set182 End Property183 <XmlAttribute("LastName")> _184Public Property LastNameAs String185 Get186 Dim resultAs Object =Me.GetColumnValue("LastName")187Dim sOutAs String188 If resultIs Nothing Then : sOut =String.Empty189Else : sOut = result.ToString()190End If191 Return sOut192193End Get194 Set195 Me.MarkDirty()196Me.SetColumnValue("LastName", Value)197End Set198 End Property199 <XmlAttribute("FirstName")> _200Public Property FirstNameAs String201 Get202 Dim resultAs Object =Me.GetColumnValue("FirstName")203Dim sOutAs String204 If resultIs Nothing Then : sOut =String.Empty205Else : sOut = result.ToString()206End If207 Return sOut208209End Get210 Set211 Me.MarkDirty()212Me.SetColumnValue("FirstName", Value)213End Set214 End Property215 <XmlAttribute("Company")> _216Public Property CompanyAs String217 Get218 Dim resultAs Object =Me.GetColumnValue("Company")219Dim sOutAs String220 If resultIs Nothing Then : sOut =String.Empty221Else : sOut = result.ToString()222End If223 Return sOut224225End Get226 Set227 Me.MarkDirty()228Me.SetColumnValue("Company", Value)229End Set230 End Property231 <XmlAttribute("Address")> _232Public Property AddressAs String233 Get234 Dim resultAs Object =Me.GetColumnValue("Address")235Dim sOutAs String236 If resultIs Nothing Then : sOut =String.Empty237Else : sOut = result.ToString()238End If239 Return sOut240241End Get242 Set243 Me.MarkDirty()244Me.SetColumnValue("Address", Value)245End Set246 End Property247 <XmlAttribute("City")> _248Public Property CityAs String249 Get250 Dim resultAs Object =Me.GetColumnValue("City")251Dim sOutAs String252 If resultIs Nothing Then : sOut =String.Empty253Else : sOut = result.ToString()254End If255 Return sOut256257End Get258 Set259 Me.MarkDirty()260Me.SetColumnValue("City", Value)261End Set262 End Property263 <XmlAttribute("StateID")> _264Public Property StateIDAs Integer265 Get266 Dim resultAs Object =Me.GetColumnValue("StateID")267Dim oOutAs Integer = 0268Try269oOut =Integer.Parse(result.ToString())270Catch271End Try272 Return oOut273274End Get275 Set276 Me.MarkDirty()277Me.SetColumnValue("StateID", Value)278End Set279 End Property280 <XmlAttribute("ZipCode")> _281Public Property ZipCodeAs Integer282 Get283 Dim resultAs Object =Me.GetColumnValue("ZipCode")284Dim oOutAs Integer = 0285Try286oOut =Integer.Parse(result.ToString())287Catch288End Try289 Return oOut290291End Get292 Set293 Me.MarkDirty()294Me.SetColumnValue("ZipCode", Value)295End Set296 End Property297 <XmlAttribute("Phone")> _298Public Property PhoneAs String299 Get300 Dim resultAs Object =Me.GetColumnValue("Phone")301Dim sOutAs String302 If resultIs Nothing Then : sOut =String.Empty303Else : sOut = result.ToString()304End If305 Return sOut306307End Get308 Set309 Me.MarkDirty()310Me.SetColumnValue("Phone", Value)311End Set312 End Property313 <XmlAttribute("Email")> _314Public Property EmailAs String315 Get316 Dim resultAs Object =Me.GetColumnValue("Email")317Dim sOutAs String318 If resultIs Nothing Then : sOut =String.Empty319Else : sOut = result.ToString()320End If321 Return sOut322323End Get324 Set325 Me.MarkDirty()326Me.SetColumnValue("Email", Value)327End Set328 End Property329330 #End Region331332 #Region"ObjectDataSource support"333''' <summary>334 ''' Inserts a record, can be used with the ObjectDataSource335 ''' </summary>336Public Shared Sub Insert(ByVal OrderIDAs Guid,ByVal TypeAs String,ByVal LastNameAs String,ByVal FirstNameAs String,ByVal CompanyAs String,ByVal AddressAs String,ByVal CityAs String,ByVal StateIDAs Integer,ByVal ZipCodeAs Integer,ByVal PhoneAs String,ByVal EmailAs String)337Dim itemAs Contact =New Contact()338 item.OrderID = OrderID339item.Type = Type340item.LastName = LastName341item.FirstName = FirstName342item.Company = Company343item.Address = Address344item.City = City345item.StateID = StateID346item.ZipCode = ZipCode347item.Phone = Phone348item.Email = Email349350 item.Save(System.Web.HttpContext.Current.User.Identity.Name)351End Sub352353''' <summary>354 ''' Updates a record, can be used with the ObjectDataSource355 ''' </summary>356Public Shared Sub Update(ByVal OrderIDAs Guid,ByVal TypeAs String,ByVal LastNameAs String,ByVal FirstNameAs String,ByVal CompanyAs String,ByVal AddressAs String,ByVal CityAs String,ByVal StateIDAs Integer,ByVal ZipCodeAs Integer,ByVal PhoneAs String,ByVal EmailAs String)357Dim itemAs Contact =New Contact()358 item.OrderID = OrderID359item.Type = Type360item.LastName = LastName361item.FirstName = FirstName362item.Company = Company363item.Address = Address364item.City = City365item.StateID = StateID366item.ZipCode = ZipCode367item.Phone = Phone368item.Email = Email369370 item.IsNew =False371 item.Save(System.Web.HttpContext.Current.User.Identity.Name)372End Sub373374 #End Region375376 #Region"Columns Struct"377Public Structure Columns378Public Shared OrderIDAs String379Public Shared TypeAs String380Public Shared LastNameAs String381Public Shared FirstNameAs String382Public Shared CompanyAs String383Public Shared AddressAs String384Public Shared CityAs String385Public Shared StateIDAs String386Public Shared ZipCodeAs String387Public Shared PhoneAs String388Public Shared EmailAs String389Private xAs Integer390391392 Shared Sub New()393 OrderID ="OrderID"394Type ="Type"395LastName ="LastName"396FirstName ="FirstName"397Company ="Company"398Address ="Address"399City ="City"400StateID ="StateID"401ZipCode ="ZipCode"402Phone ="Phone"403Email ="Email"404405End Sub406 End Structure407 #End Region408409End Class410411
|||It looks like the save method is down yet another level. Search on item.Save in the class you just posted, highlight where the Save, right-click and goto to the definition. I need to see the save and the stored procedure it calls.|||

Hopefully this has what you are looking for:

1using System;2using System.Data;3using SubSonic.Utilities;4using System.Text;5namespace SubSonic6{78public abstract class ActiveRecord : AbstractRecord where T : AbstractRecord,new()9 {10public ActiveRecord()11 {12 MarkNew();13 }1415#region CommandMethods1617/// <summary>18 /// Made Public for use with transactions19 /// </summary>20 /// <param name="userName"></param>21 /// <returns></returns>22public QueryCommand GetInsertCommand(string userName)23 {24 Query q =new Query(table);25 q.QueryType = QueryType.Insert;26 QueryCommand cmd =new QueryCommand(DataService.GetSql(q));2728//loop the Columns and addin the params2930foreach (TableSchema.TableColumn columnin table.Columns)31 {32if (!column.AutoIncrement)33 {34object oVal;35if (Utility.IsMatch(column.ColumnName, ReservedColumnName.CREATED_BY) || Utility.IsMatch(column.ColumnName, ReservedColumnName.MODIFIED_BY))36 {37 oVal = userName;38 }39else if (Utility.IsMatch(column.ColumnName, ReservedColumnName.CREATED_ON) || Utility.IsMatch(column.ColumnName, ReservedColumnName.MODIFIED_ON))40 {41 oVal = DateTime.Now;42 }43else44 {45 oVal = GetColumnValue(column.ColumnName);4647//if the value is a boolean, it can be read improperly48 //reset to 0 or 149if (oVal !=null)50 {51if (Utility.IsMatch(oVal.ToString(),"false"))52 {53 oVal = 0;54 }55else if (Utility.IsMatch(oVal.ToString(),"true"))56 {57 oVal = 1;58 }59 }60 }61if (oVal ==null)62 {63 oVal = DBNull.Value;64 }65 cmd.Parameters.Add("@." + column.ColumnName, oVal, column.DataType);66 }67 }68return cmd;69 }7071public QueryCommand GetUpdateCommand(string userName)72 {73 Query q =new Query(table);74 q.QueryType = QueryType.Update;75 QueryCommand cmd =new QueryCommand(DataService.GetSql(q));7677//loop the Columns and addin the params78foreach (TableSchema.TableColumn columnin table.Columns)79 {80object oVal;81if (Utility.IsMatch(column.ColumnName, ReservedColumnName.MODIFIED_BY))82 {83 oVal = userName;84 }85else if (Utility.IsMatch(column.ColumnName, ReservedColumnName.MODIFIED_ON))86 {87 oVal = DateTime.Now;88 }89else90 {91 oVal = GetColumnValue(column.ColumnName);92 }93if (oVal ==null)94 {95 oVal = DBNull.Value;96 }97 cmd.Parameters.Add("@." + column.ColumnName, oVal,column.DataType);98 }99return cmd;100 }101102public static QueryCommand GetDeleteCommand(object keyID)103 {104 Query q =new Query(table);105 q.QueryType = QueryType.Delete;106 q.AddWhere(table.PrimaryKey.ColumnName, keyID);107108return DataService.BuildCommand(q);109 }110111public static QueryCommand GetDeleteCommand(string columnName,object oValue)112 {113 Query q =new Query(table);114 q.QueryType = QueryType.Delete;115 q.AddWhere(columnName, oValue);116117return DataService.BuildCommand(q);118 }119120#endregion121122123 #region Persistence124125protected virtual void PreUpdate()126 {127 }128129protected virtual void PostUpdate()130 {131 }132133/// <summary>134 /// Saves this object's state to the selected Database.135 /// </summary>136public void Save()137 {138 Save(String.Empty);139 }140141/// <summary>142 /// Saves this object's state to the selected Database.143 /// </summary>144 /// <param name="userID"></param>145public void Save(int userID)146 {147 Save(userID.ToString());148 }149150/// <summary>151 /// Saves this object's state to the selected Database.152 /// </summary>153 /// <param name="userID"></param>154public void Save(Guid userID)155 {156string sUserID =string.Empty;157if (userID!=null)158 sUserID = userID.ToString();159160 Save(sUserID);161 }162163/// <summary>164 /// Saves this object's state to the selected Database.165 /// </summary>166 /// <param name="userName"></param>167public void Save(string userName)168 {169 PreUpdate();170171 QueryCommand cmd;172if (IsNew)173 {174 cmd = GetInsertCommand(userName);175 }176else177 {178 cmd = GetUpdateCommand(userName);179 }180181//reset the Primary Key with the id passed back by the operation182object pkVal = DataService.ExecuteScalar(cmd);183184//set the primaryKey, only if an auto-increment185 //if (table.PrimaryKey.AutoIncrement)186 // HACK: GUID fix187if (table.PrimaryKey.AutoIncrement || table.PrimaryKey.DataType == DbType.Guid)188 {189try {190 SetPrimaryKey(pkVal);191 }catch {192193//this will happen if there is no PK defined on a table. Catch this and notify194throw new Exception("No Primary Key is defined for this table. A primary key is required to use SubSonic");195 }196 }197198//set this object as old199 MarkOld();200 isDirty =false;201 PostUpdate();202203 }204205/// <summary>206 /// If the record contains Deleted or IsDeleted flag columns, sets them to true. If not, invokes Destroy()207 /// </summary>208 /// <returns>Number of rows affected by the operation</returns>209public static int Delete(object keyID)210 {211return DeleteByParameter(BaseSchema.PrimaryKey.ColumnName, keyID,null);212 }213214/// <summary>215 /// If the record contains Deleted or IsDeleted flag columns, sets them to true. If not, invokes Destroy()216 /// </summary>217 /// <param name="columnName">The name of the column that whose value will be evaluated for deletion</param>218 /// <param name="oValue">The value that will be compared against columnName to determine deletion</param>219 /// <returns>Number of rows affected by the operation</returns>220public static int Delete(string columnName,object oValue)221 {222return DeleteByParameter(columnName, oValue,null);223 }224225/// <summary>226 /// If the record contains Deleted or IsDeleted flag columns, sets them to true. If not, invokes Destroy()227 /// </summary>228 /// <param name="columnName">The name of the column that whose value will be evaluated for deletion</param>229 /// <param name="oValue">The value that will be compared against columnName to determine deletion</param>230 /// <param name="userName">The userName that the record will be updated with. Only relevant if the record contains Deleted or IsDeleted properties</param>231 /// <returns>Number of rows affected by the operation</returns>232public static int Delete(string columnName,object oValue,string userName)233 {234return DeleteByParameter(columnName, oValue, userName);235 }236237/// <summary>238 /// If the record contains Deleted or IsDeleted flag columns, sets them to true. If not, invokes Destroy()239 /// </summary>240 /// <param name="columnName">The name of the column that whose value will be evaluated for deletion</param>241 /// <param name="oValue">The value that will be compared against columnName to determine deletion</param>242 /// <param name="userName">The userName that the record will be updated with. Only relevant if the record contains Deleted or IsDeleted properties</param>243 /// <returns>Number of rows affected by the operation</returns>244private static int DeleteByParameter(string columnName,object oValue,string userName)245 {246int iOut = 0;247248bool containsDeleted = BaseSchema.Columns.Contains(ReservedColumnName.DELETED);249bool containsIsDeleted = BaseSchema.Columns.Contains(ReservedColumnName.IS_DELETED);250bool containsModifiedBy = BaseSchema.Columns.Contains(ReservedColumnName.MODIFIED_BY);251bool containsModifiedOn = BaseSchema.Columns.Contains(ReservedColumnName.MODIFIED_ON);252if (containsDeleted || containsIsDeleted)253 {254//update the column and set deleted=true;255 //new T();256 Query qry =new Query(BaseSchema);257if (containsDeleted)258 {259 qry.AddUpdateSetting(ReservedColumnName.DELETED,true);260 }261262if (containsIsDeleted)263 {264 qry.AddUpdateSetting(ReservedColumnName.IS_DELETED,true);265 }266267if (containsModifiedBy && !String.IsNullOrEmpty(userName))268 {269 qry.AddUpdateSetting(ReservedColumnName.MODIFIED_BY, userName);270 }271272if (containsModifiedOn)273 {274 qry.AddUpdateSetting(ReservedColumnName.MODIFIED_ON, DateTime.Now);275 }276 qry.AddWhere(columnName, oValue);277 qry.Execute();278 }279else280 {281 iOut = DestroyByParameter(columnName, oValue);282 }283return iOut;284 }285286/// <summary>287 /// Deletes the record in the table, even if it contains Deleted or IsDeleted flag columns288 /// </summary>289 /// <returns>Number of rows affected by the operation</returns>290public static int Destroy(object keyID)291 {292return DestroyByParameter(BaseSchema.PrimaryKey.ColumnName, keyID);293 }294295/// <summary>296 /// Deletes the record in the table, even if it contains Deleted or IsDeleted flag columns297 /// </summary>298 /// <param name="columnName">The name of the column that whose value will be evaluated for deletion</param>299 /// <param name="oValue">The value that will be compared against columnName to determine deletion</param>300 /// <returns>Number of rows affected by the operation</returns>301public static int Destroy(string columnName,object oValue)302 {303return DestroyByParameter(columnName, oValue);304 }305306/// <summary>307 /// Deletes the record in the table, even if it contains Deleted or IsDeleted flag columns308 /// </summary>309 /// <param name="columnName">The name of the column that whose value will be evaluated for deletion</param>310 /// <param name="oValue">The value that will be compared against columnName to determine deletion</param>311 /// <returns>Number of rows affected by the operation</returns>312private static int DestroyByParameter(string columnName,object oValue)313 {314 QueryCommand cmd = GetDeleteCommand(columnName, oValue);315return DataService.ExecuteQuery(cmd);316 }317318#endregion319320 #region Object Overrides321//public string Inspect() {322 // return Inspect(true);323 //}324 //public string Inspect(bool useHtml) {325 // System.Text.StringBuilder sb = new StringBuilder();326 // string sOut = "";327 // if (useHtml) {328 // sb.Append("<table><tr><td colspan=2><h3>" + this.TableName + " Inspection</h3></td></tr>");329330 // foreach (TableSchema.TableColumn col in table.Columns) {331 // sb.Append("<tr><td><b>" + col.ColumnName + "</b></td><td>" + this.GetColumnValue(col.ColumnName).ToString() + "</td></tr>");332333 // }334 // sb.Append("</table>");335 // sOut = sb.ToString();336 // } else {337 // sb.Append("#################" + this.TableName + " Inspection ####################\r\n");338339 // foreach (TableSchema.TableColumn col in table.Columns) {340 // sb.Append(col.ColumnName + ": " + this.GetColumnValue(col.ColumnName).ToString() + "\r\n");341342 // }343 // sb.Append("#############################################################################\r\n");344 // sOut = sb.ToString();345346 // }347 // return sOut;348 //}349#endregion350 }351}
|||

Hello,

problem seems to me is OrderID, as trace said.

is Save function destroy all properties(including orderid) of the Object? (i don't see on above code, but suspicious)

try to this ??

first create a new guid:

dim orderID as guid = new system.guid.newguid()

for others create new guid from orderID, each may need to have new guid with same value

obj.OrderID = new guid(orderID.tobytearray)

Not sure, but try it. (debug: and see if OrderID value stays after Save function call)

|||

Same thing. And here is my updated code:

Protected Sub btnCheckout_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles btnCheckout.ClickDim CartIDAs Integer = Session("CartID")Dim OrderIDAs Guid = System.Guid.NewGuid()Dim cOrderAs OnlineOrder =New OnlineOrder cOrder.OrderID =New Guid(OrderID.ToByteArray) cOrder.CartID = CartID cOrder.Status ="PEND" cOrder.PromoCode ="NONE" cOrder.Timestamp =Date.Now cOrder.CardTypeID = ddCardType.SelectedValue cOrder.CardNumber = Outman.Utility.QuickEncrypt(CardNumber.Text.Trim) cOrder.CardExp = ExpirationDate.Text cOrder.CardVerification = Outman.Utility.QuickEncrypt(CardVerification.Text) cOrder.Save()Dim sContactAs Contact =New Contact() sContact.OrderID =New Guid(OrderID.ToByteArray) sContact.Type ="SHIP" sContact.FirstName = sFirstName.Text.Trim sContact.LastName = sLastName.Text.Trim sContact.Company = sCompany.Text.Trim sContact.Address = sAddress.Text.Trim sContact.City = sCity.Text.Trim sContact.StateID = sState.SelectedValue sContact.ZipCode = sZipCode.Text.Trim sContact.Phone = sPhone.Text.Trim sContact.Email = sEmail.Text.Trim sContact.Save()Dim bContactAs Contact =New Contact() bContact.OrderID =New Guid(OrderID.ToByteArray) bContact.Type ="BILL" bContact.FirstName = bFirstName.Text.Trim bContact.LastName = bLastName.Text.Trim bContact.Company = bCompany.Text.Trim bContact.Address = bAddress.Text.Trim bContact.City = bCity.Text.Trim bContact.StateID = bState.SelectedValue bContact.ZipCode = bZipCode.Text.Trim bContact.Phone = bPhone.Text.Trim bContact.Email = bEmail.Text.Trim bContact.Save()Dim cCartAs Cart =New Cart(CartID) cCart.Status ="PEND" cCart.Save() Session.Add("CartID", Outman.ShoppingCart.Create) CartDisplay.Visible =False CheckoutComplete.Visible =True End Sub

|||

Hello,

what/where is the function GetColumnValue, SetColumnValue ?

Public Property OrderIDAs Guid
152 Get
153 Dim resultAs Object =Me.GetColumnValue("OrderID")
154 Dim oOutAs Guid=Guid.Empty155 Try
156 oOut=New Guid(result.ToString())
157 Catch
158 End Try
159 Return oOut
160
161 End Get
162 Set
163 Me.MarkDirty()
164 Me.SetColumnValue("OrderID", Value)
165 End Set
166 End Property

|||

Did you ever get this worked out?

I am having the same issue! I must have overlooked this post before I made mine a few minutes ago.

Did you try manually entering data through the table in SSMS? I found it had nothing to do with classes or page code. I cannot even enter it manually!

PLease advise if you found an answer.

Thanks!

Cannot insert the value NULL into column 'ID', table

I am new with SQL and have been using Access. Now with Access, when I
enter in a record, the ID field (which is my primary key) is
automatically incremented.
I am thinking from the error it is not doing that here, is there
something I am missing? (probably a lot)
ChuckCan you show us your INSERT statement? For a column with the IDENTITY attribute, you don't list the
column in the column name list, and you obviously don't specify a value for it either. Simplified
example:
CREATE TABLE t(c1 int IDENTITY, c2 char(5))
INSERT INTO t(c2)
VALUES('Hello')
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
<cvillard@.gmail.com> wrote in message news:1124228310.779917.26320@.o13g2000cwo.googlegroups.com...
>I am new with SQL and have been using Access. Now with Access, when I
> enter in a record, the ID field (which is my primary key) is
> automatically incremented.
> I am thinking from the error it is not doing that here, is there
> something I am missing? (probably a lot)
> Chuck
>|||This is a sample of my code... am I doing something wierd? Looks
different.
if Request.Form("Action") = "add" then
if Request.Form("txtPassword") = Request.Form("txtConfirm") then
rs.open "SELECT * FROM Users", conn, 1, 3
rs.AddNew
rs("Username") = Request.Form("txtUsername")
rs("Password") = Request.Form("txtPassword")
rs("Email_Address") = Request.Form("txtEmailAddress")
if Request.Form("cbRights") = true then
rs("User_Rights") = "Adminstrator"
else
rs("User_Rights") = "User"
end if
rs("Name") = Request.Form("txtName")
rs("Create_Date") = Date()
rs.Update
Response.Write("<p align='center'><b>The User Profile for " &
rs("Name") & " has been added.</b></p>")
Response.Write("<p align='center'>The user will receive an email
with the account details shortly.</p>")
Response.Write("<p align='center'><input type='button' value='Close
Window' onClick='javascript:window.close()'></p>")|||Odd. When I went back in the server didnt have Identity setup for the
ID field. Now it seems to be working.

Cannot insert the value NULL into column 'ID', table

I am new with SQL and have been using Access. Now with Access, when I
enter in a record, the ID field (which is my primary key) is
automatically incremented.
I am thinking from the error it is not doing that here, is there
something I am missing? (probably a lot)
ChuckCan you show us your INSERT statement? For a column with the IDENTITY attrib
ute, you don't list the
column in the column name list, and you obviously don't specify a value for
it either. Simplified
example:
CREATE TABLE t(c1 int IDENTITY, c2 char(5))
INSERT INTO t(c2)
VALUES('Hello')
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
<cvillard@.gmail.com> wrote in message news:1124228310.779917.26320@.o13g2000cwo.googlegroups.
com...
>I am new with SQL and have been using Access. Now with Access, when I
> enter in a record, the ID field (which is my primary key) is
> automatically incremented.
> I am thinking from the error it is not doing that here, is there
> something I am missing? (probably a lot)
> Chuck
>|||This is a sample of my code... am I doing something wierd? Looks
different.
if Request.Form("Action") = "add" then
if Request.Form("txtPassword") = Request.Form("txtConfirm") then
rs.open "SELECT * FROM Users", conn, 1, 3
rs.AddNew
rs("Username") = Request.Form("txtUsername")
rs("Password") = Request.Form("txtPassword")
rs("Email_Address") = Request.Form("txtEmailAddress")
if Request.Form("cbRights") = true then
rs("User_Rights") = "Adminstrator"
else
rs("User_Rights") = "User"
end if
rs("Name") = Request.Form("txtName")
rs("Create_Date") = Date()
rs.Update
Response.Write("<p align='center'><b>The User Profile for " &
rs("Name") & " has been added.</b></p>")
Response.Write("<p align='center'>The user will receive an email
with the account details shortly.</p>")
Response.Write("<p align='center'><input type='button' value='Close
Window' onClick='javascript:window.close()'></p>")|||Odd. When I went back in the server didnt have Identity setup for the
ID field. Now it seems to be working.

Cannot insert the value NULL into column 'ID', table

I am new with SQL and have been using Access. Now with Access, when I
enter in a record, the ID field (which is my primary key) is
automatically incremented.
I am thinking from the error it is not doing that here, is there
something I am missing? (probably a lot)
Chuck
Can you show us your INSERT statement? For a column with the IDENTITY attribute, you don't list the
column in the column name list, and you obviously don't specify a value for it either. Simplified
example:
CREATE TABLE t(c1 int IDENTITY, c2 char(5))
INSERT INTO t(c2)
VALUES('Hello')
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
<cvillard@.gmail.com> wrote in message news:1124228310.779917.26320@.o13g2000cwo.googlegro ups.com...
>I am new with SQL and have been using Access. Now with Access, when I
> enter in a record, the ID field (which is my primary key) is
> automatically incremented.
> I am thinking from the error it is not doing that here, is there
> something I am missing? (probably a lot)
> Chuck
>
|||This is a sample of my code... am I doing something wierd? Looks
different.
if Request.Form("Action") = "add" then
if Request.Form("txtPassword") = Request.Form("txtConfirm") then
rs.open "SELECT * FROM Users", conn, 1, 3
rs.AddNew
rs("Username") = Request.Form("txtUsername")
rs("Password") = Request.Form("txtPassword")
rs("Email_Address") = Request.Form("txtEmailAddress")
if Request.Form("cbRights") = true then
rs("User_Rights") = "Adminstrator"
else
rs("User_Rights") = "User"
end if
rs("Name") = Request.Form("txtName")
rs("Create_Date") = Date()
rs.Update
Response.Write("<p align='center'><b>The User Profile for " &
rs("Name") & " has been added.</b></p>")
Response.Write("<p align='center'>The user will receive an email
with the account details shortly.</p>")
Response.Write("<p align='center'><input type='button' value='Close
Window' onClick='javascript:window.close()'></p>")
|||Odd. When I went back in the server didnt have Identity setup for the
ID field. Now it seems to be working.

Cannot insert the value NULL into column 'ID'

Hi dear experts:

The message is

"Cannot insert the value NULL into column 'ID_Month', table 'Database_DW.dbo.Incident_Summary'; column does not allow nulls..."

At my table, I have a primary key which make autonumber for any record set in column 'ID_Month'. How can I insert autonumber in column 'ID_Month'by SQL statement?

Thank you in advance.

It's possible you are explictly inserting null into the column rather than ignoring it. Check all column mappings and sql statements to ensure you are not referencing that column. For example:

insert Database_DW.dbo.Incident_Summary(ID_Month, column1) select(NULL,somevalue) from sometable; would return that error.

|||

Hi Michanne,

thank you for the quick respond. Yes, you are wright, I am inserting nulls in the column that does not allow nulls.

My question is how to insert next number in the column by sql statement. I copied the d/base with data, 57 records exists in it and I don't know how to insert the record that will be number 58.

Thanks.

|||

Leave it empty in your statement. Don't reference in your column list either. It will insert it automatically as long as 58 is the next identity value. (SELECT IDENT_SEED('table') will tell you this.) I think that is what you are getting at....

There are also functions that allow you to override the identity key value but you only need to do that if you care about the value or have to correct the value in the table. To do that look up the syntax for "Set Identity insert" in BOL.

Hope that helps!

|||

Thanks for following michanne!

I can't leave it. In this case I receive a message "Cannot insert the value NULL into column 'ID_Month'. It is something with identity syntax. I can't figure out.

Thank you!

|||

Check the schema. If it is >truly< an identity it will work to insert all other columns and ignore the one that is an identity.

|||

Once again, thank you!! Checked the schema, no identity, it is float with no null values.

Your suggestion was so helpful!!

Cannot insert explicit value for identity column in table SS_Messeges when IDENTITY_INSERT

I use SQLExpress2005 and I search about this problem , this is a BUG in MsSql 2000 but I use sql Express 2005.

although in my table I set IDENTITY_INSERT on (master Key)

Please help me

I don't quite understand what your problem is. Have you tried "Set identity_insert SS_Messages ON" and still after setting this you're not able to insert explicit value in your table ? Can you explain your problem further ?

|||

let's me explain the my problem

I design a Messages table width this columns

MessageID >> int - MasterKey - Is Identityyes- Identity Increment1 - Identity seed1 NOTNULL

MessageTitle >> nvarchar(256) NOTNULL

MessageBody >> ntext NOTNULL

AddedDate >> dateTime NOTNULL

AddedByIP >> nvarchar(256) NOTNULL

IsRead >> bit NOTNULL

ResName >> nvarchar(256) NULL

ResMail >> nvarchar(256) NOTNULL

my Insert producer

ALTER PROCEDURE dbo.SS_Messages_InsertMessage
(
@.MessageTitle nvarchar(256),
@.MessageBody nvarchar(256),
@.AddedDate datetime,
@.AddedByIP nvarchar(256),
@.isRead bit,
@.ResMail nvarchar(256),
@.ResName nvarchar(256),
@.MessageID int OUTPUT
)
as
SET NOCOUNT ON
insert into SS_Messeges
(MessageID,MessageTitle,MessageBody,AddedDate,AddedByIP,isRead,ResMail,ResName)
VALUES (@.MessageID,@.MessageTitle,@.MessageBody,@.AddedDate,@.AddedByIP,@.isRead,@.ResMail,@.ResName)
SET @.MessageID=SCOPE_IDENTITY()

DAL Message class (Insert Message methods)

public override int InsertMessage(MessageDetails message)
{
using (SqlConnection cn = new SqlConnection(this.ConnectionString))
{
SqlCommand cmd = new SqlCommand("SS_Messeges_InsertMessege", cn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@.MessageTitle",SqlDbType.NVarChar).Value=message.MessageTitle;
cmd.Parameters.Add("@.MessageBody", SqlDbType.NVarChar).Value=message.MessageBody;
cmd.Parameters.Add("@.AddedDate",SqlDbType.DateTime).Value=message.AddedDate;
cmd.Parameters.Add("@.AddedByIP",SqlDbType.NVarChar).Value=message.AddedByIP;
cmd.Parameters.Add("@.isRead",SqlDbType.NVarChar).Value=message.IsRead;
cmd.Parameters.Add("@.ResMail", SqlDbType.NVarChar).Value = message.ResMail;
cmd.Parameters.Add("@.ResName", SqlDbType.NVarChar).Value = message.ResName;
cmd.Parameters.Add("@.MessageID", SqlDbType.Int).Direction = ParameterDirection.Output;
cn.Open();
int ret = ExecuteNonQuery(cmd);
return (int)cmd.Parameters["@.MessageID"].Value;
}
}

BLL Messages Class >> Insert Message Methods

public static int InsertMessage(string messageTitle, string messagebody,
string resMail, string resName)
{
messageTitle = BizObject.ConvertNullToEmptyString(messageTitle);
messagebody = BizObject.ConvertNullToEmptyString(messagebody);
resName = BizObject.ConvertNullToEmptyString(resName);
resMail = BizObject.ConvertNullToEmptyString(resMail);
MessageDetails record = new MessageDetails(0, messageTitle, messagebody, DateTime.Now, BizObject.CurrentUserIP,
false, resMail, resName);
int ret = SiteProvider.Messages.InsertMessage(record);
return ret;
}

Contact US Code Behind

protected void txtSubmit_Click(object sender, EventArgs e)
{

int ret = Message.InsertMessage(txtTitle.Text, txtBody.Text, txtResMail.Text, txtResName.Text);
}

What is wrong??

when I want to add an Message this error happened :(

Cannot insert explicit value for identity column in table 'SS_Messeges' when IDENTITY_INSERT is set to OFF

|||

You want to insert and return the new ID? It doesn't look like you are supplying a value for the MessageID that you are trying to insert.

If that is the case, you can take the @.MessageID out of the insert statement. You're not really inserting anything into that field. YOu want SQL server to create the next ID for you.

SET NOCOUNT ON
insert into SS_Messeges
(MessageTitle,MessageBody,AddedDate,AddedByIP,isRead,ResMail,ResName)
VALUES (@.MessageTitle,@.MessageBody,@.AddedDate,@.AddedByIP,@.isRead,@.ResMail,@.ResName)
SET @.MessageID=SCOPE_IDENTITY()

|||

thank Pyre

I catch my problem with your post

|||

An identity column, by design, autogenerates its own value when an insert is performed. Apparently, your code must be including the IDENTITY column in the insert and supplying a value. I presume that this is NOT what you want to do.

Cannot insert explicit value for identity column in table Gallery when IDENTITY_INSERT is

Hello!

Do anybody know how to fix this error?

Cannot insert explicit value for identity column in table 'Gallery' when IDENTITY_INSERT is set to OFF.?


Thanks!
Varcar!Don't insert values into the identity column, or set identity_insert on?

Cannot insert explicit value for identity column (was "Error")

Cannot insert explicit value for identity column in table 'tblUsed' when IDENTITY_INSERT is set to OFF.
:confused:Then either set it to on or post why you need to insert into the Autonumber field

Cannot insert explicit value for identity column

SQL Server 2000 SP4 (Enterprise edition) both publisher and Subscriber.
I have setup Identity column 'Not for Replication' in subscriber.
My error is
Cannot insert explicit value for identity column in table 'tablename' when
IDENTITY_INSERT is set to OFF.
I ran
SET IDENTITY_INSERT 'tablename' ON
I am still getting same error. Pl help
TIA
Sandeep
I am running transactional replication.
Thanks,
Sandeep
"Sandeep Shankar" <sandeep@.discussions.microsoft.com> wrote in message
news:%23yzPifMKIHA.1208@.TK2MSFTNGP03.phx.gbl...
> SQL Server 2000 SP4 (Enterprise edition) both publisher and Subscriber.
> I have setup Identity column 'Not for Replication' in subscriber.
> My error is
>
> Cannot insert explicit value for identity column in table 'tablename' when
> IDENTITY_INSERT is set to OFF.
>
> I ran
> SET IDENTITY_INSERT 'tablename' ON
>
> I am still getting same error. Pl help
> TIA
> Sandeep
>

Sunday, February 19, 2012

cannot insert data from one table to another

Hello:
All I want to do is simply copy a column of data from one table to another.
The first time I tried it, I got that blame "cannot insert duplicate primary
KEY constraint" business or whatever. So, I decided to create a duplicate
table (backup table). I did that sucessfully. The point is that I created
a
backup table of the table that I want to copy into so that I could get aroun
d
this error.
I got around that error. But, now, when I try to copy the column from a
table into this backup table, I get a message saying that it cannot insert
the value "NULL" into some other column in the table that I do not care abou
t
anyway.
Is there any way to get around these errors? I just want to copy data from
one column for goodness sakes!!!
Thanks!
childofthe1980sThere is no way for anyone to help unless you provide quite a bit more
information. The error messages are symptoms, but to understand them
required the entire picture.
So, show the table structures (including those pesky keys), and show
what the data looks like, and describe more precisely what you are
trying to accomplish. Before and after views of the data help a lot.
Roy
On Sun, 26 Feb 2006 10:18:26 -0800, "childothe1980s"
<childothe1980s@.discussions.microsoft.com> wrote:

>Hello:
>All I want to do is simply copy a column of data from one table to another.
>The first time I tried it, I got that blame "cannot insert duplicate primar
y
>KEY constraint" business or whatever. So, I decided to create a duplicate
>table (backup table). I did that sucessfully. The point is that I created
a
>backup table of the table that I want to copy into so that I could get arou
nd
>this error.
>I got around that error. But, now, when I try to copy the column from a
>table into this backup table, I get a message saying that it cannot insert
>the value "NULL" into some other column in the table that I do not care abo
ut
>anyway.
>Is there any way to get around these errors? I just want to copy data from
>one column for goodness sakes!!!
>Thanks!
>childofthe1980s|||"childothe1980s" <childothe1980s@.discussions.microsoft.com> wrote in message
news:3C895F9B-8A38-4991-AD42-9B43F5EDFCB8@.microsoft.com...
> Hello:
> All I want to do is simply copy a column of data from one table to
> another.
> The first time I tried it, I got that blame "cannot insert duplicate
> primary
> KEY constraint" business or whatever. So, I decided to create a duplicate
> table (backup table). I did that sucessfully. The point is that I
> created a
> backup table of the table that I want to copy into so that I could get
> around
> this error.
> I got around that error. But, now, when I try to copy the column from a
> table into this backup table, I get a message saying that it cannot insert
> the value "NULL" into some other column in the table that I do not care
> about
> anyway.
> Is there any way to get around these errors? I just want to copy data
> from
> one column for goodness sakes!!!
> Thanks!
> childofthe1980s
DDL and sample data please if you expect a full working solution. See:
http://www.aspfaq.com/etiquette.asp?id=5006
In your INSERT you have to supply a value for the non-nullable columns that
don't have defaults.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--

Cannot import Oracle data with OLE DB

I have a column in an Oracle source system with data type NUMBER(38,2). The value "-0.01" is causing problems when trying to import into a SSIS data-flow.

The only way I can import this into my data-flow is by using a Datareader connection manager using the ODBC Data Provider. My DSN is using the Oracle ODBC driver.

If I try and use the "Native OLE DB\Microsoft OLE DB Provider for Oracle" I get an error: "The data value cannot be converted for reasons other than sign mismatch or data overflow"

Judging by this post: http://microsoftdw.blogspot.com/2005/11/final-storyhow-to-get-data-out-of.html there aren't really any other combinations to try that will bring my data in as I want it.

I don't want to use ODBC though as:

    Its an old technology Its slow I have to deploy an additional DSN.

Can anyone tell me why the other options don't work? Why does Microsoft OLE DB Provider for Oracle have a problem with "-0.01"?

-Jamie

When I tried to reproduce the issue reported by you, I encountered different set of problems. I tried to copy data from a Oracle table with NUMBER(38,2) column to a SQL Server 2005 table with a NUMERIC (38,2) column using OraOLEDB (and later using MSDORA) OLE DB connection manager at the source. I dont get any error messages when I execute the package. However, no data is transferred and I do not see any data when I preview the data at the source. May be I am missing something that you did that produced the error message you got.|||

Well I can't even preview the data so I think my problem is more deep seated. My errors occur in the source adapter and hence I think I have a problem in the middleware.

-Jamie