Showing posts with label contact. Show all posts
Showing posts with label contact. Show all posts

Wednesday, March 7, 2012

Removing individual results from a paged set of results.

Hi,

I have a web form that lets users search for people in my database they wish to contact. The database returns a paged set of results using a CTE, Top X, and Row_number().

I would like to give my users to option of removing individual people from this list but cannot find a way to do this.

I have tried creating a session variable with a comma delimited list of ID's that I pass to my sproc and use in a NOT IN() statement. But I keep getting a "Input string was not in a correct format." Error Message.

Is there any way to do this? I am still new to stored procedures so any advice would be helpful.

Thanks

The only way I know to do it is to use dynamic sql.

|||

Can you post your SQL stored procedure? Its a lot easier to give suggestions if we can see what we're working with. There are several ways to do this, but I'd like to see what I'm working with before I make a suggestion.

Stu

|||

This is the SPROC I am currently working with without any code to remove individual rows.

CREATE PROCEDURE [dbo].[zk_update_request_england]
(
@.property_type tinyint,
@.market_status tinyint,
@.price int,
@.bedrooms tinyint,
@.search_location varchar(30),
@.PageSize int,
@.PageIndex int,
@.TRV int,
@.topx int,
@.TotalRequests int OUTPUT
)

AS

SET NOCOUNT ON

BEGIN

-- Set Paging limits
Declare @.firstRow Int;
Declare @.lastRow Int;
Set @.firstRow = (@.PageIndex * @.PageSize) + 1;
Set @.lastRow = @.firstRow + @.PageSize - 1;


-- Load count into @.TotalRequests
Set @.TotalRequests = (SELECT Count(*)
FROM [dbo].[zk_request_england]
WHERE property_type = @.property_type
AND market_status = @.market_status
AND bedrooms <= @.bedrooms
AND search_location = @.search_location
AND min_price <= @.price
AND max_price >= @.price)


-- If @.TotalRequests is less than @.topx change @.topx to @.TotalRequests
IF @.TotalRequests <= @.topx
SET @.topx = @.TotalRequests
ELSE
SET @.TotalRequests = @.topx
;

WITH SearchResults AS
(
SELECT TOP(@.topx) ROW_NUMBER() OVER (ORDER BY max_price DESC) AS RowNumber,
id,
user_name,
bedrooms,
min_price,
max_price,
property_description,
searched
FROM [dbo].[zk_request_england]
WHERE property_type = @.property_type
AND market_status = @.market_status
AND bedrooms <= @.bedrooms
AND search_location = @.search_location
AND min_price <= @.price
AND max_price >= @.price
)

SELECT id,
user_name,
bedrooms,
min_price,
max_price,
property_description
FROM SearchResults
WHERE RowNumber BETWEEN @.firstRow and @.lastRow

END

SET NOCOUNT OFF

Removing Field Creation Limitations in a BCM SQL Database

I have an Outlook 2007 Business Contact Manger Database on a SBS 2003 R2
Premium Server with SQL 2005.
Whenever I try to add more than 40 User-Defined Fields in BCM I get an error
message stating I can't create more than 40 User-Defined Fields. That's a
huge limitation. Is there a way I can remove that limitation in SQL Server
2005 or at least increase the number?
Thank you.
Hi Rich
I think this is a limit imposed by BCM and not SQL Server as there are 1,024
columns per base table allowed in SQL Server to a maximum row size of 8,060
bytes
John
"Rich" wrote:

> I have an Outlook 2007 Business Contact Manger Database on a SBS 2003 R2
> Premium Server with SQL 2005.
> Whenever I try to add more than 40 User-Defined Fields in BCM I get an error
> message stating I can't create more than 40 User-Defined Fields. That's a
> huge limitation. Is there a way I can remove that limitation in SQL Server
> 2005 or at least increase the number?
> Thank you.
|||Actually in 2005 the row size is really not limited to 8060 bytes any more.
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:D35CAB96-5D70-4258-AC92-C628E780B95B@.microsoft.com...[vbcol=seagreen]
> Hi Rich
> I think this is a limit imposed by BCM and not SQL Server as there are
> 1,024
> columns per base table allowed in SQL Server to a maximum row size of
> 8,060
> bytes
> John
> "Rich" wrote:
|||Hi
You could argue that with Text datatype the limit does not exist in SQL
2000, so it was conditional anyhow, but Books online still gives it as the
limit in SQL 2005.
It still doesn't explain why there is a seemingly arbitrary limit imposed by
BCM.
John
"Andrew J. Kelly" wrote:

> Actually in 2005 the row size is really not limited to 8060 bytes any more.
> --
> Andrew J. Kelly SQL MVP
> Solid Quality Mentors
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:D35CAB96-5D70-4258-AC92-C628E780B95B@.microsoft.com...
>
|||If BCM is dependent on SQL 2005 then I would think that there is a way to
increase the limit. Could the SQL database have code in it that commands it
to have a limit in BCM?
If a Microsoft engineer could help put some light on this I would greatly
appreciate it.
Thank you.
"John Bell" wrote:
[vbcol=seagreen]
> Hi
> You could argue that with Text datatype the limit does not exist in SQL
> 2000, so it was conditional anyhow, but Books online still gives it as the
> limit in SQL 2005.
> It still doesn't explain why there is a seemingly arbitrary limit imposed by
> BCM.
> John
>
> "Andrew J. Kelly" wrote:
|||I don't see any BCM MSDN group. Because this isn't a break/fix issue I can't
post it to the Microsoft Support Managed Newsgroup. I've tried that and they
said to post in the MSDN Newsgroup.
"Tibor Karaszi" wrote:

> I suggest you ask this in a BCM group, since the limit is in the application (BCM), not in SQL
> Server.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Rich" <Rich@.discussions.microsoft.com> wrote in message
> news:4DA60BC0-5942-45EA-A668-DF2D412FF791@.microsoft.com...
>

Removing Field Creation Limitations in a BCM SQL Database

I have an Outlook 2007 Business Contact Manger Database on a SBS 2003 R2
Premium Server with SQL 2005.
Whenever I try to add more than 40 User-Defined Fields in BCM I get an error
message stating I can't create more than 40 User-Defined Fields. That's a
huge limitation. Is there a way I can remove that limitation in SQL Server
2005 or at least increase the number?
Thank you.Hi Rich
I think this is a limit imposed by BCM and not SQL Server as there are 1,024
columns per base table allowed in SQL Server to a maximum row size of 8,060
bytes
John
"Rich" wrote:
> I have an Outlook 2007 Business Contact Manger Database on a SBS 2003 R2
> Premium Server with SQL 2005.
> Whenever I try to add more than 40 User-Defined Fields in BCM I get an error
> message stating I can't create more than 40 User-Defined Fields. That's a
> huge limitation. Is there a way I can remove that limitation in SQL Server
> 2005 or at least increase the number?
> Thank you.|||Actually in 2005 the row size is really not limited to 8060 bytes any more.
--
Andrew J. Kelly SQL MVP
Solid Quality Mentors
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:D35CAB96-5D70-4258-AC92-C628E780B95B@.microsoft.com...
> Hi Rich
> I think this is a limit imposed by BCM and not SQL Server as there are
> 1,024
> columns per base table allowed in SQL Server to a maximum row size of
> 8,060
> bytes
> John
> "Rich" wrote:
>> I have an Outlook 2007 Business Contact Manger Database on a SBS 2003 R2
>> Premium Server with SQL 2005.
>> Whenever I try to add more than 40 User-Defined Fields in BCM I get an
>> error
>> message stating I can't create more than 40 User-Defined Fields. That's
>> a
>> huge limitation. Is there a way I can remove that limitation in SQL
>> Server
>> 2005 or at least increase the number?
>> Thank you.|||Hi
You could argue that with Text datatype the limit does not exist in SQL
2000, so it was conditional anyhow, but Books online still gives it as the
limit in SQL 2005.
It still doesn't explain why there is a seemingly arbitrary limit imposed by
BCM.
John
"Andrew J. Kelly" wrote:
> Actually in 2005 the row size is really not limited to 8060 bytes any more.
> --
> Andrew J. Kelly SQL MVP
> Solid Quality Mentors
>
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:D35CAB96-5D70-4258-AC92-C628E780B95B@.microsoft.com...
> > Hi Rich
> >
> > I think this is a limit imposed by BCM and not SQL Server as there are
> > 1,024
> > columns per base table allowed in SQL Server to a maximum row size of
> > 8,060
> > bytes
> >
> > John
> >
> > "Rich" wrote:
> >
> >> I have an Outlook 2007 Business Contact Manger Database on a SBS 2003 R2
> >> Premium Server with SQL 2005.
> >>
> >> Whenever I try to add more than 40 User-Defined Fields in BCM I get an
> >> error
> >> message stating I can't create more than 40 User-Defined Fields. That's
> >> a
> >> huge limitation. Is there a way I can remove that limitation in SQL
> >> Server
> >> 2005 or at least increase the number?
> >>
> >> Thank you.
>|||If BCM is dependent on SQL 2005 then I would think that there is a way to
increase the limit. Could the SQL database have code in it that commands it
to have a limit in BCM?
If a Microsoft engineer could help put some light on this I would greatly
appreciate it.
Thank you.
"John Bell" wrote:
> Hi
> You could argue that with Text datatype the limit does not exist in SQL
> 2000, so it was conditional anyhow, but Books online still gives it as the
> limit in SQL 2005.
> It still doesn't explain why there is a seemingly arbitrary limit imposed by
> BCM.
> John
>
> "Andrew J. Kelly" wrote:
> > Actually in 2005 the row size is really not limited to 8060 bytes any more.
> >
> > --
> > Andrew J. Kelly SQL MVP
> > Solid Quality Mentors
> >
> >
> > "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> > news:D35CAB96-5D70-4258-AC92-C628E780B95B@.microsoft.com...
> > > Hi Rich
> > >
> > > I think this is a limit imposed by BCM and not SQL Server as there are
> > > 1,024
> > > columns per base table allowed in SQL Server to a maximum row size of
> > > 8,060
> > > bytes
> > >
> > > John
> > >
> > > "Rich" wrote:
> > >
> > >> I have an Outlook 2007 Business Contact Manger Database on a SBS 2003 R2
> > >> Premium Server with SQL 2005.
> > >>
> > >> Whenever I try to add more than 40 User-Defined Fields in BCM I get an
> > >> error
> > >> message stating I can't create more than 40 User-Defined Fields. That's
> > >> a
> > >> huge limitation. Is there a way I can remove that limitation in SQL
> > >> Server
> > >> 2005 or at least increase the number?
> > >>
> > >> Thank you.
> >
> >|||> Could the SQL database have code in it that commands it
> to have a limit in BCM?
> If a Microsoft engineer could help put some light on this I would greatly
> appreciate it.
I suggest you ask this in a BCM group, since the limit is in the application (BCM), not in SQL
Server.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Rich" <Rich@.discussions.microsoft.com> wrote in message
news:4DA60BC0-5942-45EA-A668-DF2D412FF791@.microsoft.com...
> If BCM is dependent on SQL 2005 then I would think that there is a way to
> increase the limit. Could the SQL database have code in it that commands it
> to have a limit in BCM?
> If a Microsoft engineer could help put some light on this I would greatly
> appreciate it.
> Thank you.
> "John Bell" wrote:
>> Hi
>> You could argue that with Text datatype the limit does not exist in SQL
>> 2000, so it was conditional anyhow, but Books online still gives it as the
>> limit in SQL 2005.
>> It still doesn't explain why there is a seemingly arbitrary limit imposed by
>> BCM.
>> John
>>
>> "Andrew J. Kelly" wrote:
>> > Actually in 2005 the row size is really not limited to 8060 bytes any more.
>> >
>> > --
>> > Andrew J. Kelly SQL MVP
>> > Solid Quality Mentors
>> >
>> >
>> > "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
>> > news:D35CAB96-5D70-4258-AC92-C628E780B95B@.microsoft.com...
>> > > Hi Rich
>> > >
>> > > I think this is a limit imposed by BCM and not SQL Server as there are
>> > > 1,024
>> > > columns per base table allowed in SQL Server to a maximum row size of
>> > > 8,060
>> > > bytes
>> > >
>> > > John
>> > >
>> > > "Rich" wrote:
>> > >
>> > >> I have an Outlook 2007 Business Contact Manger Database on a SBS 2003 R2
>> > >> Premium Server with SQL 2005.
>> > >>
>> > >> Whenever I try to add more than 40 User-Defined Fields in BCM I get an
>> > >> error
>> > >> message stating I can't create more than 40 User-Defined Fields. That's
>> > >> a
>> > >> huge limitation. Is there a way I can remove that limitation in SQL
>> > >> Server
>> > >> 2005 or at least increase the number?
>> > >>
>> > >> Thank you.
>> >
>> >|||I don't see any BCM MSDN group. Because this isn't a break/fix issue I can't
post it to the Microsoft Support Managed Newsgroup. I've tried that and they
said to post in the MSDN Newsgroup.
"Tibor Karaszi" wrote:
> > Could the SQL database have code in it that commands it
> > to have a limit in BCM?
> >
> > If a Microsoft engineer could help put some light on this I would greatly
> > appreciate it.
> I suggest you ask this in a BCM group, since the limit is in the application (BCM), not in SQL
> Server.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Rich" <Rich@.discussions.microsoft.com> wrote in message
> news:4DA60BC0-5942-45EA-A668-DF2D412FF791@.microsoft.com...
> > If BCM is dependent on SQL 2005 then I would think that there is a way to
> > increase the limit. Could the SQL database have code in it that commands it
> > to have a limit in BCM?
> >
> > If a Microsoft engineer could help put some light on this I would greatly
> > appreciate it.
> >
> > Thank you.
> >
> > "John Bell" wrote:
> >
> >> Hi
> >>
> >> You could argue that with Text datatype the limit does not exist in SQL
> >> 2000, so it was conditional anyhow, but Books online still gives it as the
> >> limit in SQL 2005.
> >>
> >> It still doesn't explain why there is a seemingly arbitrary limit imposed by
> >> BCM.
> >>
> >> John
> >>
> >>
> >> "Andrew J. Kelly" wrote:
> >>
> >> > Actually in 2005 the row size is really not limited to 8060 bytes any more.
> >> >
> >> > --
> >> > Andrew J. Kelly SQL MVP
> >> > Solid Quality Mentors
> >> >
> >> >
> >> > "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> >> > news:D35CAB96-5D70-4258-AC92-C628E780B95B@.microsoft.com...
> >> > > Hi Rich
> >> > >
> >> > > I think this is a limit imposed by BCM and not SQL Server as there are
> >> > > 1,024
> >> > > columns per base table allowed in SQL Server to a maximum row size of
> >> > > 8,060
> >> > > bytes
> >> > >
> >> > > John
> >> > >
> >> > > "Rich" wrote:
> >> > >
> >> > >> I have an Outlook 2007 Business Contact Manger Database on a SBS 2003 R2
> >> > >> Premium Server with SQL 2005.
> >> > >>
> >> > >> Whenever I try to add more than 40 User-Defined Fields in BCM I get an
> >> > >> error
> >> > >> message stating I can't create more than 40 User-Defined Fields. That's
> >> > >> a
> >> > >> huge limitation. Is there a way I can remove that limitation in SQL
> >> > >> Server
> >> > >> 2005 or at least increase the number?
> >> > >>
> >> > >> Thank you.
> >> >
> >> >
>|||Hi Rich
I believe BCM is part of the MS Office family microsoft.public.outlook.bcm,
although I would not raise your hopes by suggesting you posted to the office
news group, but it would be worth a try. There is some online help at
http://office.microsoft.com/en-gb/outlook/FX100647191033.aspx?CTT=96&Origin=CL100626971033
Any unsanctioned change may invalidate your licence agreement, therefore, if
failing to get a suitable response I can only suggest that you would need to
open an issue with product support
http://support.microsoft.com/oas/default.aspx?&gprid=8753&
John
"Rich" wrote:
> I don't see any BCM MSDN group. Because this isn't a break/fix issue I can't
> post it to the Microsoft Support Managed Newsgroup. I've tried that and they
> said to post in the MSDN Newsgroup.
> "Tibor Karaszi" wrote:
> > > Could the SQL database have code in it that commands it
> > > to have a limit in BCM?
> > >
> > > If a Microsoft engineer could help put some light on this I would greatly
> > > appreciate it.
> >
> > I suggest you ask this in a BCM group, since the limit is in the application (BCM), not in SQL
> > Server.
> >
> > --
> > Tibor Karaszi, SQL Server MVP
> > http://www.karaszi.com/sqlserver/default.asp
> > http://sqlblog.com/blogs/tibor_karaszi
> >
> >
> > "Rich" <Rich@.discussions.microsoft.com> wrote in message
> > news:4DA60BC0-5942-45EA-A668-DF2D412FF791@.microsoft.com...
> > > If BCM is dependent on SQL 2005 then I would think that there is a way to
> > > increase the limit. Could the SQL database have code in it that commands it
> > > to have a limit in BCM?
> > >
> > > If a Microsoft engineer could help put some light on this I would greatly
> > > appreciate it.
> > >
> > > Thank you.
> > >
> > > "John Bell" wrote:
> > >
> > >> Hi
> > >>
> > >> You could argue that with Text datatype the limit does not exist in SQL
> > >> 2000, so it was conditional anyhow, but Books online still gives it as the
> > >> limit in SQL 2005.
> > >>
> > >> It still doesn't explain why there is a seemingly arbitrary limit imposed by
> > >> BCM.
> > >>
> > >> John
> > >>
> > >>
> > >> "Andrew J. Kelly" wrote:
> > >>
> > >> > Actually in 2005 the row size is really not limited to 8060 bytes any more.
> > >> >
> > >> > --
> > >> > Andrew J. Kelly SQL MVP
> > >> > Solid Quality Mentors
> > >> >
> > >> >
> > >> > "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> > >> > news:D35CAB96-5D70-4258-AC92-C628E780B95B@.microsoft.com...
> > >> > > Hi Rich
> > >> > >
> > >> > > I think this is a limit imposed by BCM and not SQL Server as there are
> > >> > > 1,024
> > >> > > columns per base table allowed in SQL Server to a maximum row size of
> > >> > > 8,060
> > >> > > bytes
> > >> > >
> > >> > > John
> > >> > >
> > >> > > "Rich" wrote:
> > >> > >
> > >> > >> I have an Outlook 2007 Business Contact Manger Database on a SBS 2003 R2
> > >> > >> Premium Server with SQL 2005.
> > >> > >>
> > >> > >> Whenever I try to add more than 40 User-Defined Fields in BCM I get an
> > >> > >> error
> > >> > >> message stating I can't create more than 40 User-Defined Fields. That's
> > >> > >> a
> > >> > >> huge limitation. Is there a way I can remove that limitation in SQL
> > >> > >> Server
> > >> > >> 2005 or at least increase the number?
> > >> > >>
> > >> > >> Thank you.
> > >> >
> > >> >
> >
> >