Sunday, March 25, 2012
cannot drop index....it is being used for Foreign Key Enforcement ??
Message
Server: Msg 3723, Level 16, State 6
An Explicit DROP INDEX is not allowed on index
'dbo.Jobs.nci_Jobs_StartTime'. It is being used for FOREIGN KEY constraint
Enforcement.
Ummm...No It's not...!
I scripted the entire DB and searched for any foreign key referencing this
column and it simply does not exist in the script.
I just wanna drop the index named nci_Jobs_StartTime (is that so wrong?)
Here is the Jobs Table Script:
CREATE TABLE [dbo].[Jobs] (
[JobUID] [uniqueidentifier] NOT NULL ,
[ParentJobUID] [uniqueidentifier] NULL ,
[JobTypeID] [tinyint] NOT NULL ,
[JobStatusID] [tinyint] NOT NULL ,
[CNCSystemID] [tinyint] NULL ,
[JobStep] [tinyint] NULL ,
[HasSubJobs] [bit] NOT NULL ,
[CurrentSubJobStep] [tinyint] NULL ,
[JobStartTime] [datetime] NULL ,
[JobStopTime] [datetime] NULL ,
[JobPickedUpAtTime] [datetime] NULL ,
[JobPickedUpByMachine] [varchar] (50) COLLATE SQL_Latin1_General_CP1
_CI_AS
NULL ,
[JobData] [varbinary] (4096) NULL ,
[JobRawData] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Retry] [tinyint] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[Jobs] WITH NOCHECK ADD
CONSTRAINT [PK_Jobs] PRIMARY KEY CLUSTERED
(
[JobUID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Jobs] WITH NOCHECK ADD
CONSTRAINT [DF__Jobs__Retry__4AB81AF0] DEFAULT (0) FOR [Retry]
GO
CREATE INDEX [nci_Jobs_StartTime] ON [dbo].[Jobs]([JobStart
Time]) ON
[PRIMARY]
GO
ALTER TABLE [dbo].[Jobs] ADD
CONSTRAINT [FK_Jobs_CNCSystem] FOREIGN KEY
(
[CNCSystemID]
) REFERENCES [dbo].[CNCSystem] (
[CNCSystemID]
),
CONSTRAINT [FK_Jobs_Jobs] FOREIGN KEY
(
[ParentJobUID]
) REFERENCES [dbo].[Jobs] (
[JobUID]
),
CONSTRAINT [FK_Jobs_JobStatus] FOREIGN KEY
(
[JobStatusID]
) REFERENCES [dbo].[JobStatus] (
[JobStatusID]
),
CONSTRAINT [FK_Jobs_JobType] FOREIGN KEY
(
[JobTypeID]
) REFERENCES [dbo].[JobType] (
[JobTypeID]
)
GOYou have to drop foreign key, below is the syntax:
ALTER TABLE tablename
DROP CONSTRAINT foreign key
Hope this will help you|||there is no foreign key.
that is the problem.
GAJ
"Tony-ICW Group" <tmangahas@.icwgroup.com> wrote in message
news:9FBD7415-0E78-4968-B205-ADD80526B5F2@.microsoft.com...
> You have to drop foreign key, below is the syntax:
> ALTER TABLE tablename
> DROP CONSTRAINT foreign key
> Hope this will help you|||Strange... What does sp_helpconstraint say?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Jaxon" <GregoryAJackson@.hotmail.com> wrote in message
news:O1BKuojBEHA.3748@.tk2msftngp13.phx.gbl...
> there is no foreign key.
> that is the problem.
>
> GAJ
>
> "Tony-ICW Group" <tmangahas@.icwgroup.com> wrote in message
> news:9FBD7415-0E78-4968-B205-ADD80526B5F2@.microsoft.com...
>|||does not list any FKEY on the JobStartTime Column.
I look in SQL
I look in Toad
I look everywhere
no sign of any FKEY on jobs.JobStartTime
The weird thing is, I can "Change" the index definition. I modified the
index to use a different column, etc. No issues.
I just cant drop the stupid thing.
GAJ|||Strange... Can you produce a repro? If not, I'd suspect some type of
corruption somewhere. Try DBCC CHECKDB and DBCC CHECKCATALOG.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Jaxon" <GregoryAJackson@.hotmail.com> wrote in message
news:uJ$OTasBEHA.3524@.TK2MSFTNGP10.phx.gbl...
> does not list any FKEY on the JobStartTime Column.
> I look in SQL
> I look in Toad
> I look everywhere
> no sign of any FKEY on jobs.JobStartTime
> The weird thing is, I can "Change" the index definition. I modified the
> index to use a different column, etc. No issues.
> I just cant drop the stupid thing.
>
> GAJ
>|||what's a "Repro"
I ran dbcc checkdb and all seems well.
this is very very weird
GAJ|||"Repro" = Code with which we can reproduce the error.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Jaxon" <GregoryAJackson@.hotmail.com> wrote in message
news:uCPqr9sBEHA.3064@.tk2msftngp13.phx.gbl...
> what's a "Repro"
> I ran dbcc checkdb and all seems well.
> this is very very weird
>
> GAJ
>|||the ddl is in my first post.
I wish there was something else I could give you, I'd do it in a heartbeat.
Thanks for the feedback up to now anyway
GAJ|||I'm sorry, but that is not a complete repro. There are tables that you
reference in your FK constraint which are lacking. The point of a repro is
for use to reproduce the same error message. In this case, I didn't find
anything obvious, but sometime you see the problem if you have it in front
of you. Hence the request for a repro. If you can't produce such, it might
be time for opening a case with MS...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"Jaxon" <GregoryAJackson@.hotmail.com> wrote in message
news:uSIEoBvBEHA.3344@.tk2msftngp13.phx.gbl...
> the ddl is in my first post.
> I wish there was something else I could give you, I'd do it in a
heartbeat.
> Thanks for the feedback up to now anyway
>
> GAJ
>sql
Cannot Drop Index and PK Constraints
Tuesday, March 20, 2012
Cannot Create private Time Dimension
a
private time dimension based on a datetime type column of my fact table.
after I press next button on "select advanced options" window, several
minutes passes and then a "finish" button appears in the same window
instead of next button. when I pressed finish, I got pop up message "the nam
e
cannot be an empty string" but I have no place to write the name of the
dimension.I typically discourage creating a time dimension like this. I strongly
recommend that you create an independent dimension table which incorporates
"Time". Then use the timestamps from your fact table as FKs to this
dimension. This is normally the best approach because it:
1) allows you to model data which does not exist, e.g. holidays, weekends,
etc, which are not represented in your fact table.
2) dimension processing goes much faster (i.e. you don't have to scan
multiple rows); this is particularly true here because the system will issue
a SELECT DISTINCT to process the private time dimension.
3) private dimensions must always be reprocessed when you process the fact
table -- which can greatly increase your overhead (see #2 above)
4) you will always be limited to a single partition because you can't build
across multiple fact tables (which can limit your scalability, query
response time, rolling "n" months -- all of which use multiple partitions).
5) if you create an independent time dimension table, you can have
interesting extensions to just a timestamp, e.g. model holidays, seasons,
work-days compared to weekends, etc.
--
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Banu_Tr" <Banu_Tr@.discussions.microsoft.com> wrote in message
news:ABBE65C4-C6C8-4DF5-AEB8-2DFBE6489608@.microsoft.com...
> I have a fact table with 32.000.000 rows. In cube editor , I want to
create a
> private time dimension based on a datetime type column of my fact table.
> after I press next button on "select advanced options" window, several
> minutes passes and then a "finish" button appears in the same window
> instead of next button. when I pressed finish, I got pop up message "the
name
> cannot be an empty string" but I have no place to write the name of the
> dimension.
Cannot Create private Time Dimension
private time dimension based on a datetime type column of my fact table.
after I press next button on "select advanced options" window, several
minutes passes and then a "finish" button appears in the same window
instead of next button. when I pressed finish, I got pop up message "the name
cannot be an empty string" but I have no place to write the name of the
dimension.
I typically discourage creating a time dimension like this. I strongly
recommend that you create an independent dimension table which incorporates
"Time". Then use the timestamps from your fact table as FKs to this
dimension. This is normally the best approach because it:
1) allows you to model data which does not exist, e.g. holidays, weekends,
etc, which are not represented in your fact table.
2) dimension processing goes much faster (i.e. you don't have to scan
multiple rows); this is particularly true here because the system will issue
a SELECT DISTINCT to process the private time dimension.
3) private dimensions must always be reprocessed when you process the fact
table -- which can greatly increase your overhead (see #2 above)
4) you will always be limited to a single partition because you can't build
across multiple fact tables (which can limit your scalability, query
response time, rolling "n" months -- all of which use multiple partitions).
5) if you create an independent time dimension table, you can have
interesting extensions to just a timestamp, e.g. model holidays, seasons,
work-days compared to weekends, etc.
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
This posting is provided "AS IS" with no warranties, and confers no rights.
"Banu_Tr" <Banu_Tr@.discussions.microsoft.com> wrote in message
news:ABBE65C4-C6C8-4DF5-AEB8-2DFBE6489608@.microsoft.com...
> I have a fact table with 32.000.000 rows. In cube editor , I want to
create a
> private time dimension based on a datetime type column of my fact table.
> after I press next button on "select advanced options" window, several
> minutes passes and then a "finish" button appears in the same window
> instead of next button. when I pressed finish, I got pop up message "the
name
> cannot be an empty string" but I have no place to write the name of the
> dimension.
sql
Sunday, March 11, 2012
Cannot create db diagram
When trying to create a DB diagram on my local SQL Server 2005 db, I get the following error:
cannot insert the value null into column "diagram_id"
I have searched the web and can't seem to find anything on this.
I just simply drag one table from my local db onto the diagram windows and try to Save it and that's what I get. I'm able to save diagrams on a networked SQL Server.
Does anybody know how I can resolve this issue?
Dear Bill
I am a newbie and have also experienced the same problem, on a local machine with SQL Server 2005 DE.
I have placed a similar msg on a few forums and no response to them as yet.
"MS SQL SERVER 2005 BUG? Cannot insert NULL into column diagram_id
Hi friends,
when trying to save a diagram I got an error:
The sp_creatediagram procedure attempted to return a status of NULL, which is not allowed."
Whats with this?
As far as I can work out, it has only started happening since I mucked around with the database properties such as ANSI NULLS true/false. I have put them back to default as a test and it doesnt fix the problem.
Have you got any ideas about it yet?
|||This comes from the fact that the db was a prior version of sql server (via a conversion to 2005). This will not work.
You have to create the db brand new in sql server 2005, then import data from your sql server 2000 db, etc.
|||1. start>programs>microsoft visual studio 20052. file>new project>other project types>database>datbase project
3. connect to your database
4. solution explorer>database reference
5. server explorer>diagram
6. prompt: does not support diagram create?
7. click yes|||Bill - is this thread closed or do you still need help? If this is closed out you can mark it as "answered". Thanks!|||sounds good, but i had the same problem and this didn't work for me.|||
I have the same problem - is there any work around, or fix available?
I have tried to create the diagram from SQL Server Management Studio and Visual Studio 2005.
|||Are you trying to do this against SQL Server 2000 from 2005 or the other way around? Is the database set to a compatibility mode less than 9.0?|||I have the same issue, and I have NEVER had SQL Server 2000 on any server here.
I am only getting this error on one or two of the 7 databases that I have on the SQL server instance.
--
Is there a way to delete the diagramming "stuff" so that when the create... option is chosen in Database Diagrams, it resets all of the sp's, etc.?
|||I'm not familiar with a way to do that. That isn't to say that there isn't one, so we'll leave this post open...Maybe someone will chime in!|||Hi,
I had this problem as well (SQL 2005) - I simply deleted the sysdiagrams table from System Tables and created a new diagram allowing it to automatically create the database objects. This seemed to solve the problem.
Nick
|||Hello:
This is what I did....
1. Created a Create Query for the System Tables > dbo.sysdiagrams
2. Changed the following statement:
[diagram_id] [int] DEFAULT ((0)),
3. Deleted the table: System Tables > dbo.sysdiagrams
4. Executed the modified query
5. Saved my diagram. It worked fine
6. I was even able to create and open multiple diagrams without any problems!
software786
|||Yes, this works. Ah, why isn't this fixed in SQL Server's updates?
Cannot create db diagram
When trying to create a DB diagram on my local SQL Server 2005 db, I get the following error:
cannot insert the value null into column "diagram_id"
I have searched the web and can't seem to find anything on this.
I just simply drag one table from my local db onto the diagram windows and try to Save it and that's what I get. I'm able to save diagrams on a networked SQL Server.
Does anybody know how I can resolve this issue?
Dear Bill
I am a newbie and have also experienced the same problem, on a local machine with SQL Server 2005 DE.
I have placed a similar msg on a few forums and no response to them as yet.
"MS SQL SERVER 2005 BUG? Cannot insert NULL into column diagram_id
Hi friends,
when trying to save a diagram I got an error:
The sp_creatediagram procedure attempted to return a status of NULL, which is not allowed."
Whats with this?
As far as I can work out, it has only started happening since I mucked around with the database properties such as ANSI NULLS true/false. I have put them back to default as a test and it doesnt fix the problem.
Have you got any ideas about it yet?
|||This comes from the fact that the db was a prior version of sql server (via a conversion to 2005). This will not work.
You have to create the db brand new in sql server 2005, then import data from your sql server 2000 db, etc.
|||1. start>programs>microsoft visual studio 20052. file>new project>other project types>database>datbase project
3. connect to your database
4. solution explorer>database reference
5. server explorer>diagram
6. prompt: does not support diagram create?
7. click yes|||Bill - is this thread closed or do you still need help? If this is closed out you can mark it as "answered". Thanks!|||sounds good, but i had the same problem and this didn't work for me.|||
I have the same problem - is there any work around, or fix available?
I have tried to create the diagram from SQL Server Management Studio and Visual Studio 2005.
|||Are you trying to do this against SQL Server 2000 from 2005 or the other way around? Is the database set to a compatibility mode less than 9.0?|||I have the same issue, and I have NEVER had SQL Server 2000 on any server here.
I am only getting this error on one or two of the 7 databases that I have on the SQL server instance.
--
Is there a way to delete the diagramming "stuff" so that when the create... option is chosen in Database Diagrams, it resets all of the sp's, etc.?
|||I'm not familiar with a way to do that. That isn't to say that there isn't one, so we'll leave this post open...Maybe someone will chime in!|||Hi,
I had this problem as well (SQL 2005) - I simply deleted the sysdiagrams table from System Tables and created a new diagram allowing it to automatically create the database objects. This seemed to solve the problem.
Nick
|||Hello:
This is what I did....
1. Created a Create Query for the System Tables > dbo.sysdiagrams
2. Changed the following statement:
[diagram_id] [int] DEFAULT ((0)),
3. Deleted the table: System Tables > dbo.sysdiagrams
4. Executed the modified query
5. Saved my diagram. It worked fine
6. I was even able to create and open multiple diagrams without any problems!
software786
|||Yes, this works. Ah, why isn't this fixed in SQL Server's updates?
Cannot create db diagram
When trying to create a DB diagram on my local SQL Server 2005 db, I get the following error:
cannot insert the value null into column "diagram_id"
I have searched the web and can't seem to find anything on this.
I just simply drag one table from my local db onto the diagram windows and try to Save it and that's what I get. I'm able to save diagrams on a networked SQL Server.
Does anybody know how I can resolve this issue?
Dear Bill
I am a newbie and have also experienced the same problem, on a local machine with SQL Server 2005 DE.
I have placed a similar msg on a few forums and no response to them as yet.
"MS SQL SERVER 2005 BUG? Cannot insert NULL into column diagram_id
Hi friends,
when trying to save a diagram I got an error:
The sp_creatediagram procedure attempted to return a status of NULL, which is not allowed."
Whats with this?
As far as I can work out, it has only started happening since I mucked around with the database properties such as ANSI NULLS true/false. I have put them back to default as a test and it doesnt fix the problem.
Have you got any ideas about it yet?
|||This comes from the fact that the db was a prior version of sql server (via a conversion to 2005). This will not work.
You have to create the db brand new in sql server 2005, then import data from your sql server 2000 db, etc.
|||1. start>programs>microsoft visual studio 20052. file>new project>other project types>database>datbase project
3. connect to your database
4. solution explorer>database reference
5. server explorer>diagram
6. prompt: does not support diagram create?
7. click yes|||Bill - is this thread closed or do you still need help? If this is closed out you can mark it as "answered". Thanks!|||sounds good, but i had the same problem and this didn't work for me.|||
I have the same problem - is there any work around, or fix available?
I have tried to create the diagram from SQL Server Management Studio and Visual Studio 2005.
|||Are you trying to do this against SQL Server 2000 from 2005 or the other way around? Is the database set to a compatibility mode less than 9.0?|||I have the same issue, and I have NEVER had SQL Server 2000 on any server here.
I am only getting this error on one or two of the 7 databases that I have on the SQL server instance.
--
Is there a way to delete the diagramming "stuff" so that when the create... option is chosen in Database Diagrams, it resets all of the sp's, etc.?
|||I'm not familiar with a way to do that. That isn't to say that there isn't one, so we'll leave this post open...Maybe someone will chime in!|||Hi,
I had this problem as well (SQL 2005) - I simply deleted the sysdiagrams table from System Tables and created a new diagram allowing it to automatically create the database objects. This seemed to solve the problem.
Nick
|||Hello:
This is what I did....
1. Created a Create Query for the System Tables > dbo.sysdiagrams
2. Changed the following statement:
[diagram_id] [int] DEFAULT ((0)),
3. Deleted the table: System Tables > dbo.sysdiagrams
4. Executed the modified query
5. Saved my diagram. It worked fine
6. I was even able to create and open multiple diagrams without any problems!
software786
|||Yes, this works. Ah, why isn't this fixed in SQL Server's updates?
Cannot create db diagram
When trying to create a DB diagram on my local SQL Server 2005 db, I get the following error:
cannot insert the value null into column "diagram_id"
I have searched the web and can't seem to find anything on this.
I just simply drag one table from my local db onto the diagram windows and try to Save it and that's what I get. I'm able to save diagrams on a networked SQL Server.
Does anybody know how I can resolve this issue?
Dear Bill
I am a newbie and have also experienced the same problem, on a local machine with SQL Server 2005 DE.
I have placed a similar msg on a few forums and no response to them as yet.
"MS SQL SERVER 2005 BUG? Cannot insert NULL into column diagram_id
Hi friends,
when trying to save a diagram I got an error:
The sp_creatediagram procedure attempted to return a status of NULL, which is not allowed."
Whats with this?
As far as I can work out, it has only started happening since I mucked around with the database properties such as ANSI NULLS true/false. I have put them back to default as a test and it doesnt fix the problem.
Have you got any ideas about it yet?
|||This comes from the fact that the db was a prior version of sql server (via a conversion to 2005). This will not work.
You have to create the db brand new in sql server 2005, then import data from your sql server 2000 db, etc.
|||1. start>programs>microsoft visual studio 20052. file>new project>other project types>database>datbase project
3. connect to your database
4. solution explorer>database reference
5. server explorer>diagram
6. prompt: does not support diagram create?
7. click yes|||Bill - is this thread closed or do you still need help? If this is closed out you can mark it as "answered". Thanks!|||sounds good, but i had the same problem and this didn't work for me.|||
I have the same problem - is there any work around, or fix available?
I have tried to create the diagram from SQL Server Management Studio and Visual Studio 2005.
|||Are you trying to do this against SQL Server 2000 from 2005 or the other way around? Is the database set to a compatibility mode less than 9.0?|||I have the same issue, and I have NEVER had SQL Server 2000 on any server here.
I am only getting this error on one or two of the 7 databases that I have on the SQL server instance.
--
Is there a way to delete the diagramming "stuff" so that when the create... option is chosen in Database Diagrams, it resets all of the sp's, etc.?
|||I'm not familiar with a way to do that. That isn't to say that there isn't one, so we'll leave this post open...Maybe someone will chime in!|||Hi,
I had this problem as well (SQL 2005) - I simply deleted the sysdiagrams table from System Tables and created a new diagram allowing it to automatically create the database objects. This seemed to solve the problem.
Nick
|||Hello:
This is what I did....
1. Created a Create Query for the System Tables > dbo.sysdiagrams
2. Changed the following statement:
[diagram_id] [int] DEFAULT ((0)),
3. Deleted the table: System Tables > dbo.sysdiagrams
4. Executed the modified query
5. Saved my diagram. It worked fine
6. I was even able to create and open multiple diagrams without any problems!
software786
|||Yes, this works. Ah, why isn't this fixed in SQL Server's updates?
Cannot create db diagram
When trying to create a DB diagram on my local SQL Server 2005 db, I get the following error:
cannot insert the value null into column "diagram_id"
I have searched the web and can't seem to find anything on this.
I just simply drag one table from my local db onto the diagram windows and try to Save it and that's what I get. I'm able to save diagrams on a networked SQL Server.
Does anybody know how I can resolve this issue?
Dear Bill
I am a newbie and have also experienced the same problem, on a local machine with SQL Server 2005 DE.
I have placed a similar msg on a few forums and no response to them as yet.
"MS SQL SERVER 2005 BUG? Cannot insert NULL into column diagram_id
Hi friends,
when trying to save a diagram I got an error:
The sp_creatediagram procedure attempted to return a status of NULL, which is not allowed."
Whats with this?
As far as I can work out, it has only started happening since I mucked around with the database properties such as ANSI NULLS true/false. I have put them back to default as a test and it doesnt fix the problem.
Have you got any ideas about it yet?
|||This comes from the fact that the db was a prior version of sql server (via a conversion to 2005). This will not work.
You have to create the db brand new in sql server 2005, then import data from your sql server 2000 db, etc.
|||1. start>programs>microsoft visual studio 20052. file>new project>other project types>database>datbase project
3. connect to your database
4. solution explorer>database reference
5. server explorer>diagram
6. prompt: does not support diagram create?
7. click yes|||Bill - is this thread closed or do you still need help? If this is closed out you can mark it as "answered". Thanks!|||sounds good, but i had the same problem and this didn't work for me.|||
I have the same problem - is there any work around, or fix available?
I have tried to create the diagram from SQL Server Management Studio and Visual Studio 2005.
|||Are you trying to do this against SQL Server 2000 from 2005 or the other way around? Is the database set to a compatibility mode less than 9.0?|||I have the same issue, and I have NEVER had SQL Server 2000 on any server here.
I am only getting this error on one or two of the 7 databases that I have on the SQL server instance.
--
Is there a way to delete the diagramming "stuff" so that when the create... option is chosen in Database Diagrams, it resets all of the sp's, etc.?
|||I'm not familiar with a way to do that. That isn't to say that there isn't one, so we'll leave this post open...Maybe someone will chime in!|||Hi,
I had this problem as well (SQL 2005) - I simply deleted the sysdiagrams table from System Tables and created a new diagram allowing it to automatically create the database objects. This seemed to solve the problem.
Nick
|||Hello:
This is what I did....
1. Created a Create Query for the System Tables > dbo.sysdiagrams
2. Changed the following statement:
[diagram_id] [int] DEFAULT ((0)),
3. Deleted the table: System Tables > dbo.sysdiagrams
4. Executed the modified query
5. Saved my diagram. It worked fine
6. I was even able to create and open multiple diagrams without any problems!
software786
|||Yes, this works. Ah, why isn't this fixed in SQL Server's updates?
Cannot create db diagram
When trying to create a DB diagram on my local SQL Server 2005 db, I get the following error:
cannot insert the value null into column "diagram_id"
I have searched the web and can't seem to find anything on this.
I just simply drag one table from my local db onto the diagram windows and try to Save it and that's what I get. I'm able to save diagrams on a networked SQL Server.
Does anybody know how I can resolve this issue?
Did you encounter the same issue in all of the databases in the local SQL server? Or just particular database(s)? I guess the issue is caused by a database attached from previous SQL server (2000 or 7.0), if it does, please let me know.Cannot create db diagram
When trying to create a DB diagram on my local SQL Server 2005 db, I get the following error:
cannot insert the value null into column "diagram_id"
I have searched the web and can't seem to find anything on this.
I just simply drag one table from my local db onto the diagram windows and try to Save it and that's what I get. I'm able to save diagrams on a networked SQL Server.
Does anybody know how I can resolve this issue?
Dear Bill
I am a newbie and have also experienced the same problem, on a local machine with SQL Server 2005 DE.
I have placed a similar msg on a few forums and no response to them as yet.
"MS SQL SERVER 2005 BUG? Cannot insert NULL into column diagram_id
Hi friends,
when trying to save a diagram I got an error:
The sp_creatediagram procedure attempted to return a status of NULL, which is not allowed."
Whats with this?
As far as I can work out, it has only started happening since I mucked around with the database properties such as ANSI NULLS true/false. I have put them back to default as a test and it doesnt fix the problem.
Have you got any ideas about it yet?
|||This comes from the fact that the db was a prior version of sql server (via a conversion to 2005). This will not work.
You have to create the db brand new in sql server 2005, then import data from your sql server 2000 db, etc.
|||1. start>programs>microsoft visual studio 20052. file>new project>other project types>database>datbase project
3. connect to your database
4. solution explorer>database reference
5. server explorer>diagram
6. prompt: does not support diagram create?
7. click yes|||Bill - is this thread closed or do you still need help? If this is closed out you can mark it as "answered". Thanks!|||sounds good, but i had the same problem and this didn't work for me.|||
I have the same problem - is there any work around, or fix available?
I have tried to create the diagram from SQL Server Management Studio and Visual Studio 2005.
|||Are you trying to do this against SQL Server 2000 from 2005 or the other way around? Is the database set to a compatibility mode less than 9.0?|||I have the same issue, and I have NEVER had SQL Server 2000 on any server here.
I am only getting this error on one or two of the 7 databases that I have on the SQL server instance.
--
Is there a way to delete the diagramming "stuff" so that when the create... option is chosen in Database Diagrams, it resets all of the sp's, etc.?
|||I'm not familiar with a way to do that. That isn't to say that there isn't one, so we'll leave this post open...Maybe someone will chime in!|||Hi,
I had this problem as well (SQL 2005) - I simply deleted the sysdiagrams table from System Tables and created a new diagram allowing it to automatically create the database objects. This seemed to solve the problem.
Nick
|||Hello:
This is what I did....
1. Created a Create Query for the System Tables > dbo.sysdiagrams
2. Changed the following statement:
[diagram_id] [int] DEFAULT((0)),
3. Deleted the table: System Tables > dbo.sysdiagrams
4. Executed the modified query
5. Saved my diagram. It worked fine
6. I was even able to create and open multiple diagrams without any problems!
software786
|||Yes, this works. Ah, why isn't this fixed in SQL Server's updates?
Cannot create db diagram
When trying to create a DB diagram on my local SQL Server 2005 db, I get the following error:
cannot insert the value null into column "diagram_id"
I have searched the web and can't seem to find anything on this.
I just simply drag one table from my local db onto the diagram windows and try to Save it and that's what I get. I'm able to save diagrams on a networked SQL Server.
Does anybody know how I can resolve this issue?
Dear Bill
I am a newbie and have also experienced the same problem, on a local machine with SQL Server 2005 DE.
I have placed a similar msg on a few forums and no response to them as yet.
"MS SQL SERVER 2005 BUG? Cannot insert NULL into column diagram_id
Hi friends,
when trying to save a diagram I got an error:
The sp_creatediagram procedure attempted to return a status of NULL, which is not allowed."
Whats with this?
As far as I can work out, it has only started happening since I mucked around with the database properties such as ANSI NULLS true/false. I have put them back to default as a test and it doesnt fix the problem.
Have you got any ideas about it yet?
|||This comes from the fact that the db was a prior version of sql server (via a conversion to 2005). This will not work.
You have to create the db brand new in sql server 2005, then import data from your sql server 2000 db, etc.
|||1. start>programs>microsoft visual studio 20052. file>new project>other project types>database>datbase project
3. connect to your database
4. solution explorer>database reference
5. server explorer>diagram
6. prompt: does not support diagram create?
7. click yes|||Bill - is this thread closed or do you still need help? If this is closed out you can mark it as "answered". Thanks!|||sounds good, but i had the same problem and this didn't work for me.|||
I have the same problem - is there any work around, or fix available?
I have tried to create the diagram from SQL Server Management Studio and Visual Studio 2005.
|||Are you trying to do this against SQL Server 2000 from 2005 or the other way around? Is the database set to a compatibility mode less than 9.0?|||I have the same issue, and I have NEVER had SQL Server 2000 on any server here.
I am only getting this error on one or two of the 7 databases that I have on the SQL server instance.
--
Is there a way to delete the diagramming "stuff" so that when the create... option is chosen in Database Diagrams, it resets all of the sp's, etc.?
|||I'm not familiar with a way to do that. That isn't to say that there isn't one, so we'll leave this post open...Maybe someone will chime in!|||Hi,
I had this problem as well (SQL 2005) - I simply deleted the sysdiagrams table from System Tables and created a new diagram allowing it to automatically create the database objects. This seemed to solve the problem.
Nick
|||Hello:
This is what I did....
1. Created a Create Query for the System Tables > dbo.sysdiagrams
2. Changed the following statement:
[diagram_id] [int] DEFAULT ((0)),
3. Deleted the table: System Tables > dbo.sysdiagrams
4. Executed the modified query
5. Saved my diagram. It worked fine
6. I was even able to create and open multiple diagrams without any problems!
software786
|||Yes, this works. Ah, why isn't this fixed in SQL Server's updates?
Wednesday, March 7, 2012
Cannot copy column names view result set
In SQL 2005 - when I display the results of a View and Copy all rows and columns, the resulting Paste in Excel does not include the column names.
How can I set SQL 2005 so the names of the columns will come along with the content of the copy function?
Background:
When I am using a SQL Query (instead of a view) I have the ability to control whether or not I am able to Include the Column Headers when copying or saving results. The control exists in the Options > Query Results > Results to Grid > Include column headings etc.
My question is how to get this same ability when attempting to copy the results of a VIEW vs. a Query.
Thank you,Poppa Mike
The same way. Instead of opening the view into that grid thingy, open a query window and do a select from the view.|||Yes Michael - I've thought of that but it causes me to take two steps. One to create the view and a second to get the results of the view by running a query against the view. I'd like to avoid the SQL Two-Step and just have the ability to copy the results from the view like I used to be able to do in SQL 2000. I appreciate your thoughts.
Regards, Poppa Mike
|||I was searching for the the same thing ..what i did was instead of selecting results to grid..choose the result as result to text and U can open the result file in excel and sort it out.