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

Wednesday, March 21, 2012

Error when I try to add Output Column in in Data Conversion

Here is what I get. Is this an install problem or is this how this software works?

===================================

Error at Data Flow Task [Data Conversion [720]]: An output cannot be added to the outputs collection.

(Microsoft Visual Studio)

===================================

Exception from HRESULT: 0xC020800F (Microsoft.SqlServer.DTSPipelineWrap)

Program Location:

at Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass.InsertOutput(DTSInsertPlacement eInsertPlacement, Int32 lOutputID)
at Microsoft.DataTransformationServices.Design.Controls.ComponentMetaDataTreeView.AddOutput()

What did you do to cause the error?

-Jamie

|||When in a package I added a data flow object then drilled into to add data source etc.

One of the items in the tool bar is Data Conversion. I whent to Advance edit on DataConversion on the last tab there was a button to "Add Output"

The result was the error above|||

PeterFreeb wrote:

When in a package I added a data flow object then drilled into to add data source etc.

One of the items in the tool bar is Data Conversion. I whent to Advance edit on DataConversion on the last tab there was a button to "Add Output"

The result was the error above

This is completely correct. it is not possible to add an output to the Data Conversion component. It only has one output and that exists as soon as you drag it onto the design surface.

What exactly are you attempting to do?

-Jamie

|||I have a unicode field in SQL and am trying to go non unicode or VARCHAR2 in Oracle.|||

PeterFreeb wrote:

I have a unicode field in SQL and am trying to go non unicode or VARCHAR2 in Oracle.

OK, well you have no need to go anywhere near the Advanced Editor. Just open the component up by double-clicking on it and add your data conversion in the GUI.

-Jamie

|||OK thanks I have a more involved question for Jamie or whoever knows...

I need to do an update or insert - I could do this easyly in SQL am not sure how to accomplish this in SSIS.

1. Check if the record is in the destination
2. If true -> Update
3. Else ->Insert|||

PeterFreeb wrote:

OK thanks I have a more involved question for Jamie or whoever knows...

I need to do an update or insert - I could do this easyly in SQL am not sure how to accomplish this in SSIS.

1. Check if the record is in the destination
2. If true -> Update
3. Else ->Insert

All documented here Peter:

Checking if a row exists and if it does, has it changed?
(http://blogs.conchango.com/jamiethomson/archive/2006/09/12/SSIS_3A00_-Checking-if-a-row-exists-and-if-it-does_2C00_-has-it-changed.aspx)

-Jamie

Monday, March 12, 2012

Error when checking if column exists before running query.

I am getting this error when the below query is run "Invalid column
name 'CellPhone'"
if exists (select * from information_schema.columns where table_name
='Customers' AND COLUMN_NAME = 'CellPhone')
UPDATE Customers SET PhoneNumber = CellPhone
GO
The Customers table exists but the column CellPhone doesn't.
SQL seems to try to validate the update query even if its not going to
be run.
If I change the table to something that doesn't exist, it will skip
over the line without any errors.
eg. UPDATE CustomersXXX SET PhoneNumber = CellPhone
So if the table does exist it must try to validate the columns against
the table.
Any ideas on how to get around this? I don't want it to run the query
if the column doesn't exist.
ThanksThere might be better ways but this splits the statement into two compiles:
if exists (select * from information_schema.columns where table_name
='Customers' AND COLUMN_NAME = 'CellPhone')
EXEC ('UPDATE Customers SET PhoneNumber = CellPhone')
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
<focus.nz@.gmail.com> wrote in message
news:1151547434.570100.97390@.m73g2000cwd.googlegroups.com...
>I am getting this error when the below query is run "Invalid column
> name 'CellPhone'"
>
> if exists (select * from information_schema.columns where table_name
> ='Customers' AND COLUMN_NAME = 'CellPhone')
> UPDATE Customers SET PhoneNumber = CellPhone
> GO
>
> The Customers table exists but the column CellPhone doesn't.
> SQL seems to try to validate the update query even if its not going to
> be run.
> If I change the table to something that doesn't exist, it will skip
> over the line without any errors.
> eg. UPDATE CustomersXXX SET PhoneNumber = CellPhone
> So if the table does exist it must try to validate the columns against
> the table.
> Any ideas on how to get around this? I don't want it to run the query
> if the column doesn't exist.
> Thanks
>|||There might be better ways but this splits the statement into two compiles:
if exists (select * from information_schema.columns where table_name
='Customers' AND COLUMN_NAME = 'CellPhone')
EXEC ('UPDATE Customers SET PhoneNumber = CellPhone')
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
<focus.nz@.gmail.com> wrote in message
news:1151547434.570100.97390@.m73g2000cwd.googlegroups.com...
>I am getting this error when the below query is run "Invalid column
> name 'CellPhone'"
>
> if exists (select * from information_schema.columns where table_name
> ='Customers' AND COLUMN_NAME = 'CellPhone')
> UPDATE Customers SET PhoneNumber = CellPhone
> GO
>
> The Customers table exists but the column CellPhone doesn't.
> SQL seems to try to validate the update query even if its not going to
> be run.
> If I change the table to something that doesn't exist, it will skip
> over the line without any errors.
> eg. UPDATE CustomersXXX SET PhoneNumber = CellPhone
> So if the table does exist it must try to validate the columns against
> the table.
> Any ideas on how to get around this? I don't want it to run the query
> if the column doesn't exist.
> Thanks
>|||Thanks, that did the trick.

Error when checking if column exists before running query.

I am getting this error when the below query is run "Invalid column
name 'CellPhone'"
if exists (select * from information_schema.columns where table_name
='Customers' AND COLUMN_NAME = 'CellPhone')
UPDATE Customers SET PhoneNumber = CellPhone
GO
The Customers table exists but the column CellPhone doesn't.
SQL seems to try to validate the update query even if its not going to
be run.
If I change the table to something that doesn't exist, it will skip
over the line without any errors.
eg. UPDATE CustomersXXX SET PhoneNumber = CellPhone
So if the table does exist it must try to validate the columns against
the table.
Any ideas on how to get around this? I don't want it to run the query
if the column doesn't exist.
ThanksThere might be better ways but this splits the statement into two compiles:
if exists (select * from information_schema.columns where table_name
='Customers' AND COLUMN_NAME = 'CellPhone')
EXEC ('UPDATE Customers SET PhoneNumber = CellPhone')
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
<focus.nz@.gmail.com> wrote in message
news:1151547434.570100.97390@.m73g2000cwd.googlegroups.com...
>I am getting this error when the below query is run "Invalid column
> name 'CellPhone'"
>
> if exists (select * from information_schema.columns where table_name
> ='Customers' AND COLUMN_NAME = 'CellPhone')
> UPDATE Customers SET PhoneNumber = CellPhone
> GO
>
> The Customers table exists but the column CellPhone doesn't.
> SQL seems to try to validate the update query even if its not going to
> be run.
> If I change the table to something that doesn't exist, it will skip
> over the line without any errors.
> eg. UPDATE CustomersXXX SET PhoneNumber = CellPhone
> So if the table does exist it must try to validate the columns against
> the table.
> Any ideas on how to get around this? I don't want it to run the query
> if the column doesn't exist.
> Thanks
>|||Thanks, that did the trick.

Friday, March 9, 2012

Error when applying snapshot

Hello, I have setup web sync from wm 5.0 and it seems to crash when applying the snapshot. Looking at the column definitions it seems fine. Am I missing something? Thanks in advance.

John

The identity column must be either an integer or big integer data type and cannot be NULL.
HRESULT 0x80004005 (25551)

The SQL statement failed to execute. [ SQL statement = CREATE TABLE "macros" ( "peopleid" numeric ( 18 , 0 ) NOT NULL , "macroid" numeric ( 18 , 0 ) IDENTITY ( 1 , 1 ) NOT NULL , "description" nvarchar ( 255 ) NULL , "rowguid" uniqueidentifier ROWGUIDCOL NOT NULL CONSTRAINT "MSmerge_df_rowguid_8E4B26C6706844BC984B039BA07845B5" DEFAULT ( NEWID ( ) ) ) ]
HRESULT 0x80004005 (28560)

The operation could not be completed.

The error message has everything! Please read it again. It says that your identity column (macroid) is not of type bigint or int. SQL Server Mobile/Everywhere support IDENTITY only on int and bigint.

Thanks,

Laxmi Narsimha Rao ORUGANTI, SQL Server Everywhere, Microsoft Corporation

|||

I'm getting the same error when trying to set up a subscription to merge replication with wm 5.0. Here is the error:

The identity column must be either an integer or big integer data type and cannot be NULL.
HRESULT 0x80004005 (25551)

The SQL statement failed to execute. If this occurred while using merge replication, this is an internal error. If this occurred while using RDA, then the SQL statement is invalid either on the PULL statement or on the SubmitSQL statement. [ SQL statement = CREATE TABLE "INV_MfrProduct" ( "MfrProductId" numeric ( 18 , 0 ) IDENTITY ( 1 , 1 ) NOT NULL , "MfrProductDesc" nvarchar ( 100 ) NOT NULL , "isActive" bit NOT NULL , "ClassId" numeric ( 18 , 0 ) NULL , "rowguid" uniqueidentifier ROWGUIDCOL NOT NULL CONSTRAINT "MSmerge_df_rowguid_CA8620C3C47D4A388517DDA409E1C2AB" DEFAULT ( NEWID ( ) ) ) ]
HRESULT

The table in question though is only one (last one) out of several that have identity as numeric field. The identity range is safely within the limits of bigint though. So, what would be the solution to this? Not use merge replication?

Please, advise.

Error when applying snapshot

Hello, I have setup web sync from wm 5.0 and it seems to crash when applying the snapshot. Looking at the column definitions it seems fine. Am I missing something? Thanks in advance.

John

The identity column must be either an integer or big integer data type and cannot be NULL.
HRESULT 0x80004005 (25551)

The SQL statement failed to execute. [ SQL statement = CREATE TABLE "macros" ( "peopleid" numeric ( 18 , 0 ) NOT NULL , "macroid" numeric ( 18 , 0 ) IDENTITY ( 1 , 1 ) NOT NULL , "description" nvarchar ( 255 ) NULL , "rowguid" uniqueidentifier ROWGUIDCOL NOT NULL CONSTRAINT "MSmerge_df_rowguid_8E4B26C6706844BC984B039BA07845B5" DEFAULT ( NEWID ( ) ) ) ]
HRESULT 0x80004005 (28560)

The operation could not be completed.

The error message has everything! Please read it again. It says that your identity column (macroid) is not of type bigint or int. SQL Server Mobile/Everywhere support IDENTITY only on int and bigint.

Thanks,

Laxmi Narsimha Rao ORUGANTI, SQL Server Everywhere, Microsoft Corporation

|||

I'm getting the same error when trying to set up a subscription to merge replication with wm 5.0. Here is the error:

The identity column must be either an integer or big integer data type and cannot be NULL.
HRESULT 0x80004005 (25551)

The SQL statement failed to execute. If this occurred while using merge replication, this is an internal error. If this occurred while using RDA, then the SQL statement is invalid either on the PULL statement or on the SubmitSQL statement. [ SQL statement = CREATE TABLE "INV_MfrProduct" ( "MfrProductId" numeric ( 18 , 0 ) IDENTITY ( 1 , 1 ) NOT NULL , "MfrProductDesc" nvarchar ( 100 ) NOT NULL , "isActive" bit NOT NULL , "ClassId" numeric ( 18 , 0 ) NULL , "rowguid" uniqueidentifier ROWGUIDCOL NOT NULL CONSTRAINT "MSmerge_df_rowguid_CA8620C3C47D4A388517DDA409E1C2AB" DEFAULT ( NEWID ( ) ) ) ]
HRESULT

The table in question though is only one (last one) out of several that have identity as numeric field. The identity range is safely within the limits of bigint though. So, what would be the solution to this? Not use merge replication?

Please, advise.

Error Validating Formula for Column

Hi,
I have three fields APPLICANT_FIRST_NAME, APPLICANT_LAST_NAME and
APPLICANT_NAME
While designing table in sql enterprise manager I am inserting
"APPLICANT_FIRST_NAME & APPLICANT_LAST_NAME" for Formula Value of
APPLICANT_NAME field
But I am getting the following error
"Error Validating Formula for Column"
I need a field APPLICANT_NAME that has both values APPLICANT_FIRST_NAME and
APPLICANT_LAST_NAME in it
Can someone help me
Thanks
Ponnurangam
Hi
Your question is answered in .programming group. Don't multi-post.
"Ponnurangam" <ponnurangam@.trellisys.net> wrote in message
news:eSljuKsqEHA.3416@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I have three fields APPLICANT_FIRST_NAME, APPLICANT_LAST_NAME and
> APPLICANT_NAME
> While designing table in sql enterprise manager I am inserting
> "APPLICANT_FIRST_NAME & APPLICANT_LAST_NAME" for Formula Value of
> APPLICANT_NAME field
> But I am getting the following error
> "Error Validating Formula for Column"
> I need a field APPLICANT_NAME that has both values APPLICANT_FIRST_NAME
and
> APPLICANT_LAST_NAME in it
> Can someone help me
> Thanks
> Ponnurangam
>
|||I get the same error even if use "+" instead of "&"
Any help is appreciated
Ponnurangam
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:<#lLB$NsqEHA.2732@.TK2MSFTNGP09.phx.gbl>...

> Hi

> Your question is answered in .programming group. Don't multi-post.

>

>

>

> "Ponnurangam" <ponnurangam@.trellisys.net> wrote in message

> news:eSljuKsqEHA.3416@.TK2MSFTNGP15.phx.gbl...
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]

> and
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]
[vbcol=seagreen]

>

>

Error Validating Formula for Column

Hi,
I have three fields APPLICANT_FIRST_NAME, APPLICANT_LAST_NAME and
APPLICANT_NAME
While designing table in sql enterprise manager I am inserting
"APPLICANT_FIRST_NAME & APPLICANT_LAST_NAME" for Formula Value of
APPLICANT_NAME field
But I am getting the following error
"Error Validating Formula for Column"
I need a field APPLICANT_NAME that has both values APPLICANT_FIRST_NAME and
APPLICANT_LAST_NAME in it
Can someone help me
Thanks
PonnurangamHi
Your question is answered in .programming group. Don't multi-post.
"Ponnurangam" <ponnurangam@.trellisys.net> wrote in message
news:eSljuKsqEHA.3416@.TK2MSFTNGP15.phx.gbl...
> Hi,
> I have three fields APPLICANT_FIRST_NAME, APPLICANT_LAST_NAME and
> APPLICANT_NAME
> While designing table in sql enterprise manager I am inserting
> "APPLICANT_FIRST_NAME & APPLICANT_LAST_NAME" for Formula Value of
> APPLICANT_NAME field
> But I am getting the following error
> "Error Validating Formula for Column"
> I need a field APPLICANT_NAME that has both values APPLICANT_FIRST_NAME
and
> APPLICANT_LAST_NAME in it
> Can someone help me
> Thanks
> Ponnurangam
>

Sunday, February 26, 2012

Error trying to websync

Hello,

We dropped an article and then made a change to a column. We then added the article back in. Generated a snapshot and reinitialized all subscriptions without uploading data changes. After we did this we still continue to get this error. Any ideas? Thanks.

John

The Merge Agent failed after detecting that retention-based metadata cleanup has deleted metadata at the Publisher for changes not yet sent to the Subscriber. You must reinitialize the subscription (without upload).

John,

After you drop the article and before you add the article in, did you run the marge agent? Also, what version of SQL Server are you using?

|||

Yi,

No we didn't run merge agent manually. Were we supposed to? It's SQL 2k5

John

|||

The error message is telling that some metadata that is needed to enumerate what rows need to sent to the subscriber has been cleaned up. Hence you will need to reinitialize the subscription.

And you need not run the merge agent in between dropping and adding the article.

You might have encoutnered this scenario because the merge agent may not have synchronized with the publisher for a long time (time longer than the retention period)

Please reinitialize without upload, run the merge agent and report back if you still see failures.

Error trying to websync

Hello,

We dropped an article and then made a change to a column. We then added the article back in. Generated a snapshot and reinitialized all subscriptions without uploading data changes. After we did this we still continue to get this error. Any ideas? Thanks.

John

The Merge Agent failed after detecting that retention-based metadata cleanup has deleted metadata at the Publisher for changes not yet sent to the Subscriber. You must reinitialize the subscription (without upload).

John,

After you drop the article and before you add the article in, did you run the marge agent? Also, what version of SQL Server are you using?

|||

Yi,

No we didn't run merge agent manually. Were we supposed to? It's SQL 2k5

John

|||

The error message is telling that some metadata that is needed to enumerate what rows need to sent to the subscriber has been cleaned up. Hence you will need to reinitialize the subscription.

And you need not run the merge agent in between dropping and adding the article.

You might have encoutnered this scenario because the merge agent may not have synchronized with the publisher for a long time (time longer than the retention period)

Please reinitialize without upload, run the merge agent and report back if you still see failures.

Friday, February 24, 2012

error trying to move data from 1 table to another.

Hi I am getting the following error
Syntax error converting the nvarchar value 'null' to a column of data type int
while attempting to move data from 1 table to another with the script,
INSERT INTO [dbase1].dbo.DML$table1
([Data_Item_ID])
SELECT CAST([Data_Item_ID]as int)
from [DML1].dbo.dataitemlog
I have allow not NULL for both source and destination fields, so do not see
how I could be getting this error, also did not see any null values in the
source field. The source data type is
(nvarchar (4) not null)
and the destination field data type is (int, not null)
any suggestions? thanks.
--
Paul G
Software engineer.this problem has been addressed in a previous post. thanks, Paul.
"Paul" wrote:
> Hi I am getting the following error
> Syntax error converting the nvarchar value 'null' to a column of data type int
> while attempting to move data from 1 table to another with the script,
> INSERT INTO [dbase1].dbo.DML$table1
> ([Data_Item_ID])
> SELECT CAST([Data_Item_ID]as int)
> from [DML1].dbo.dataitemlog
> I have allow not NULL for both source and destination fields, so do not see
> how I could be getting this error, also did not see any null values in the
> source field. The source data type is
> (nvarchar (4) not null)
> and the destination field data type is (int, not null)
> any suggestions? thanks.
> --
> Paul G
> Software engineer.

error trying to move data from 1 table to another.

Hi I am getting the following error
Syntax error converting the nvarchar value 'null' to a column of data type i
nt
while attempting to move data from 1 table to another with the script,
INSERT INTO [dbase1].dbo.DML$table1
([Data_Item_ID])
SELECT CAST([Data_Item_ID]as int)
from [DML1].dbo.dataitemlog
I have allow not NULL for both source and destination fields, so do not see
how I could be getting this error, also did not see any null values in the
source field. The source data type is
(nvarchar (4) not null)
and the destination field data type is (int, not null)
any suggestions? thanks.
--
Paul G
Software engineer.this problem has been addressed in a previous post. thanks, Paul.
"Paul" wrote:

> Hi I am getting the following error
> Syntax error converting the nvarchar value 'null' to a column of data type
int
> while attempting to move data from 1 table to another with the script,
> INSERT INTO [dbase1].dbo.DML$table1
> ([Data_Item_ID])
> SELECT CAST([Data_Item_ID]as int)
> from [DML1].dbo.dataitemlog
> I have allow not NULL for both source and destination fields, so do not se
e
> how I could be getting this error, also did not see any null values in the
> source field. The source data type is
> (nvarchar (4) not null)
> and the destination field data type is (int, not null)
> any suggestions? thanks.
> --
> Paul G
> Software engineer.

error trying to move data from 1 table to another.

Hi I am getting the following error
Syntax error converting the nvarchar value 'null' to a column of data type int
while attempting to move data from 1 table to another with the script,
INSERT INTO [dbase1].dbo.DML$table1
([Data_Item_ID])
SELECT CAST([Data_Item_ID]as int)
from [DML1].dbo.dataitemlog
I have allow not NULL for both source and destination fields, so do not see
how I could be getting this error, also did not see any null values in the
source field. The source data type is
(nvarchar (4) not null)
and the destination field data type is (int, not null)
any suggestions? thanks.
Paul G
Software engineer.
this problem has been addressed in a previous post. thanks, Paul.
"Paul" wrote:

> Hi I am getting the following error
> Syntax error converting the nvarchar value 'null' to a column of data type int
> while attempting to move data from 1 table to another with the script,
> INSERT INTO [dbase1].dbo.DML$table1
> ([Data_Item_ID])
> SELECT CAST([Data_Item_ID]as int)
> from [DML1].dbo.dataitemlog
> I have allow not NULL for both source and destination fields, so do not see
> how I could be getting this error, also did not see any null values in the
> source field. The source data type is
> (nvarchar (4) not null)
> and the destination field data type is (int, not null)
> any suggestions? thanks.
> --
> Paul G
> Software engineer.

Error trying to do transactional replication on a long text column

I am getting the following error message when I try to do a transactional
replication of a large table with a text column:
Error Message: The process could not bulk copy into table '"monitorResults"'.
Error Details: Expected the text length in data stream for bulk copy of
text, ntext, or image data.
(Source: IWPSQL3 (Data source); Error number: 4813)
I checked sp_configure 'max text repl size (B)' and it is much larger than
the results from: SELECT max(datalength(notes)) FROM dbo.monitorResults
Does anyone have any ideas?
Thanks!
Racer-D
does this post help?
http://groups.google.com/groups?selm...utput =gplain
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Racer-D" <RacerD@.discussions.microsoft.com> wrote in message
news:960960F3-46E7-44C6-A46F-078D6A448DD7@.microsoft.com...
> I am getting the following error message when I try to do a transactional
> replication of a large table with a text column:
> Error Message: The process could not bulk copy into table
'"monitorResults"'.
> Error Details: Expected the text length in data stream for bulk copy of
> text, ntext, or image data.
> (Source: IWPSQL3 (Data source); Error number: 4813)
> ----
--
> I checked sp_configure 'max text repl size (B)' and it is much larger than
> the results from: SELECT max(datalength(notes)) FROM dbo.monitorResults
> Does anyone have any ideas?
> Thanks!
> Racer-D

Friday, February 17, 2012

error sql 2000

Server: Msg 515, Level 16, State 2, Procedure sp_helpdb,
Line 53
Cannot insert the value NULL into column '', table '';
column does not allow nulls. INSERT fails.
The statement has been terminated.HI,
You might get this error if you have an invalid database owner. Execute the
below script to verify,
SELECT name, SUSER_SNAME(sid)
FROM master..sysdatabases
WHERE SUSER_SNAME(sid) IS NULL
Incase if you have any invalid users , execute sp_changedbowner (refer books
online) stored procedure.
Thanks
Hari
MCDBA
"harold apolinar" <anonymous@.discussions.microsoft.com> wrote in message
news:f7b201c40cf5$533b69e0$a501280a@.phx.gbl...
> Server: Msg 515, Level 16, State 2, Procedure sp_helpdb,
> Line 53
> Cannot insert the value NULL into column '', table '';
> column does not allow nulls. INSERT fails.
> The statement has been terminated.|||Are you running sp_helpdb with a database name or without? If the latter,
does it work if you explicitly set a database name that you have access to?
"harold apolinar" <anonymous@.discussions.microsoft.com> wrote in message
news:f7b201c40cf5$533b69e0$a501280a@.phx.gbl...
> Server: Msg 515, Level 16, State 2, Procedure sp_helpdb,
> Line 53
> Cannot insert the value NULL into column '', table '';
> column does not allow nulls. INSERT fails.
> The statement has been terminated.

error selecting null columns

I want to run a query that selects rows from the table where a datetime column has null values;

select*from OrderswhereIsNull(dClosedDate,'Null')='Null'

However i get this error:

Conversion failed when converting datetime from character string.

Any help appreciated

SELECT * FROM Orders WHERE ISNULL(dClosedDate, '1900-01-01') = '1900-01-01'

|||

thx...i tried dClosedDate is NULL and it worked too.

Wednesday, February 15, 2012

Error saving diagram

I'm trying to save a diagram but get this error:
"Cannot insert the value NULL into column 'version',
table 'Hernan.dbo.dtproperties'; column does not allows
nulls. INSERT fails.
The statement has been terminated
The 'dt_adduserobject' procedure attempted to return a
status of NULL, wich is not allowed. A status of 0 will be
returned instead."
can you help me ?
cannot save any diagram.
thanks in advance,
Hernanwithout the table DLL I'm afraid there's not much help for you.
Did you try to add a column with a null value and make it PK?
"Hernan" <hvaldes@.frisa.com> wrote in message
news:02e301c3610f$7a565db0$a501280a@.phx.gbl...
> I'm trying to save a diagram but get this error:
> "Cannot insert the value NULL into column 'version',
> table 'Hernan.dbo.dtproperties'; column does not allows
> nulls. INSERT fails.
> The statement has been terminated
> The 'dt_adduserobject' procedure attempted to return a
> status of NULL, wich is not allowed. A status of 0 will be
> returned instead."
> can you help me ?
> cannot save any diagram.
> thanks in advance,
> Hernan|||my bad.
I thought you had this error on a user table.
"Flicker" <hthan@.superioraccess.com> wrote in message
news:Of2NBtRYDHA.1900@.TK2MSFTNGP10.phx.gbl...
> without the table DLL I'm afraid there's not much help for you.
> Did you try to add a column with a null value and make it PK?
>
> "Hernan" <hvaldes@.frisa.com> wrote in message
> news:02e301c3610f$7a565db0$a501280a@.phx.gbl...
> > I'm trying to save a diagram but get this error:
> >
> > "Cannot insert the value NULL into column 'version',
> > table 'Hernan.dbo.dtproperties'; column does not allows
> > nulls. INSERT fails.
> > The statement has been terminated
> > The 'dt_adduserobject' procedure attempted to return a
> > status of NULL, wich is not allowed. A status of 0 will be
> > returned instead."
> >
> > can you help me ?
> > cannot save any diagram.
> >
> > thanks in advance,
> > Hernan
>|||Hernan,
Whats the SQL Server version? The below workaround is mentioned in
BooksOnLine for this error:
ALTER TABLE dbo.dtproperties ADD uvalue NVARCHAR(255) NULL
GO
IF EXISTS(SELECT * FROM dbo.dtproperties) EXEC('UPDATE dbo.dtproperties SET
uvalue = CONVERT(NVARCHAR(255), value)')
GO
If it still doesnt help, read on.
>> cannot save any diagram.
Does that mean you dont have any database diagrams? If so, try dropping the
dtproperties table.This table is recreated automatically every time you try
to save a database diagram.You have to unmark the table as a system
object.Since this is undocumented, the usual warnings exist:
dbo.sp_msUnmarkschemaobject dtproperties
drop table dtproperties
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
"Hernan" <hvaldes@.frisa.com> wrote in message
news:02e301c3610f$7a565db0$a501280a@.phx.gbl...
> I'm trying to save a diagram but get this error:
> "Cannot insert the value NULL into column 'version',
> table 'Hernan.dbo.dtproperties'; column does not allows
> nulls. INSERT fails.
> The statement has been terminated
> The 'dt_adduserobject' procedure attempted to return a
> status of NULL, wich is not allowed. A status of 0 will be
> returned instead."
> can you help me ?
> cannot save any diagram.
> thanks in advance,
> Hernan