Showing posts with label bit. Show all posts
Showing posts with label bit. Show all posts

Wednesday, March 21, 2012

Invalid object name

Hi Folks,

Need a bit of help with a problem I'm having:

ODBC Error Code = S0002 (Base table not found)
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
'UsersVsPages'.

SQL = "delete from Pages Where Page_Key = 147"

The above error message is returned when running a piece of code. The
table "UsersVsPages" that can't be found did exist but I dropped it
when it became unnecessary. I also set up a diagram with cascading
deletes etc. This is where I'm guessing the problem originates but
having looked through the relationships of "Pages" I have been unable
to find any reference to "UsersVsPages".

Can anyone point me in the right direction?

Thanks

Dave A."David Armstrong" <ukprototype@.yahoo.com> wrote in message
news:307ccadf.0407070835.7934080f@.posting.google.c om...
> Hi Folks,
> Need a bit of help with a problem I'm having:
> ODBC Error Code = S0002 (Base table not found)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
> 'UsersVsPages'.
>
> SQL = "delete from Pages Where Page_Key = 147"
>
> The above error message is returned when running a piece of code. The
> table "UsersVsPages" that can't be found did exist but I dropped it
> when it became unnecessary. I also set up a diagram with cascading
> deletes etc. This is where I'm guessing the problem originates but
> having looked through the relationships of "Pages" I have been unable
> to find any reference to "UsersVsPages".
> Can anyone point me in the right direction?
>
> Thanks
> Dave A.

Another possibility might be a trigger which still references the old table.
If that's not the case, you could use Profiler to watch the SQL sent to the
server, to make sure it's really executing what you think it is.

Simon|||Thanks very much Simon, it was a trigger. Being new to MSSQL I wasn't
aware of this feature. Again thanks for the help.

Dave A.

"Simon Hayes" <sql@.hayes.ch> wrote in message news:<40ec33b7$1_3@.news.bluewin.ch>...
> "David Armstrong" <ukprototype@.yahoo.com> wrote in message
> news:307ccadf.0407070835.7934080f@.posting.google.c om...
> > Hi Folks,
> > Need a bit of help with a problem I'm having:
> > ODBC Error Code = S0002 (Base table not found)
> > [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name
> > 'UsersVsPages'.
> > SQL = "delete from Pages Where Page_Key = 147"
> > The above error message is returned when running a piece of code. The
> > table "UsersVsPages" that can't be found did exist but I dropped it
> > when it became unnecessary. I also set up a diagram with cascading
> > deletes etc. This is where I'm guessing the problem originates but
> > having looked through the relationships of "Pages" I have been unable
> > to find any reference to "UsersVsPages".
> > Can anyone point me in the right direction?
> > Thanks
> > Dave A.
> Another possibility might be a trigger which still references the old table.
> If that's not the case, you could use Profiler to watch the SQL sent to the
> server, to make sure it's really executing what you think it is.
> Simon

Monday, March 19, 2012

Invalid descriptor index

Good day
I have a simple transactional replication set up between two SQL2000
servers. A single table is replicated with columns of type int, bit and
varchar. The server with the subscription has had SP3 for quite some time,
however after we installed SP3 on the publishing server, we started receiving
an "Invalid descriptor index" error when trying to start the distribution
agent on the publishing server.
Does anyone have an idea why this would happen and how to fix this problem?
Thanks
I have removed the replication and set it up again, however I am still
receiving the invalid descriptor index error...?
"Pieter" wrote:

> Good day
> I have a simple transactional replication set up between two SQL2000
> servers. A single table is replicated with columns of type int, bit and
> varchar. The server with the subscription has had SP3 for quite some time,
> however after we installed SP3 on the publishing server, we started receiving
> an "Invalid descriptor index" error when trying to start the distribution
> agent on the publishing server.
> Does anyone have an idea why this would happen and how to fix this problem?
> Thanks

Monday, March 12, 2012

Invalid column name 'dbid'?

Hi,
I modified sp_helplogins a bit and made it just return the results about
one certain database (In this case, dbid is 30). So I added the condition
'l.dbid=30' to the following statement. But running the modified
sp_helplogins returned error "Invalid column name 'dbid'".
My master database does not have a table called syslogins, instead the table
is sysxlogins. But the original sp_helplogins which uses syslogins table
runs fine. I'm confused. What did I do wrong? Appreciate any help.
-- Add the User info to holding table.
select @.exec_stmt = '
INSERT #tb1_UA
(
DBName
,LoginName
,UserName
,UserOrAlias
)
Select
N' + quotename(@.c10DBName, '''') + '
,l.loginname
,u.name
,''User''
from
' + quotename(@.c10DBName, '[') + '.dbo.sysusers u
,master.dbo.syslogins l
where
l.dbid = 30 AND u.sid = l.sid AND isaliased=0' +
case @.LoginNamePattern
when null then ''
else ' and ( l.name = N' +
quotename(@.LoginNamePattern ,
'''') + '
or l.loginname = N' +
quotename(@.LoginNamePattern , '''') + ')'
end
+
' UNION
Select
N' + quotename(@.c10DBName, '''') + '
,l.loginname
,u2.name
,''MemberOf''
from
' + quotename(@.c10DBName, '[')+ '.dbo.sysmembers m
,' + quotename(@.c10DBName, '[')+ '.dbo.sysusers u1
,' + quotename(@.c10DBName, '[')+ '.dbo.sysusers u2
,master.dbo.syslogins l
where
l.dbid = 30 and u1.sid = l.sid
and m.memberuid = u1.uid
and m.groupuid = u2.uid' +
case @.LoginNamePattern
when null then ''
else ' and ( l.name = N' +
quotename(@.LoginNamePattern ,
'''') + '
or l.loginname = N' +
quotename(@.LoginNamePattern , '''') + ')'
end
EXECUTE(@.exec_stmt)
end --loop 10
Thanks,
Bing
After looking more, looks like syslogins is a view on the sysxlogins table.
'dbid' is not a field in sysloigns. Hmmm..
"bing" wrote:

> Hi,
> I modified sp_helplogins a bit and made it just return the results about
> one certain database (In this case, dbid is 30). So I added the condition
> 'l.dbid=30' to the following statement. But running the modified
> sp_helplogins returned error "Invalid column name 'dbid'".
> My master database does not have a table called syslogins, instead the table
> is sysxlogins. But the original sp_helplogins which uses syslogins table
> runs fine. I'm confused. What did I do wrong? Appreciate any help.
> -- Add the User info to holding table.
> select @.exec_stmt = '
> INSERT #tb1_UA
> (
> DBName
> ,LoginName
> ,UserName
> ,UserOrAlias
> )
> Select
> N' + quotename(@.c10DBName, '''') + '
> ,l.loginname
> ,u.name
> ,''User''
> from
> ' + quotename(@.c10DBName, '[') + '.dbo.sysusers u
> ,master.dbo.syslogins l
> where
> l.dbid = 30 AND u.sid = l.sid AND isaliased=0' +
> case @.LoginNamePattern
> when null then ''
> else ' and ( l.name = N' +
> quotename(@.LoginNamePattern ,
> '''') + '
> or l.loginname = N' +
> quotename(@.LoginNamePattern , '''') + ')'
> end
> +
> ' UNION
> Select
> N' + quotename(@.c10DBName, '''') + '
> ,l.loginname
> ,u2.name
> ,''MemberOf''
> from
> ' + quotename(@.c10DBName, '[')+ '.dbo.sysmembers m
> ,' + quotename(@.c10DBName, '[')+ '.dbo.sysusers u1
> ,' + quotename(@.c10DBName, '[')+ '.dbo.sysusers u2
> ,master.dbo.syslogins l
> where
> l.dbid = 30 and u1.sid = l.sid
> and m.memberuid = u1.uid
> and m.groupuid = u2.uid' +
> case @.LoginNamePattern
> when null then ''
> else ' and ( l.name = N' +
> quotename(@.LoginNamePattern ,
> '''') + '
> or l.loginname = N' +
> quotename(@.LoginNamePattern , '''') + ')'
> end
> EXECUTE(@.exec_stmt)
> end --loop 10
> --
> Thanks,
> Bing
>

Invalid column name 'dbid'?

Hi,
I modified sp_helplogins a bit and made it just return the results about
one certain database (In this case, dbid is 30). So I added the condition
'l.dbid=30' to the following statement. But running the modified
sp_helplogins returned error "Invalid column name 'dbid'".
My master database does not have a table called syslogins, instead the table
is sysxlogins. But the original sp_helplogins which uses syslogins table
runs fine. I'm confused. What did I do wrong? Appreciate any help.
-- Add the User info to holding table.
select @.exec_stmt = '
INSERT #tb1_UA
(
DBName
,LoginName
,UserName
,UserOrAlias
)
Select
N' + quotename(@.c10DBName, '''') + '
,l.loginname
,u.name
,''User''
from
' + quotename(@.c10DBName, '[') + '.dbo.sysusers u
,master.dbo.syslogins l
where
l.dbid = 30 AND u.sid = l.sid AND isaliased=0' +
case @.LoginNamePattern
when null then ''
else ' and ( l.name = N' +
quotename(@.LoginNamePattern ,
'''') + '
or l.loginname = N' +
quotename(@.LoginNamePattern , '''') + ')'
end
+
' UNION
Select
N' + quotename(@.c10DBName, '''') + '
,l.loginname
,u2.name
,''MemberOf''
from
' + quotename(@.c10DBName, '[')+ '.dbo.sysmembers m
,' + quotename(@.c10DBName, '[')+ '.dbo.sysusers u1
,' + quotename(@.c10DBName, '[')+ '.dbo.sysusers u2
,master.dbo.syslogins l
where
l.dbid = 30 and u1.sid = l.sid
and m.memberuid = u1.uid
and m.groupuid = u2.uid' +
case @.LoginNamePattern
when null then ''
else ' and ( l.name = N' +
quotename(@.LoginNamePattern ,
'''') + '
or l.loginname = N' +
quotename(@.LoginNamePattern , '''') + ')'
end
EXECUTE(@.exec_stmt)
end --loop 10
--
Thanks,
BingAfter looking more, looks like syslogins is a view on the sysxlogins table.
'dbid' is not a field in sysloigns. Hmmm..
"bing" wrote:

> Hi,
> I modified sp_helplogins a bit and made it just return the results about
> one certain database (In this case, dbid is 30). So I added the condition
> 'l.dbid=30' to the following statement. But running the modified
> sp_helplogins returned error "Invalid column name 'dbid'".
> My master database does not have a table called syslogins, instead the tab
le
> is sysxlogins. But the original sp_helplogins which uses syslogins table
> runs fine. I'm confused. What did I do wrong? Appreciate any help.
> -- Add the User info to holding table.
> select @.exec_stmt = '
> INSERT #tb1_UA
> (
> DBName
> ,LoginName
> ,UserName
> ,UserOrAlias
> )
> Select
> N' + quotename(@.c10DBName, '''') + '
> ,l.loginname
> ,u.name
> ,''User''
> from
> ' + quotename(@.c10DBName, '[') + '.dbo.sysusers u
> ,master.dbo.syslogins l
> where
> l.dbid = 30 AND u.sid = l.sid AND isaliased=0' +
> case @.LoginNamePattern
> when null then ''
> else ' and ( l.name = N' +
> quotename(@.LoginNamePattern ,
> '''') + '
> or l.loginname = N' +
> quotename(@.LoginNamePattern , '''') + ')'
> end
> +
> ' UNION
> Select
> N' + quotename(@.c10DBName, '''') + '
> ,l.loginname
> ,u2.name
> ,''MemberOf''
> from
> ' + quotename(@.c10DBName, '[')+ '.dbo.sysmembers m
> ,' + quotename(@.c10DBName, '[')+ '.dbo.sysusers u1
> ,' + quotename(@.c10DBName, '[')+ '.dbo.sysusers u2
> ,master.dbo.syslogins l
> where
> l.dbid = 30 and u1.sid = l.sid
> and m.memberuid = u1.uid
> and m.groupuid = u2.uid' +
> case @.LoginNamePattern
> when null then ''
> else ' and ( l.name = N' +
> quotename(@.LoginNamePattern ,
> '''') + '
> or l.loginname = N' +
> quotename(@.LoginNamePattern , '''') + ')'
> end
> EXECUTE(@.exec_stmt)
> end --loop 10
> --
> Thanks,
> Bing
>

Invalid column name 'dbid'?

Hi,
I modified sp_helplogins a bit and made it just return the results about
one certain database (In this case, dbid is 30). So I added the condition
'l.dbid=30' to the following statement. But running the modified
sp_helplogins returned error "Invalid column name 'dbid'".
My master database does not have a table called syslogins, instead the table
is sysxlogins. But the original sp_helplogins which uses syslogins table
runs fine. I'm confused. What did I do wrong? Appreciate any help.
-- Add the User info to holding table.
select @.exec_stmt = '
INSERT #tb1_UA
(
DBName
,LoginName
,UserName
,UserOrAlias
)
Select
N' + quotename(@.c10DBName, '''') + '
,l.loginname
,u.name
,''User''
from
' + quotename(@.c10DBName, '[') + '.dbo.sysusers u
,master.dbo.syslogins l
where
l.dbid = 30 AND u.sid = l.sid AND isaliased=0' +
case @.LoginNamePattern
when null then ''
else ' and ( l.name = N' +
quotename(@.LoginNamePattern ,
'''') + '
or l.loginname = N' +
quotename(@.LoginNamePattern , '''') + ')'
end
+
' UNION
Select
N' + quotename(@.c10DBName, '''') + '
,l.loginname
,u2.name
,''MemberOf''
from
' + quotename(@.c10DBName, '[')+ '.dbo.sysmembers m
,' + quotename(@.c10DBName, '[')+ '.dbo.sysusers u1
,' + quotename(@.c10DBName, '[')+ '.dbo.sysusers u2
,master.dbo.syslogins l
where
l.dbid = 30 and u1.sid = l.sid
and m.memberuid = u1.uid
and m.groupuid = u2.uid' +
case @.LoginNamePattern
when null then ''
else ' and ( l.name = N' +
quotename(@.LoginNamePattern ,
'''') + '
or l.loginname = N' +
quotename(@.LoginNamePattern , '''') + ')'
end
EXECUTE(@.exec_stmt)
end --loop 10
--
Thanks,
BingAfter looking more, looks like syslogins is a view on the sysxlogins table.
'dbid' is not a field in sysloigns. Hmmm..
"bing" wrote:
> Hi,
> I modified sp_helplogins a bit and made it just return the results about
> one certain database (In this case, dbid is 30). So I added the condition
> 'l.dbid=30' to the following statement. But running the modified
> sp_helplogins returned error "Invalid column name 'dbid'".
> My master database does not have a table called syslogins, instead the table
> is sysxlogins. But the original sp_helplogins which uses syslogins table
> runs fine. I'm confused. What did I do wrong? Appreciate any help.
> -- Add the User info to holding table.
> select @.exec_stmt = '
> INSERT #tb1_UA
> (
> DBName
> ,LoginName
> ,UserName
> ,UserOrAlias
> )
> Select
> N' + quotename(@.c10DBName, '''') + '
> ,l.loginname
> ,u.name
> ,''User''
> from
> ' + quotename(@.c10DBName, '[') + '.dbo.sysusers u
> ,master.dbo.syslogins l
> where
> l.dbid = 30 AND u.sid = l.sid AND isaliased=0' +
> case @.LoginNamePattern
> when null then ''
> else ' and ( l.name = N' +
> quotename(@.LoginNamePattern ,
> '''') + '
> or l.loginname = N' +
> quotename(@.LoginNamePattern , '''') + ')'
> end
> +
> ' UNION
> Select
> N' + quotename(@.c10DBName, '''') + '
> ,l.loginname
> ,u2.name
> ,''MemberOf''
> from
> ' + quotename(@.c10DBName, '[')+ '.dbo.sysmembers m
> ,' + quotename(@.c10DBName, '[')+ '.dbo.sysusers u1
> ,' + quotename(@.c10DBName, '[')+ '.dbo.sysusers u2
> ,master.dbo.syslogins l
> where
> l.dbid = 30 and u1.sid = l.sid
> and m.memberuid = u1.uid
> and m.groupuid = u2.uid' +
> case @.LoginNamePattern
> when null then ''
> else ' and ( l.name = N' +
> quotename(@.LoginNamePattern ,
> '''') + '
> or l.loginname = N' +
> quotename(@.LoginNamePattern , '''') + ')'
> end
> EXECUTE(@.exec_stmt)
> end --loop 10
> --
> Thanks,
> Bing
>