Showing posts with label cities. Show all posts
Showing posts with label cities. Show all posts

Friday, February 24, 2012

i need idea for bus transport databse

i have many buses that drive between many cities. some of the buses connect
more than 2 cities in one line...Homework assignment?
Adam Machanic
SQL Server MVP
http://www.datamanipulation.net
--
"TomislaW" <tomislav147@.hotmail.com> wrote in message
news:%23WxwyI7LFHA.2384@.tk2msftngp13.phx.gbl...
> i have many buses that drive between many cities. some of the buses
connect
> more than 2 cities in one line...
>|||Homework or do you want to hire someone?
Take a look at:
http://www.databaseanswers.org/data_models/index.htm
David Portas
SQL Server MVP
--|||Hi
<http://www.databaseanswers.com/data_models/index.htm> -- examples
database design
"TomislaW" <tomislav147@.hotmail.com> wrote in message
news:%23WxwyI7LFHA.2384@.tk2msftngp13.phx.gbl...
> i have many buses that drive between many cities. some of the buses
connect
> more than 2 cities in one line...
>|||Without knowing more (and really understanding your need) it will be
difficult to make recommendations. Look at the things that you need to
track. Group them logically. Some things that come to mind are:
Bus (one row per bus)
Location (stops)
Route (itinerary -- stops that make up a trip)
Passenger
Keith
"TomislaW" <tomislav147@.hotmail.com> wrote in message
news:%23WxwyI7LFHA.2384@.tk2msftngp13.phx.gbl...
> i have many buses that drive between many cities. some of the buses
connect
> more than 2 cities in one line...
>|||Check out the 6th installment of this MSDN article on data structures;
particularly about Graphs...
http://msdn.microsoft.com/vcsharp/d...uctures20_1.asp
"Keith Kratochvil" wrote:

> Without knowing more (and really understanding your need) it will be
> difficult to make recommendations. Look at the things that you need to
> track. Group them logically. Some things that come to mind are:
> Bus (one row per bus)
> Location (stops)
> Route (itinerary -- stops that make up a trip)
> Passenger
> --
> Keith
>
> "TomislaW" <tomislav147@.hotmail.com> wrote in message
> news:%23WxwyI7LFHA.2384@.tk2msftngp13.phx.gbl...
> connect
>|||>> Homework assignment? <<
This is one I used to give students myself! The gimmick was adding the
temporal parts to the graph.

I need help...!

Hello!
I am using IN to determine if a given StateId values matches any value in a
query.
Previously, I used following query:
SELECT * FROM Cities WHERE StateId IN (1, 2, 3)
but now I would like to pass dynamic values as a input parameter...
SELECT * FROM Cities WHERE StateId IN(@.StateId)
StateId is an integer.
Could anyone help me with this, I can't get it working. I am new to SQL
Server.
Thank you!
JamesJames
CREATE PROCEDURE mysp
@.array nvarchar(4000)
AS
BEGIN
SET NOCOUNT ON
DECLARE @.nsql nvarchar(4000)
SET @.nsql = '
SELECT *
FROM sysobjects
WHERE name IN ( ' + @.array + ')'
PRINT @.nsql
EXEC sp_executesql @.nsql
END
GO
EXEC mysp
@.array = '''sysobjects'',''sysindexes'',''syscolu
mns'''
GO
"James T." <gimenei@.hotmail.com> wrote in message
news:O7P%23D8dOFHA.3356@.TK2MSFTNGP12.phx.gbl...
> Hello!
> I am using IN to determine if a given StateId values matches any value in
a
> query.
> Previously, I used following query:
> SELECT * FROM Cities WHERE StateId IN (1, 2, 3)
> but now I would like to pass dynamic values as a input parameter...
> SELECT * FROM Cities WHERE StateId IN(@.StateId)
> StateId is an integer.
> Could anyone help me with this, I can't get it working. I am new to SQL
> Server.
> Thank you!
> James
>|||The Curse and Blessings of Dynamic SQL
http://www.sommarskog.se/dynamic_sql.html
Arrays and Lists in SQL Server
http://www.sommarskog.se/arrays-in-sql.html
Faking arrays in T-SQL stored procedures
http://www.bizdatasolutions.com/tsql/sqlarrays.asp
How do I simulate an array inside a stored procedure?
http://www.aspfaq.com/show.asp?id=2248
AMB
"James T." wrote:

> Hello!
> I am using IN to determine if a given StateId values matches any value in
a
> query.
> Previously, I used following query:
> SELECT * FROM Cities WHERE StateId IN (1, 2, 3)
> but now I would like to pass dynamic values as a input parameter...
> SELECT * FROM Cities WHERE StateId IN(@.StateId)
> StateId is an integer.
> Could anyone help me with this, I can't get it working. I am new to SQL
> Server.
> Thank you!
> James
>
>