Hey, if anyone here can help me with this it would save my life. Okay maybe not that, but it could save my job. In taking some code and adapting it to my needs I'm wondering if I've missed something I needed. I admitedly don't know enough about .NET or SQL 2k Stored Procedure Programming....anyways here is my situation. I have this SP I've ran though lots and lots of bugs, and I'm hung on this one. My Output is comming up DBNull. Here is the code (and yes I know it should pull 6 records right now). Ignore the ALTER PROC.------------------------------------------------------ALTER PROCEDURE dbo.sp_GetAllTicketsPaged @CurrentPage int, @PageSize int, @TotalRecords int outputAS --Create a temp table to hold the current page of data --Add and ID column to count the records CREATE TABLE #TempTable ( ID int IDENTITY PRIMARY KEY, Ticket_ID INT, Ticket_Author_ID INT, Creation_Date datetime, Tech_Start_DT datetime, Issue varchar (200), Part_ID varchar (12), Priority varchar (20), Status varchar (20), NotesPublic varchar (2000), NotesPrivate varchar (4000), Company varchar (60), ContactPerson varchar (60), Phone varchar (14), eMail varchar (90) ) --Fill the temp table with the Customers data INSERT INTO #TempTable ( Ticket_ID, Ticket_Author_ID, Creation_Date, Tech_Start_DT, Issue, Part_ID, Priority, Status, NotesPublic, NotesPrivate, Company, ContactPerson, Phone, eMail ) SELECT dbo.Tickets.Ticket_ID, dbo.Tickets.Ticket_Author_ID, dbo.Tickets.Creation_Date, dbo.Tickets.Tech_Start_DT, dbo.Tickets.Issue, dbo.Tickets.Part_ID, dbo.Tickets.Priority, dbo.Tickets.Status, dbo.Tickets.NotesPublic, dbo.Tickets.NotesPrivate, dbo.TicketAuthor.Company, dbo.TicketAuthor.ContactPerson, dbo.TicketAuthor.Phone, dbo.TicketAuthor.eMail FROM dbo.TicketAuthor FULL OUTER JOIN dbo.Tickets ON dbo.TicketAuthor.Ticket_Author_ID = dbo.Tickets.Ticket_Author_ID WHERE dbo.TicketAuthor.Ticket_Author_ID = dbo.Tickets.Ticket_Author_ID RETURN --Create variable to identify the first and last record that should be selected DECLARE @FirstRec int, @LastRec int SELECT @FirstRec = (@CurrentPage - 1) * @PageSize SELECT @LastRec = (@CurrentPage * @PageSize + 1) --Select one page of data based on the record numbers above SELECT * FROM #TempTable WHERE ID > @FirstRec AND ID < @LastRec --Return the total number of records available as an output parameter SELECT @TotalRecords = COUNT(*) FROM #TempTable
------------------------------------------------------Need more code? Need more Info? You Can actually help me? Let me know. And my good Karma and fortune smile upon you today.Oh and the Original SP can be found here. [url]http://www.dotnetjunkies.com/Tutorial/EA868776-D71E-448A-BC23-B64B871F967F.dcik[/url]