Showing posts with label individual. Show all posts
Showing posts with label individual. Show all posts

Friday, March 23, 2012

Rename dos file name

Just a shoot in the dark here...
When SQL Server exports procs to individual files, it creatin them like
dbo.sproc.prc
Needless to say this filename is causing fits...
I've tried to do a rename to no avail
any suggestions?You mean that you don't like the way that Enterprise Mangler names the files produced by SQL-DMO ?!?! You can easily roll your own (http://support.microsoft.com/default.aspx?scid=kb;en-us;233392) if you like, or you can write a short script to rename the bundles of joy delivered by EM. While the rename script is less work, I prefer the roll your own approach myself.

-PatP|||Maybe a better question is who is the file naming causing fits, and why is it causing them those fits ?!?! Maybe I ought to finger out the problem before I start fixin' on it, eh?

-PatP

Friday, March 9, 2012

Removing Nodes from a Virtual Server?

I've build a SQL 2000 SP3a cluster on top of an 8 node Windows 2003 cluster.
We've decided to split the cluster up into 2 individual clusters and as such
I'm attempting to remove some of the cluster nodes from the Virtual Server
Definiton (as per the "Adding or Removing a Cluster Node from the Vritual
Server Definition" of
http://www.microsoft.com/technet/pro...clus.mspx#EGAA)
Anyway, I begin the SQL install and get to the Computer Name dialog where I
choose the virtual server name. I click next and the install GUI just
disapears. I check and setupsql.exe is continues to show up as running in
Taskman for about 10 minutes then just finishes up.
Any thoughts?
Anyone have any thoughts on this?
"Chris B." wrote:

> I've build a SQL 2000 SP3a cluster on top of an 8 node Windows 2003 cluster.
> We've decided to split the cluster up into 2 individual clusters and as such
> I'm attempting to remove some of the cluster nodes from the Virtual Server
> Definiton (as per the "Adding or Removing a Cluster Node from the Vritual
> Server Definition" of
> http://www.microsoft.com/technet/pro...clus.mspx#EGAA)
> Anyway, I begin the SQL install and get to the Computer Name dialog where I
> choose the virtual server name. I click next and the install GUI just
> disapears. I check and setupsql.exe is continues to show up as running in
> Taskman for about 10 minutes then just finishes up.
> Any thoughts?
|||Hi
Only 4 Nodes are supported on a cluster by SQL Server 2000. It is a setup UI
limitation.
You need to remove the installation like you installed it, with command
line.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:981588B6-717B-45C2-BBBA-F5C30A2AE5F2@.microsoft.com...[vbcol=seagreen]
> Anyone have any thoughts on this?
> "Chris B." wrote:
|||Hmm, thanks for the quick reply.
I don't believe I installed from a command line, but those few weeks were
pretty crazy Can you point me in the general direction of documentation
on the command line syntax? I assume you're talking about using the
sqlrem.bat file?
"Mike Epprecht (SQL MVP)" wrote:

> Hi
> Only 4 Nodes are supported on a cluster by SQL Server 2000. It is a setup UI
> limitation.
> You need to remove the installation like you installed it, with command
> line.
> Regards
> --
> Mike Epprecht, Microsoft SQL Server MVP
> Zurich, Switzerland
> IM: mike@.epprecht.net
> MVP Program: http://www.microsoft.com/mvp
> Blog: http://www.msmvps.com/epprecht/
> "Chris" <Chris@.discussions.microsoft.com> wrote in message
> news:981588B6-717B-45C2-BBBA-F5C30A2AE5F2@.microsoft.com...
>
>
|||I have not seen any. It was in a discussion with a developer from the SQL
Server Development Team.
PSS might be able to help.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:22265BEA-AD19-4C06-BFE6-146D419CCE10@.microsoft.com...[vbcol=seagreen]
> Hmm, thanks for the quick reply.
> I don't believe I installed from a command line, but those few weeks were
> pretty crazy Can you point me in the general direction of
> documentation
> on the command line syntax? I assume you're talking about using the
> sqlrem.bat file?
> "Mike Epprecht (SQL MVP)" wrote:

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