Wednesday, March 28, 2012
IAM page (0:0) is pointed to by the previous pointer of IAM page (
IAM page (0:0) is pointed to by the previous pointer of IAM page (1:867)
object ID 992722589 index ID 0 but was not detected in the scan.
Server: Msg 2577, Level 16, State 1, Line 1
Chain sequence numbers are out of order in IAM chain for object ID
992722589, index ID 0. Page (1:867) sequence number 1 points to page
(1:48122) sequence number 0.
I get this error every time I run DBCC CHECKALLOC(DBName). The page number
is always the same but, the location of the error in the output moves on each
subsequent run. The Object ID does not exist in sysindexes, syscolumns,
sysdepends or sysobjects. I have put the DB in single user mode and run DBCC
CHECKDB(DBNAME, repair_allow_data_loss). It says it cannot repair the DB.
Going to a previous backup is not an option so I am getting ready to bcp all
of the data to a new database. Are there any other options for this?
-Alan-Couple of things...
If the 'ID' column is still unique, then check if its got a unique
constraint on, if not then put it on.
If that doe't work take off the foreign key from all tables referencing the
table which ID is part of and do your CHECKALLOC again.
If that doesn't work then have a look at
http://support.microsoft.com/kb/816084
Peter
"sqlsleuth" wrote:
> Server: Msg 2576, Level 16, State 1, Line 1
> IAM page (0:0) is pointed to by the previous pointer of IAM page (1:867)
> object ID 992722589 index ID 0 but was not detected in the scan.
> Server: Msg 2577, Level 16, State 1, Line 1
> Chain sequence numbers are out of order in IAM chain for object ID
> 992722589, index ID 0. Page (1:867) sequence number 1 points to page
> (1:48122) sequence number 0.
> I get this error every time I run DBCC CHECKALLOC(DBName). The page number
> is always the same but, the location of the error in the output moves on each
> subsequent run. The Object ID does not exist in sysindexes, syscolumns,
> sysdepends or sysobjects. I have put the DB in single user mode and run DBCC
> CHECKDB(DBNAME, repair_allow_data_loss). It says it cannot repair the DB.
> Going to a previous backup is not an option so I am getting ready to bcp all
> of the data to a new database. Are there any other options for this?
> -Alan-|||The Object ID
992722589 does not exist so there is nothing to check. Each time DBCC
CHECKALLOC is run it appears in the results of a different table.
"Peter Nolan" wrote:
> Couple of things...
> If the 'ID' column is still unique, then check if its got a unique
> constraint on, if not then put it on.
> If that doe't work take off the foreign key from all tables referencing the
> table which ID is part of and do your CHECKALLOC again.
> If that doesn't work then have a look at
> http://support.microsoft.com/kb/816084
> Peter
>
>
> "sqlsleuth" wrote:
> > Server: Msg 2576, Level 16, State 1, Line 1
> > IAM page (0:0) is pointed to by the previous pointer of IAM page (1:867)
> > object ID 992722589 index ID 0 but was not detected in the scan.
> > Server: Msg 2577, Level 16, State 1, Line 1
> > Chain sequence numbers are out of order in IAM chain for object ID
> > 992722589, index ID 0. Page (1:867) sequence number 1 points to page
> > (1:48122) sequence number 0.
> >
> > I get this error every time I run DBCC CHECKALLOC(DBName). The page number
> > is always the same but, the location of the error in the output moves on each
> > subsequent run. The Object ID does not exist in sysindexes, syscolumns,
> > sysdepends or sysobjects. I have put the DB in single user mode and run DBCC
> > CHECKDB(DBNAME, repair_allow_data_loss). It says it cannot repair the DB.
> > Going to a previous backup is not an option so I am getting ready to bcp all
> > of the data to a new database. Are there any other options for this?
> >
> > -Alan-|||What about http://support.microsoft.com/kb/816084 ?
Do you have auto statisics turned on ?
Are there any unique constraints in the tables themselves ?
The reason I'm going down this route is that occasionally when bulk loading
stuff I take off primary keys, indexes ect but somehow the system doesn't
register it properly and still thinks there something there, it could be as
part of the sysindexes or the statistics.
When it happened to me I re-established my primary key indexes ect.
You could also try dropping you statistics are re-establishing them.
Anyways thats about all I can help you, good luck and I hope you get a
successful resolution.
Peter
Peter
"sqlsleuth" wrote:
> The Object ID
> 992722589 does not exist so there is nothing to check. Each time DBCC
> CHECKALLOC is run it appears in the results of a different table.
> "Peter Nolan" wrote:
> > Couple of things...
> >
> > If the 'ID' column is still unique, then check if its got a unique
> > constraint on, if not then put it on.
> >
> > If that doe't work take off the foreign key from all tables referencing the
> > table which ID is part of and do your CHECKALLOC again.
> >
> > If that doesn't work then have a look at
> > http://support.microsoft.com/kb/816084
> >
> > Peter
> >
> >
> >
> >
> > "sqlsleuth" wrote:
> >
> > > Server: Msg 2576, Level 16, State 1, Line 1
> > > IAM page (0:0) is pointed to by the previous pointer of IAM page (1:867)
> > > object ID 992722589 index ID 0 but was not detected in the scan.
> > > Server: Msg 2577, Level 16, State 1, Line 1
> > > Chain sequence numbers are out of order in IAM chain for object ID
> > > 992722589, index ID 0. Page (1:867) sequence number 1 points to page
> > > (1:48122) sequence number 0.
> > >
> > > I get this error every time I run DBCC CHECKALLOC(DBName). The page number
> > > is always the same but, the location of the error in the output moves on each
> > > subsequent run. The Object ID does not exist in sysindexes, syscolumns,
> > > sysdepends or sysobjects. I have put the DB in single user mode and run DBCC
> > > CHECKDB(DBNAME, repair_allow_data_loss). It says it cannot repair the DB.
> > > Going to a previous backup is not an option so I am getting ready to bcp all
> > > of the data to a new database. Are there any other options for this?
> > >
> > > -Alan-|||Auto Statistics is on and there are a large number of unique constraints in
the tables. I can try to run the suggested fixes on the backup database and
see if it helps.
Thanks for the help.
"Peter Nolan" wrote:
> What about http://support.microsoft.com/kb/816084 ?
> Do you have auto statisics turned on ?
> Are there any unique constraints in the tables themselves ?
> The reason I'm going down this route is that occasionally when bulk loading
> stuff I take off primary keys, indexes ect but somehow the system doesn't
> register it properly and still thinks there something there, it could be as
> part of the sysindexes or the statistics.
> When it happened to me I re-established my primary key indexes ect.
> You could also try dropping you statistics are re-establishing them.
> Anyways thats about all I can help you, good luck and I hope you get a
> successful resolution.
> Peter
> Peter
> "sqlsleuth" wrote:
> > The Object ID
> > 992722589 does not exist so there is nothing to check. Each time DBCC
> > CHECKALLOC is run it appears in the results of a different table.
> >
> > "Peter Nolan" wrote:
> >
> > > Couple of things...
> > >
> > > If the 'ID' column is still unique, then check if its got a unique
> > > constraint on, if not then put it on.
> > >
> > > If that doe't work take off the foreign key from all tables referencing the
> > > table which ID is part of and do your CHECKALLOC again.
> > >
> > > If that doesn't work then have a look at
> > > http://support.microsoft.com/kb/816084
> > >
> > > Peter
> > >
> > >
> > >
> > >
> > > "sqlsleuth" wrote:
> > >
> > > > Server: Msg 2576, Level 16, State 1, Line 1
> > > > IAM page (0:0) is pointed to by the previous pointer of IAM page (1:867)
> > > > object ID 992722589 index ID 0 but was not detected in the scan.
> > > > Server: Msg 2577, Level 16, State 1, Line 1
> > > > Chain sequence numbers are out of order in IAM chain for object ID
> > > > 992722589, index ID 0. Page (1:867) sequence number 1 points to page
> > > > (1:48122) sequence number 0.
> > > >
> > > > I get this error every time I run DBCC CHECKALLOC(DBName). The page number
> > > > is always the same but, the location of the error in the output moves on each
> > > > subsequent run. The Object ID does not exist in sysindexes, syscolumns,
> > > > sysdepends or sysobjects. I have put the DB in single user mode and run DBCC
> > > > CHECKDB(DBNAME, repair_allow_data_loss). It says it cannot repair the DB.
> > > > Going to a previous backup is not an option so I am getting ready to bcp all
> > > > of the data to a new database. Are there any other options for this?
> > > >
> > > > -Alan-|||For complete troubleshooting of the above error message, you will need to firstly analyze the exact reason for the corruption of sequence numbers of IAM pages. If the corruption is caused due to hardware failure, then change the hardware component. However, in case of software corruption, run DBCC CHECKDB command with appropriate repair clause to repair the database.
DBCC CHECKDB command allows complete repair in most cases. But, if in case the command fails, then the only option is to use a advanced SQL Recovery software.
IAM page (0:0) is pointed to by the previous pointer of IAM page (
IAM page (0:0) is pointed to by the previous pointer of IAM page (1:867)
object ID 992722589 index ID 0 but was not detected in the scan.
Server: Msg 2577, Level 16, State 1, Line 1
Chain sequence numbers are out of order in IAM chain for object ID
992722589, index ID 0. Page (1:867) sequence number 1 points to page
(1:48122) sequence number 0.
I get this error every time I run DBCC CHECKALLOC(DBName). The page number
is always the same but, the location of the error in the output moves on each
subsequent run. The Object ID does not exist in sysindexes, syscolumns,
sysdepends or sysobjects. I have put the DB in single user mode and run DBCC
CHECKDB(DBNAME, repair_allow_data_loss). It says it cannot repair the DB.
Going to a previous backup is not an option so I am getting ready to bcp all
of the data to a new database. Are there any other options for this?
-Alan-
Couple of things...
If the 'ID' column is still unique, then check if its got a unique
constraint on, if not then put it on.
If that doe't work take off the foreign key from all tables referencing the
table which ID is part of and do your CHECKALLOC again.
If that doesn't work then have a look at
http://support.microsoft.com/kb/816084
Peter
"sqlsleuth" wrote:
> Server: Msg 2576, Level 16, State 1, Line 1
> IAM page (0:0) is pointed to by the previous pointer of IAM page (1:867)
> object ID 992722589 index ID 0 but was not detected in the scan.
> Server: Msg 2577, Level 16, State 1, Line 1
> Chain sequence numbers are out of order in IAM chain for object ID
> 992722589, index ID 0. Page (1:867) sequence number 1 points to page
> (1:48122) sequence number 0.
> I get this error every time I run DBCC CHECKALLOC(DBName). The page number
> is always the same but, the location of the error in the output moves on each
> subsequent run. The Object ID does not exist in sysindexes, syscolumns,
> sysdepends or sysobjects. I have put the DB in single user mode and run DBCC
> CHECKDB(DBNAME, repair_allow_data_loss). It says it cannot repair the DB.
> Going to a previous backup is not an option so I am getting ready to bcp all
> of the data to a new database. Are there any other options for this?
> -Alan-
IAM page (0:0) is pointed to by the previous pointer of IAM page (
IAM page (0:0) is pointed to by the previous pointer of IAM page (1:867)
object ID 992722589 index ID 0 but was not detected in the scan.
Server: Msg 2577, Level 16, State 1, Line 1
Chain sequence numbers are out of order in IAM chain for object ID
992722589, index ID 0. Page (1:867) sequence number 1 points to page
(1:48122) sequence number 0.
I get this error every time I run DBCC CHECKALLOC(DBName). The page number
is always the same but, the location of the error in the output moves on eac
h
subsequent run. The Object ID does not exist in sysindexes, syscolumns,
sysdepends or sysobjects. I have put the DB in single user mode and run DBC
C
CHECKDB(DBNAME, repair_allow_data_loss). It says it cannot repair the DB.
Going to a previous backup is not an option so I am getting ready to bcp all
of the data to a new database. Are there any other options for this?
-Alan-Couple of things...
If the 'ID' column is still unique, then check if its got a unique
constraint on, if not then put it on.
If that doe't work take off the foreign key from all tables referencing the
table which ID is part of and do your CHECKALLOC again.
If that doesn't work then have a look at
http://support.microsoft.com/kb/816084
Peter
"sqlsleuth" wrote:
> Server: Msg 2576, Level 16, State 1, Line 1
> IAM page (0:0) is pointed to by the previous pointer of IAM page (1:867)
> object ID 992722589 index ID 0 but was not detected in the scan.
> Server: Msg 2577, Level 16, State 1, Line 1
> Chain sequence numbers are out of order in IAM chain for object ID
> 992722589, index ID 0. Page (1:867) sequence number 1 points to page
> (1:48122) sequence number 0.
> I get this error every time I run DBCC CHECKALLOC(DBName). The page numbe
r
> is always the same but, the location of the error in the output moves on e
ach
> subsequent run. The Object ID does not exist in sysindexes, syscolumns,
> sysdepends or sysobjects. I have put the DB in single user mode and run D
BCC
> CHECKDB(DBNAME, repair_allow_data_loss). It says it cannot repair the DB.
> Going to a previous backup is not an option so I am getting ready to bcp a
ll
> of the data to a new database. Are there any other options for this?
> -Alan-sql
IAM error?
have:
Table error: IAM page (1:511426) (object ID 2, index ID 255) is out of the
range of this database.
This error can only be fixed by running dbcc checkdb allow_data_loss. Can
anyone tell me what may be causing this error and what I can change or avoid
so it stops happening?
TIA
jjYou have corruption in the database. Unless you have backups from before
you got the corruption you are probably going to have to loose some data by
running CHECKDB as mentioned. The first choice is always try to restore
from known good backups though.
--
Andrew J. Kelly SQL MVP
"jj" <jeff_detoro@.urmc.rochester.edu> wrote in message
news:u%2311wOGwFHA.2808@.TK2MSFTNGP10.phx.gbl...
>I have gotten the following error a few times on just one database that I
>have:
> Table error: IAM page (1:511426) (object ID 2, index ID 255) is out of the
> range of this database.
> This error can only be fixed by running dbcc checkdb allow_data_loss. Can
> anyone tell me what may be causing this error and what I can change or
> avoid so it stops happening?
> TIA
> jj
>|||Actually I fixed the errors with the aforementioned script but since I only
have these errors on this one db every few months I'm wondering what's going
on.
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:%23nGwJ$HwFHA.3556@.TK2MSFTNGP12.phx.gbl...
> You have corruption in the database. Unless you have backups from before
> you got the corruption you are probably going to have to loose some data
> by running CHECKDB as mentioned. The first choice is always try to
> restore from known good backups though.
> --
> Andrew J. Kelly SQL MVP
>
> "jj" <jeff_detoro@.urmc.rochester.edu> wrote in message
> news:u%2311wOGwFHA.2808@.TK2MSFTNGP10.phx.gbl...
>>I have gotten the following error a few times on just one database that I
>>have:
>> Table error: IAM page (1:511426) (object ID 2, index ID 255) is out of
>> the range of this database.
>> This error can only be fixed by running dbcc checkdb allow_data_loss. Can
>> anyone tell me what may be causing this error and what I can change or
>> avoid so it stops happening?
>> TIA
>> jj
>|||Sounds like you have hardware problems. That is the most common cause of
corruption these days. Fixing the problem with DBCC CHECKDB is not the best
solution. You loose data each time you fix it that way. Do you know what
data you lost? Your database is no longer solid with regards to data
integrity but you haven't a clue as to where. Not a good situation to be
in.
--
Andrew J. Kelly SQL MVP
"jj" <jeff_detoro@.urmc.rochester.edu> wrote in message
news:OLEZlDIwFHA.664@.tk2msftngp13.phx.gbl...
> Actually I fixed the errors with the aforementioned script but since I
> only have these errors on this one db every few months I'm wondering
> what's going on.
>
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:%23nGwJ$HwFHA.3556@.TK2MSFTNGP12.phx.gbl...
>> You have corruption in the database. Unless you have backups from before
>> you got the corruption you are probably going to have to loose some data
>> by running CHECKDB as mentioned. The first choice is always try to
>> restore from known good backups though.
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "jj" <jeff_detoro@.urmc.rochester.edu> wrote in message
>> news:u%2311wOGwFHA.2808@.TK2MSFTNGP10.phx.gbl...
>>I have gotten the following error a few times on just one database that I
>>have:
>> Table error: IAM page (1:511426) (object ID 2, index ID 255) is out of
>> the range of this database.
>> This error can only be fixed by running dbcc checkdb allow_data_loss.
>> Can anyone tell me what may be causing this error and what I can change
>> or avoid so it stops happening?
>> TIA
>> jj
>>
>
IAM error?
have:
Table error: IAM page (1:511426) (object ID 2, index ID 255) is out of the
range of this database.
This error can only be fixed by running dbcc checkdb allow_data_loss. Can
anyone tell me what may be causing this error and what I can change or avoid
so it stops happening?
TIA
jj
You have corruption in the database. Unless you have backups from before
you got the corruption you are probably going to have to loose some data by
running CHECKDB as mentioned. The first choice is always try to restore
from known good backups though.
Andrew J. Kelly SQL MVP
"jj" <jeff_detoro@.urmc.rochester.edu> wrote in message
news:u%2311wOGwFHA.2808@.TK2MSFTNGP10.phx.gbl...
>I have gotten the following error a few times on just one database that I
>have:
> Table error: IAM page (1:511426) (object ID 2, index ID 255) is out of the
> range of this database.
> This error can only be fixed by running dbcc checkdb allow_data_loss. Can
> anyone tell me what may be causing this error and what I can change or
> avoid so it stops happening?
> TIA
> jj
>
|||Actually I fixed the errors with the aforementioned script but since I only
have these errors on this one db every few months I'm wondering what's going
on.
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:%23nGwJ$HwFHA.3556@.TK2MSFTNGP12.phx.gbl...
> You have corruption in the database. Unless you have backups from before
> you got the corruption you are probably going to have to loose some data
> by running CHECKDB as mentioned. The first choice is always try to
> restore from known good backups though.
> --
> Andrew J. Kelly SQL MVP
>
> "jj" <jeff_detoro@.urmc.rochester.edu> wrote in message
> news:u%2311wOGwFHA.2808@.TK2MSFTNGP10.phx.gbl...
>
|||Sounds like you have hardware problems. That is the most common cause of
corruption these days. Fixing the problem with DBCC CHECKDB is not the best
solution. You loose data each time you fix it that way. Do you know what
data you lost? Your database is no longer solid with regards to data
integrity but you haven't a clue as to where. Not a good situation to be
in.
Andrew J. Kelly SQL MVP
"jj" <jeff_detoro@.urmc.rochester.edu> wrote in message
news:OLEZlDIwFHA.664@.tk2msftngp13.phx.gbl...
> Actually I fixed the errors with the aforementioned script but since I
> only have these errors on this one db every few months I'm wondering
> what's going on.
>
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:%23nGwJ$HwFHA.3556@.TK2MSFTNGP12.phx.gbl...
>
IAM error?
have:
Table error: IAM page (1:511426) (object ID 2, index ID 255) is out of the
range of this database.
This error can only be fixed by running dbcc checkdb allow_data_loss. Can
anyone tell me what may be causing this error and what I can change or avoid
so it stops happening?
TIA
jjYou have corruption in the database. Unless you have backups from before
you got the corruption you are probably going to have to loose some data by
running CHECKDB as mentioned. The first choice is always try to restore
from known good backups though.
Andrew J. Kelly SQL MVP
"jj" <jeff_detoro@.urmc.rochester.edu> wrote in message
news:u%2311wOGwFHA.2808@.TK2MSFTNGP10.phx.gbl...
>I have gotten the following error a few times on just one database that I
>have:
> Table error: IAM page (1:511426) (object ID 2, index ID 255) is out of the
> range of this database.
> This error can only be fixed by running dbcc checkdb allow_data_loss. Can
> anyone tell me what may be causing this error and what I can change or
> avoid so it stops happening?
> TIA
> jj
>|||Actually I fixed the errors with the aforementioned script but since I only
have these errors on this one db every few months I'm wondering what's going
on.
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:%23nGwJ$HwFHA.3556@.TK2MSFTNGP12.phx.gbl...
> You have corruption in the database. Unless you have backups from before
> you got the corruption you are probably going to have to loose some data
> by running CHECKDB as mentioned. The first choice is always try to
> restore from known good backups though.
> --
> Andrew J. Kelly SQL MVP
>
> "jj" <jeff_detoro@.urmc.rochester.edu> wrote in message
> news:u%2311wOGwFHA.2808@.TK2MSFTNGP10.phx.gbl...
>|||Sounds like you have hardware problems. That is the most common cause of
corruption these days. Fixing the problem with DBCC CHECKDB is not the best
solution. You loose data each time you fix it that way. Do you know what
data you lost? Your database is no longer solid with regards to data
integrity but you haven't a clue as to where. Not a good situation to be
in.
Andrew J. Kelly SQL MVP
"jj" <jeff_detoro@.urmc.rochester.edu> wrote in message
news:OLEZlDIwFHA.664@.tk2msftngp13.phx.gbl...
> Actually I fixed the errors with the aforementioned script but since I
> only have these errors on this one db every few months I'm wondering
> what's going on.
>
> "Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
> news:%23nGwJ$HwFHA.3556@.TK2MSFTNGP12.phx.gbl...
>
Monday, March 12, 2012
I TRIED THE PACKAGE AND IT FAILS ALL THE TIME
I think I am missing something, and this something I could achieve with Enterprise Manager. How do I copy one object, lke a table, including primary keys, indexed and triggers, plus data, from one SQL Server to another, or a set of tables? I am at a loss. Of I choose "Copy Data", that is not the same because the table data is copied, but nothing else, not even the primary key gets transferred. So the arriving table is --quite frankly-- useless. What do I do with a table that lacks keys, constraints, indexes and triggers?. On the other hand, I don't see any click-and-shoot way to transfer the missing information for one single or a few tables together. If I script the table, the table gets dropped and recreated, so I lose the data. In the older Enterprise Manager, you cold choose "transfer objects", and everything moved along, data and script, so the arriving table could be used immediately.
Am I going blind or somebody dropped the ball here?
-Jamie|||Jamie is correct. The transfer objects functionality does not appear in the wizard, but is available in the SSIS package designer.|||[Transfer SQL Server Objects Task] Error: Execution failed with the following error: "Cannot apply value null to property Login: Value cannot be null..".
To make the problem more clear: I don't need to transfer logins, just the tables, views, stored procedures, user data types, user-defined functions and defaults.
I think that Microsoft watered down the Enterprise Manager, and is doing exactly what they did with VB6 on Vb.NET, take away the best of the tool: in that case it was change-and-contine, and in the case, the wizards became useless. In any case, I built a package and get the error above all the time, no matter what database I intend transfer from SQL 2000. How do I get around this? I can not start working until I transfer my objects and data, so I need some help here, not just some philosophical advice.
If it takes a lot of steps to achieve what we did with one single wizard, the somebody dropped the ball at Microsof. The "Export Data" should allow the user to select all the details of the transfer. I manage close to 20 SQL Server production machines, and I use that transfer wizard day in and day out.|||Funny you bring this up, we were doing some migrations earlier. I have blogged about it here: http://jason.blogsource.com/
Hope this helps steer you in the right direction...|||I read you blog but I can not guess what the reaso for my error is. Any ideas?|||I was referring to your earlier problem: where you could get tbl structures but not data.... The method I illustrated does add extra steps but is a way if you are desperate.|||
So I assume that you in fact used a package to transfer entire databases from SQL 2000 to SQL 2005 and it worked? you never got the error that I am getting?
Message: Execution failed with the following error: "Cannot apply value null to property Login: Value cannot be null..".
I wonder what is possibly the matter.
I only get the first character of the field returned .. what am i doing wrong ?
here is my business/data object for some reason I only get the first character back, say value is Charlie, I only get C
public string GetUserName(long UserId) {try {string userName; DiscussionDB data =new DiscussionDB(); List paramlist =new List(); paramlist.Add(data.CreateParameter("@.UserId", UserId)); paramlist.Add(data.CreateParameter("@.UserName","", ParameterDirection.Output, DbType.String, 20)); data.ExecuteNonQuery("dbo.Discussion_User_Name",ref paramlist); userName = paramlist[1].Value.ToString();return userName; }catch {throw; } }ALTER PROCEDURE [dbo].[Discussion_User_Name]@.UserId bigint,@.UserName varchar(20) outputASSET NOCOUNT ONSET @.UserName = (Select [Name] from Discussion_Member WHERE UserID = @.UserID)if (@.UserNameis null or @.UserName ='')BEGIN SET @.UserName = (Select UserName from Membership_User WHERE UserID = @.UserID)END hello,
It does not seem that thre is anything wrong with the code.
Have you checked the size of the columns "Name" and "UserName" in Discussion_Member and/or Membership_User ?
hope this helps?
regards,
g
|||If you run the stored procedure using the sql server tools, does it return the correct result?
|||yes when I run the SP in MS sever 2005 studio, I get the full field ... e.g Charlie
|||You need to set the size of @.UserName, the default is 1. There's a size property toIDbDataParameter that you need to set (it looks like your DiscussionDB is wrapping IDbDataParameter and some other stuff)
|||I tried wording your suggestion in my code by I can't seem to figure it out
I was thinking that the 20in the code below was giving the size
paramlist.Add(data.CreateParameter("@.UserName","", ParameterDirection.Output, DbType.String, 20));
|||I thought I got this working but I was wrong
I am still having this issue, here is my last code
public string GetUserName(long UserId) {try {string userName; DiscussionDB data =new DiscussionDB(); List paramlist =new List(); paramlist.Add(data.CreateParameter("@.UserId", UserId)); paramlist.Add(data.CreateParameter("@.UserName","", ParameterDirection.Output, DbType.String, 15)); paramlist[1].Size = 15; data.ExecuteNonQuery("dbo.Discussion_User_Name_Fetch",ref paramlist); userName = paramlist[1].Value.ToString();return userName; }catch {throw; } }