Re: sql query which has got 3 dynamic parameters
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Sat, 23 Feb 2008 11:27:50 +0000 (UTC)
Vic (vikrantp@xxxxxxxxx) writes:
Thanks Erland for the reply first of all. The thing is like I didn't
really design the system. So here is what I came up with so far. I
have a store procedure to which I pass a number which will give me a
particular entry in that database. say if I type exec SP_FETCH_ROWS 1
its going to return accounting or if I pass 4 its going to return
calendar etc
First: don't name your procedures sp_something, as the sp_ prefix is
reserved for system procedures.
Next, I don't understand what this SP_FETCH_ROWS is supposed to
achieved. It returns a certain table name given its position in the
current collation, but I don't see what this could be useful for,
neither in general, nor in relation to the problem in your original
post.
if @Count = 1 or @Count = 4 or @Count = 7 or @Count = 8 or
@Count >= 14 or
@Count = 17 or @Count = 18 or @Count = 22 or @Count = 25 or
@Count = 27 or @Count = 28 or @Count = 29
exec releases.dbo.SP_FETCH_ROWS @Count
end
which isn't working though. The above loop ideally will give me list
of items at those specific positions in
TestData6061.INFORMATION_SCHEMA.Tables
And then someone adds accounting_bck for some reason and your numbers
get out of sync?
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- References:
- sql query which has got 3 dynamic parameters
- From: Vic
- Re: sql query which has got 3 dynamic parameters
- From: Vic
- Re: sql query which has got 3 dynamic parameters
- From: Erland Sommarskog
- Re: sql query which has got 3 dynamic parameters
- From: Vic
- sql query which has got 3 dynamic parameters
- Prev by Date: Re: help with update
- Next by Date: Re: DB size increase from SQL 2000 to 2005
- Previous by thread: Re: sql query which has got 3 dynamic parameters
- Next by thread: Re: sql query which has got 3 dynamic parameters
- Index(es):
Relevant Pages
|