Wednesday, March 28, 2012
Invalid stored procedures are getting created which have errors
i'm having a strange issue with SQL server 2000 (sp3). i'm able to
create stored procedures that have critical erros. for example, i'm
able to create the following stored procedure in the tempdb table even
the the table, nor the columns exist any where. is there a setting
i've changed on the database that is supressing the validation of the
stored procedures.
CREATE PROCEDURE spAccountCustomerAdd
AS
select asdfkljasdk,dkajfk,dkjf
from blah11
any help would be appreciated..
Manny
Deferred name resolution is applied to stored procedures, which basically
means that the referenced objects aren't resolved until the SP is compiled
on first execution. There isn't an option to turn this feature off. Run the
SP to test it.
David Portas
SQL Server MVP
|||To add to David's response, one method to validate procs is to execute with
FMTONLY ON, passing any needed parameters as NULL. This will catch deferred
name resolution errors. However, the only way to completely test the proc
is to actually execute it. This is especially true with dynamic SQL.
SET FMTONLY ON
GO
EXEC spAccountCustomerAdd
GO
SET FMTONLY OFF
GO
Hope this helps.
Dan Guzman
SQL Server MVP
"Manny" <mneupane@.gmail.com> wrote in message
news:6162b3aa.0410281304.73741c5a@.posting.google.c om...
> Hello,
> i'm having a strange issue with SQL server 2000 (sp3). i'm able to
> create stored procedures that have critical erros. for example, i'm
> able to create the following stored procedure in the tempdb table even
> the the table, nor the columns exist any where. is there a setting
> i've changed on the database that is supressing the validation of the
> stored procedures.
>
> CREATE PROCEDURE spAccountCustomerAdd
> AS
> select asdfkljasdk,dkajfk,dkjf
> from blah11
>
> any help would be appreciated..
> Manny
sql
Invalid stored procedures are getting created which have errors
i'm having a strange issue with SQL server 2000 (sp3). i'm able to
create stored procedures that have critical erros. for example, i'm
able to create the following stored procedure in the tempdb table even
the the table, nor the columns exist any where. is there a setting
i've changed on the database that is supressing the validation of the
stored procedures.
CREATE PROCEDURE spAccountCustomerAdd
AS
select asdfkljasdk,dkajfk,dkjf
from blah11
any help would be appreciated..
MannyDeferred name resolution is applied to stored procedures, which basically
means that the referenced objects aren't resolved until the SP is compiled
on first execution. There isn't an option to turn this feature off. Run the
SP to test it.
David Portas
SQL Server MVP
--|||To add to David's response, one method to validate procs is to execute with
FMTONLY ON, passing any needed parameters as NULL. This will catch deferred
name resolution errors. However, the only way to completely test the proc
is to actually execute it. This is especially true with dynamic SQL.
SET FMTONLY ON
GO
EXEC spAccountCustomerAdd
GO
SET FMTONLY OFF
GO
Hope this helps.
Dan Guzman
SQL Server MVP
"Manny" <mneupane@.gmail.com> wrote in message
news:6162b3aa.0410281304.73741c5a@.posting.google.com...
> Hello,
> i'm having a strange issue with SQL server 2000 (sp3). i'm able to
> create stored procedures that have critical erros. for example, i'm
> able to create the following stored procedure in the tempdb table even
> the the table, nor the columns exist any where. is there a setting
> i've changed on the database that is supressing the validation of the
> stored procedures.
>
> CREATE PROCEDURE spAccountCustomerAdd
> AS
> select asdfkljasdk,dkajfk,dkjf
> from blah11
>
> any help would be appreciated..
> Manny
Invalid stored procedures are getting created which have errors
i'm having a strange issue with SQL server 2000 (sp3). i'm able to
create stored procedures that have critical erros. for example, i'm
able to create the following stored procedure in the tempdb table even
the the table, nor the columns exist any where. is there a setting
i've changed on the database that is supressing the validation of the
stored procedures.
CREATE PROCEDURE spAccountCustomerAdd
AS
select asdfkljasdk,dkajfk,dkjf
from blah11
any help would be appreciated..
MannyDeferred name resolution is applied to stored procedures, which basically
means that the referenced objects aren't resolved until the SP is compiled
on first execution. There isn't an option to turn this feature off. Run the
SP to test it.
--
David Portas
SQL Server MVP
--|||To add to David's response, one method to validate procs is to execute with
FMTONLY ON, passing any needed parameters as NULL. This will catch deferred
name resolution errors. However, the only way to completely test the proc
is to actually execute it. This is especially true with dynamic SQL.
SET FMTONLY ON
GO
EXEC spAccountCustomerAdd
GO
SET FMTONLY OFF
GO
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Manny" <mneupane@.gmail.com> wrote in message
news:6162b3aa.0410281304.73741c5a@.posting.google.com...
> Hello,
> i'm having a strange issue with SQL server 2000 (sp3). i'm able to
> create stored procedures that have critical erros. for example, i'm
> able to create the following stored procedure in the tempdb table even
> the the table, nor the columns exist any where. is there a setting
> i've changed on the database that is supressing the validation of the
> stored procedures.
>
> CREATE PROCEDURE spAccountCustomerAdd
> AS
> select asdfkljasdk,dkajfk,dkjf
> from blah11
>
> any help would be appreciated..
> Manny
Monday, March 26, 2012
Invalid Primary Key error during table linking
Something strange has happened to my table. I used Enterprise Manager today to delete 3 columns. When I went to re-link the table using Access Linked Table Manager, it gave me an error. I then deleted the link to the table, and tried to Link it again using 'Get External Data--Link Tables'. I am getting an error (no surprise!):
" 'dbo.tblSpaceUse.PK_RoomID' is not a valid name. Make sure that it does not include invalid characters or punctuation and that it is not too long".
When I go into Enterprise Manager to 'manage Indexes' on the table, it shows me that the existing index is in fact dbo.tblSpaceUse.PK_RoomID.
About a month ago, I had to rename the index, because it had been pointing to the wrong table. The SQL I used to rename it (in Query Analyzer) is:
EXEC sp_rename 'dbo.tblSpaceUse.PK_RoomID', 'tblSpaceUse.PK_RoomID', 'INDEX'
I have been using the table successfully since then, until today. I have not done anything with the index; the only change I attempted was to delete 3 columns (not related to the index). I do not think I have made any changes to the table since I renamed the index.
I tried to run the rename SQL again (a desperate attempt!) and get the error message:
Server: Msg 15248, Level 11, State 1, Procedure sp_rename, Line 192
Either the parameter @.objname is ambiguous or the claimed @.objtype (INDEX) is wrong.
Any ideas on what went wrong and what I can do to fix it?
Thanks,
Lorihave fixed the problem by creating the table anew. thanks anyway.
Friday, March 23, 2012
Invalid Object Name - Weird Error - Help!
listed in SysObjects, but does not show up in the tables list.
When I execte "Select * From Object_Access_Levels", it raises the error "Invalid
Object Name".
If I try to [Drop Table Object_Access_Levels], it returns the error:
"Cannot drop the table 'Object_Access_Levels' because it does not exist in the
system catalog."
If I follow the ID for the table to Syscolumns and SysIndexes, all the records
are there.
This is a complete show-stopper. I cannot continue development until this table
is restored.
Here's a copy of the record from sysobjects:
name,id,xtype,uid,info,status,base_schema_ver,replinfo,parent_obj,crdate,ftcatid,
schema_ver,stats_schema_ver,type,userstat,sysstat,indexdel,refdate,version,deltri
g,instrig,updtrig,seltrig,category,cache
"Object_Access_Levels",1858821684,"U ",1,17,8451,272,0,0,"07/12/2002
02:09pm",0,272,0,"U ",1,115,0,"07/12/2002 02:09pm",0,,,,0,2560,0
Does anyone have a clue how I can fix this problem?
I am using SQL2K with SP3a.
TIA,
-Steve-Who is the owner of the object? I always make sure to create my tables this
way:
CREATE TABLE dbo.Object_Access_Levels
And always reference them with the prefix also:
SELECT * FROM dbo.Object_Access_Levels
DROP TABLE dbo.Object_Access_Levels
You can see the owner name by:
SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'Object_Access_Levels'
If TABLE_SCHEMA is not dbo, you should drop and re-create the table as dbo,
and always refer to it with the dbo. prefix.
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Steve Zimmelman" <sk_z@.psi_med.com> wrote in message
news:e50xOxeYEHA.808@.tk2msftngp13.phx.gbl...
>I have a really strange problem. It seems a table has gone invisible.
>It's
> listed in SysObjects, but does not show up in the tables list.
> When I execte "Select * From Object_Access_Levels", it raises the error
> "Invalid
> Object Name".
> If I try to [Drop Table Object_Access_Levels], it returns the error:
> "Cannot drop the table 'Object_Access_Levels' because it does not exist in
> the
> system catalog."
> If I follow the ID for the table to Syscolumns and SysIndexes, all the
> records
> are there.
> This is a complete show-stopper. I cannot continue development until this
> table
> is restored.
> Here's a copy of the record from sysobjects:
> name,id,xtype,uid,info,status,base_schema_ver,replinfo,parent_obj,crdate,ftcatid,
> schema_ver,stats_schema_ver,type,userstat,sysstat,indexdel,refdate,version,deltri
> g,instrig,updtrig,seltrig,category,cache
> "Object_Access_Levels",1858821684,"U ",1,17,8451,272,0,0,"07/12/2002
> 02:09pm",0,272,0,"U ",1,115,0,"07/12/2002 02:09pm",0,,,,0,2560,0
> Does anyone have a clue how I can fix this problem?
> I am using SQL2K with SP3a.
> TIA,
> -Steve-
>|||You may want to run DBCC CHECKCATALOG to check the system
tables.
Mark Baekdal
www.dbghost.com - the only true Database Change Manager
for SQL Server.
>--Original Message--
>I have a really strange problem. It seems a table has
gone invisible. It's
>listed in SysObjects, but does not show up in the tables
list.
>When I execte "Select * From Object_Access_Levels", it
raises the error "Invalid
>Object Name".
>If I try to [Drop Table Object_Access_Levels], it
returns the error:
> "Cannot drop the table 'Object_Access_Levels' because
it does not exist in the
>system catalog."
>If I follow the ID for the table to Syscolumns and
SysIndexes, all the records
>are there.
>This is a complete show-stopper. I cannot continue
development until this table
>is restored.
>Here's a copy of the record from sysobjects:
>name,id,xtype,uid,info,status,base_schema_ver,replinfo,pa
rent_obj,crdate,ftcatid,
>schema_ver,stats_schema_ver,type,userstat,sysstat,indexde
l,refdate,version,deltri
>g,instrig,updtrig,seltrig,category,cache
>"Object_Access_Levels",1858821684,"U ",1,17,8451,272,0,0,
"07/12/2002
>02:09pm",0,272,0,"U ",1,115,0,"07/12/2002
02:09pm",0,,,,0,2560,0
>Does anyone have a clue how I can fix this problem?
>I am using SQL2K with SP3a.
>TIA,
>-Steve-
>
>.
>|||Thanks Aaron,
The table has been in use for over a year. Everything was fine last week during
development. Then yesterday, I tried to run the app and got the error during the
load.
This SQL command returns an empty result.
[SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'Object_Access_Levels']
But as I stated, the table is listed in the SyObjects, SysIndexes, and
SysColumns.
Running: DBCC CHECKCATALOG ('MedMas') WITH NO_INFOMSGS
Returns this error:
[Table Corrupt: Object ID 1840725610 (object '1840725610') does not match between
'SYSCOLUMNS' and 'SYSOBJECTS']
It looks like SQL's internal table got hosed. Is there any way to fix this
without completely rebuilding the database?
-Steve-
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:%239t8NTfYEHA.4004@.TK2MSFTNGP10.phx.gbl...
Who is the owner of the object? I always make sure to create my tables this
way:
CREATE TABLE dbo.Object_Access_Levels
And always reference them with the prefix also:
SELECT * FROM dbo.Object_Access_Levels
DROP TABLE dbo.Object_Access_Levels
You can see the owner name by:
SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'Object_Access_Levels'
If TABLE_SCHEMA is not dbo, you should drop and re-create the table as dbo,
and always refer to it with the dbo. prefix.
--
http://www.aspfaq.com/
(Reverse address to reply.)|||Hi Mark,
Running: DBCC CHECKCATALOG ('MedMas') WITH NO_INFOMSGS
Returns this error:
[Table Corrupt: Object ID 1840725610 (object '1840725610') does not match between
'SYSCOLUMNS' and 'SYSOBJECTS']
Is this fixable without rebuilding the database?
Thanks,
-Steve-
"mark baekdal" <anonymous@.discussions.microsoft.com> wrote in message
news:26ebb01c46255$b2dbd4b0$a301280a@.phx.gbl...
You may want to run DBCC CHECKCATALOG to check the system
tables.
Mark Baekdal
www.dbghost.com - the only true Database Change Manager
for SQL Server.|||BTW, I just checked the ID 1840725610, it doesn't belong the Object_Access_Levels
table. It belongs to a couple of params. I think this DB is really hosed!
-Steve-
"Steve Zimmelman" <sk_z@.psi_med.com> wrote in message
news:%23JR2N$oYEHA.1764@.TK2MSFTNGP10.phx.gbl...
Hi Mark,
Running: DBCC CHECKCATALOG ('MedMas') WITH NO_INFOMSGS
Returns this error:
[Table Corrupt: Object ID 1840725610 (object '1840725610') does not match between
'SYSCOLUMNS' and 'SYSOBJECTS']
Is this fixable without rebuilding the database?
Thanks,
-Steve-
"mark baekdal" <anonymous@.discussions.microsoft.com> wrote in message
news:26ebb01c46255$b2dbd4b0$a301280a@.phx.gbl...
You may want to run DBCC CHECKCATALOG to check the system
tables.
Mark Baekdal
www.dbghost.com - the only true Database Change Manager
for SQL Server.|||Steve,
Any idea what error message(s) you were getting? If
error 2513, check SQL Books Online for steps to possibly
resolve the inconsistency. Please ensure you have a
backup or copy of the .mdf & .ldf before you do anything.
HTH
Darren Fuller
>--Original Message--
>Hi Mark,
>Running: DBCC CHECKCATALOG ('MedMas') WITH NO_INFOMSGS
>Returns this error:
>[Table Corrupt: Object ID 1840725610
(object '1840725610') does not match between
>'SYSCOLUMNS' and 'SYSOBJECTS']
>Is this fixable without rebuilding the database?
>Thanks,
>-Steve-
>"mark baekdal" <anonymous@.discussions.microsoft.com>
wrote in message
>news:26ebb01c46255$b2dbd4b0$a301280a@.phx.gbl...
>You may want to run DBCC CHECKCATALOG to check the system
>tables.
>Mark Baekdal
>www.dbghost.com - the only true Database Change Manager
>for SQL Server.
>
>.
>|||After much wasted time, I restored an old copy of the db. I was under the
impression (apparently a false one) that SQL server didn't have these types
corruption problems.
Thanks everyone for your suggestions.
-Steve-|||Your impression is not false, we don't have these types of corruption
problems.
However, hardware can and does introduce all manner of corruptions that
manifest themselves in various ways. I would check your NT event logs and
SQL errorlog for IO susbsystem errors. Before restoring from your backup, I
would have recommended running DBCC CHECKDB to check for other corruptions.
In future, to avoid wasting time, you should call Product Support who will
be able to help you pinpoint the problem very quickly.
Regards.
--
Paul Randal
Dev Lead, Microsoft SQL Server Storage Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"Steve Zimmelman" <sk_z@.psi_med.com> wrote in message
news:ermVPB6YEHA.1048@.tk2msftngp13.phx.gbl...
> After much wasted time, I restored an old copy of the db. I was under the
> impression (apparently a false one) that SQL server didn't have these
types
> corruption problems.
> Thanks everyone for your suggestions.
> -Steve-
>
Invalid Object Name - Weird Error - Help!
listed in SysObjects, but does not show up in the tables list.
When I execte "Select * From Object_Access_Levels", it raises the error "Inv
alid
Object Name".
If I try to [Drop Table Object_Access_Levels], it returns the error:
"Cannot drop the table 'Object_Access_Levels' because it does not exist in t
he
system catalog."
If I follow the ID for the table to Syscolumns and SysIndexes, all the recor
ds
are there.
This is a complete show-stopper. I cannot continue development until this t
able
is restored.
Here's a copy of the record from sysobjects:
name,id,xtype,uid,info,status,base_schem
a_ver,replinfo,parent_obj,crdate,ftc
atid,
schema_ver,stats_schema_ver,type,usersta
t,sysstat,indexdel,refdate,version,d
eltri
g,instrig,updtrig,seltrig,category,cache
"Object_Access_Levels",1858821684,"U ",1,17,8451,272,0,0,"07/12/2002
02:09pm",0,272,0,"U ",1,115,0,"07/12/2002 02:09pm",0,,,,0,2560,0
Does anyone have a clue how I can fix this problem?
I am using SQL2K with SP3a.
TIA,
-Steve-Who is the owner of the object? I always make sure to create my tables this
way:
CREATE TABLE dbo.Object_Access_Levels
And always reference them with the prefix also:
SELECT * FROM dbo.Object_Access_Levels
DROP TABLE dbo.Object_Access_Levels
You can see the owner name by:
SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'Object_Access_Levels'
If TABLE_SCHEMA is not dbo, you should drop and re-create the table as dbo,
and always refer to it with the dbo. prefix.
http://www.aspfaq.com/
(Reverse address to reply.)
"Steve Zimmelman" <sk_z@.psi_med.com> wrote in message
news:e50xOxeYEHA.808@.tk2msftngp13.phx.gbl...
>I have a really strange problem. It seems a table has gone invisible.
>It's
> listed in SysObjects, but does not show up in the tables list.
> When I execte "Select * From Object_Access_Levels", it raises the error
> "Invalid
> Object Name".
> If I try to [Drop Table Object_Access_Levels], it returns the error:
> "Cannot drop the table 'Object_Access_Levels' because it does not exist in
> the
> system catalog."
> If I follow the ID for the table to Syscolumns and SysIndexes, all the
> records
> are there.
> This is a complete show-stopper. I cannot continue development until this
> table
> is restored.
> Here's a copy of the record from sysobjects:
> name,id,xtype,uid,info,status,base_schem
a_ver,replinfo,parent_obj,crdate,f
tcatid,
> schema_ver,stats_schema_ver,type,usersta
t,sysstat,indexdel,refdate,version
,deltri
> g,instrig,updtrig,seltrig,category,cache
> "Object_Access_Levels",1858821684,"U ",1,17,8451,272,0,0,"07/12/2002
> 02:09pm",0,272,0,"U ",1,115,0,"07/12/2002 02:09pm",0,,,,0,2560,0
> Does anyone have a clue how I can fix this problem?
> I am using SQL2K with SP3a.
> TIA,
> -Steve-
>|||Thanks Aaron,
The table has been in use for over a year. Everything was fine last week du
ring
development. Then yesterday, I tried to run the app and got the error durin
g the
load.
This SQL command returns an empty result.
[SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'Object_Access_Levels']
But as I stated, the table is listed in the SyObjects, SysIndexes, and
SysColumns.
Running: DBCC CHECKCATALOG ('MedMas') WITH NO_INFOMSGS
Returns this error:
[Table Corrupt: Object ID 1840725610 (object '1840725610') does not matc
h between
'SYSCOLUMNS' and 'SYSOBJECTS']
It looks like SQL's internal table got hosed. Is there any way to fix this
without completely rebuilding the database?
-Steve-
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:%239t8NTfYEHA.4004@.TK2MSFTNGP10.phx.gbl...
Who is the owner of the object? I always make sure to create my tables this
way:
CREATE TABLE dbo.Object_Access_Levels
And always reference them with the prefix also:
SELECT * FROM dbo.Object_Access_Levels
DROP TABLE dbo.Object_Access_Levels
You can see the owner name by:
SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'Object_Access_Levels'
If TABLE_SCHEMA is not dbo, you should drop and re-create the table as dbo,
and always refer to it with the dbo. prefix.
http://www.aspfaq.com/
(Reverse address to reply.)sql
Invalid Object Name - Weird Error - Help!
listed in SysObjects, but does not show up in the tables list.
When I execte "Select * From Object_Access_Levels", it raises the error "Invalid
Object Name".
If I try to [Drop Table Object_Access_Levels], it returns the error:
"Cannot drop the table 'Object_Access_Levels' because it does not exist in the
system catalog."
If I follow the ID for the table to Syscolumns and SysIndexes, all the records
are there.
This is a complete show-stopper. I cannot continue development until this table
is restored.
Here's a copy of the record from sysobjects:
name,id,xtype,uid,info,status,base_schema_ver,repl info,parent_obj,crdate,ftcatid,
schema_ver,stats_schema_ver,type,userstat,sysstat, indexdel,refdate,version,deltri
g,instrig,updtrig,seltrig,category,cache
"Object_Access_Levels",1858821684,"U ",1,17,8451,272,0,0,"07/12/2002
02:09pm",0,272,0,"U ",1,115,0,"07/12/2002 02:09pm",0,,,,0,2560,0
Does anyone have a clue how I can fix this problem?
I am using SQL2K with SP3a.
TIA,
-Steve-
Who is the owner of the object? I always make sure to create my tables this
way:
CREATE TABLE dbo.Object_Access_Levels
And always reference them with the prefix also:
SELECT * FROM dbo.Object_Access_Levels
DROP TABLE dbo.Object_Access_Levels
You can see the owner name by:
SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'Object_Access_Levels'
If TABLE_SCHEMA is not dbo, you should drop and re-create the table as dbo,
and always refer to it with the dbo. prefix.
http://www.aspfaq.com/
(Reverse address to reply.)
"Steve Zimmelman" <sk_z@.psi_med.com> wrote in message
news:e50xOxeYEHA.808@.tk2msftngp13.phx.gbl...
>I have a really strange problem. It seems a table has gone invisible.
>It's
> listed in SysObjects, but does not show up in the tables list.
> When I execte "Select * From Object_Access_Levels", it raises the error
> "Invalid
> Object Name".
> If I try to [Drop Table Object_Access_Levels], it returns the error:
> "Cannot drop the table 'Object_Access_Levels' because it does not exist in
> the
> system catalog."
> If I follow the ID for the table to Syscolumns and SysIndexes, all the
> records
> are there.
> This is a complete show-stopper. I cannot continue development until this
> table
> is restored.
> Here's a copy of the record from sysobjects:
> name,id,xtype,uid,info,status,base_schema_ver,repl info,parent_obj,crdate,ftcatid,
> schema_ver,stats_schema_ver,type,userstat,sysstat, indexdel,refdate,version,deltri
> g,instrig,updtrig,seltrig,category,cache
> "Object_Access_Levels",1858821684,"U ",1,17,8451,272,0,0,"07/12/2002
> 02:09pm",0,272,0,"U ",1,115,0,"07/12/2002 02:09pm",0,,,,0,2560,0
> Does anyone have a clue how I can fix this problem?
> I am using SQL2K with SP3a.
> TIA,
> -Steve-
>
|||Thanks Aaron,
The table has been in use for over a year. Everything was fine last week during
development. Then yesterday, I tried to run the app and got the error during the
load.
This SQL command returns an empty result.
[SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'Object_Access_Levels']
But as I stated, the table is listed in the SyObjects, SysIndexes, and
SysColumns.
Running: DBCC CHECKCATALOG ('MedMas') WITH NO_INFOMSGS
Returns this error:
[Table Corrupt: Object ID 1840725610 (object '1840725610') does not match between
'SYSCOLUMNS' and 'SYSOBJECTS']
It looks like SQL's internal table got hosed. Is there any way to fix this
without completely rebuilding the database?
-Steve-
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:%239t8NTfYEHA.4004@.TK2MSFTNGP10.phx.gbl...
Who is the owner of the object? I always make sure to create my tables this
way:
CREATE TABLE dbo.Object_Access_Levels
And always reference them with the prefix also:
SELECT * FROM dbo.Object_Access_Levels
DROP TABLE dbo.Object_Access_Levels
You can see the owner name by:
SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'Object_Access_Levels'
If TABLE_SCHEMA is not dbo, you should drop and re-create the table as dbo,
and always refer to it with the dbo. prefix.
http://www.aspfaq.com/
(Reverse address to reply.)
Monday, March 12, 2012
Invalid column name ''prov''. For me, very very strange!
Can someone se whats wrong here!
DECLARE @.TEMP table (ID int, FILENAME nvarchar(255), GOgo nvarchar(5))
INSERT INTO @.TEMP
select * , SUBSTRING(FILENAME, len(FILENAME) -1, 1) as GOgo
from mytable
group by GOgo
order by ID desc
Msg 207, Level 16, State 1, Procedure GET_STAT, Line 102
Invalid column name 'prov'.
For me, very very strange!
Does the SELECT work when you're not doing an insert? Does "SELECT * FROM mytable" work?
|||Always mention the column name explicitly to avoid these kind of confusion
INSERT INTO @.TEMP (ID,Filename,GoGo)
select Col1,col2,SUBSTRING(FILENAME, len(FILENAME) -1, 1) as GOgo
from mytable
group by GOgo
order by ID desc
Check this code
Madhu
Invalid column name ''prov''. For me, very very strange!
Can someone se whats wrong here!
DECLARE @.TEMP table (ID int, FILENAME nvarchar(255), GOgo nvarchar(5))
INSERT INTO @.TEMP
select * , SUBSTRING(FILENAME, len(FILENAME) -1, 1) as GOgo
from mytable
group by GOgo
order by ID desc
Msg 207, Level 16, State 1, Procedure GET_STAT, Line 102
Invalid column name 'prov'.
For me, very very strange!
Does the SELECT work when you're not doing an insert? Does "SELECT * FROM mytable" work?
|||Always mention the column name explicitly to avoid these kind of confusion
INSERT INTO @.TEMP (ID,Filename,GoGo)
select Col1,col2,SUBSTRING(FILENAME, len(FILENAME) -1, 1) as GOgo
from mytable
group by GOgo
order by ID desc
Check this code
Madhu
Invalid column name ''prov''. For me, very very strange!
Can someone se whats wrong here!
DECLARE @.TEMP table (ID int, FILENAME nvarchar(255), GOgo nvarchar(5))
INSERT INTO @.TEMP
select * , SUBSTRING(FILENAME, len(FILENAME) -1, 1) as GOgo
from mytable
group by GOgo
order by ID desc
Msg 207, Level 16, State 1, Procedure GET_STAT, Line 102
Invalid column name 'prov'.
For me, very very strange!
Does the SELECT work when you're not doing an insert? Does "SELECT * FROM mytable" work?
|||Always mention the column name explicitly to avoid these kind of confusion
INSERT INTO @.TEMP (ID,Filename,GoGo)
select Col1,col2,SUBSTRING(FILENAME, len(FILENAME) -1, 1) as GOgo
from mytable
group by GOgo
order by ID desc
Check this code
Madhu