Click here to Skip to main content
15,896,154 members
Home / Discussions / Database
   

Database

 
AnswerRe: SQL Server 2008 - Replication without a primary key in the publisher ? Pin
Wendelius3-Feb-09 8:07
mentorWendelius3-Feb-09 8:07 
GeneralRe: SQL Server 2008 - Replication without a primary key in the publisher ? Pin
obarahmeh3-Feb-09 19:57
obarahmeh3-Feb-09 19:57 
GeneralRe: SQL Server 2008 - Replication without a primary key in the publisher ? Pin
Wendelius4-Feb-09 7:49
mentorWendelius4-Feb-09 7:49 
QuestionSSIS - How to transform data and push transformed data into Destination database Pin
CodalcoholicNBrainy2-Feb-09 23:12
CodalcoholicNBrainy2-Feb-09 23:12 
AnswerRe: SSIS - How to transform data and push transformed data into Destination database Pin
Giorgi Dalakishvili3-Feb-09 0:03
mentorGiorgi Dalakishvili3-Feb-09 0:03 
Questionprotect sql server database Pin
Any_India2-Feb-09 22:17
Any_India2-Feb-09 22:17 
AnswerRe: protect sql server database Pin
Wendelius3-Feb-09 1:48
mentorWendelius3-Feb-09 1:48 
QuestionTree structre table performance problem Pin
sepel2-Feb-09 22:12
sepel2-Feb-09 22:12 
Hi Any body.
I Create a table for location that contains city, state and country in tree structure(parent child).
User add Post in "post" table and ech post has a location id thac can be a city or state or country.

Here is my questions:
1-If I use correct Solution for save location or I should separate city and state and country in another tables?
2-Whats best solution with high performance to show city,state and country for each post.Example:

post id city state country
---- ---- ---- ------ ---------
some text 4 waco txas us
some text 4 null txas us
some text 4 null null us

I use a view with 3 join to show all location here is my view :

SELECT     Citeis.name AS city, States.name AS state, C***ries.name AS country, C***ries.id AS CountryID, States.id AS StateID, Citeis.id AS cityID
FROM         dbo.Geo AS Citeis INNER JOIN
                      dbo.Geo AS States ON Citeis.parentID = States.id INNER JOIN
                      dbo.Geo AS C***ries ON States.parentID = C***ries.id


And then I join it to post table:

SELECT
dbo.Post.*, dbo.ViewStates.city, dbo.ViewStates.state, dbo.ViewStates.country
                   
FROM         dbo.Post INNER JOIN
                      dbo.ViewStates ON dbo.Post.geoID = dbo.ViewStates.cityID


But my host don't allow me to execute this query because of it performance.It say that ths query consume some resource.

Should I use function to retrieve state and city and country ?
should I use inline function or table function?

Thanks for any idea.

sepel

AnswerRe: Tree structre table performance problem Pin
Paddy Boyd3-Feb-09 2:16
Paddy Boyd3-Feb-09 2:16 
AnswerRe: Tree structre table performance problem Pin
Wendelius3-Feb-09 2:17
mentorWendelius3-Feb-09 2:17 
QuestionWhich version of SqlServer is better for my work Pin
VisualLive2-Feb-09 22:02
VisualLive2-Feb-09 22:02 
AnswerRe: Which version of SqlServer is better for my work Pin
Wendelius3-Feb-09 1:51
mentorWendelius3-Feb-09 1:51 
GeneralRe: Which version of SqlServer is better for my work Pin
VisualLive3-Feb-09 5:04
VisualLive3-Feb-09 5:04 
GeneralRe: Which version of SqlServer is better for my work Pin
Wendelius3-Feb-09 6:59
mentorWendelius3-Feb-09 6:59 
GeneralRe: Which version of SqlServer is better for my work Pin
VisualLive3-Feb-09 14:28
VisualLive3-Feb-09 14:28 
GeneralRe: Which version of SqlServer is better for my work Pin
Wendelius3-Feb-09 18:22
mentorWendelius3-Feb-09 18:22 
GeneralRe: Which version of SqlServer is better for my work Pin
VisualLive3-Feb-09 20:47
VisualLive3-Feb-09 20:47 
GeneralRe: Which version of SqlServer is better for my work Pin
Wendelius4-Feb-09 7:54
mentorWendelius4-Feb-09 7:54 
GeneralRe: Which version of SqlServer is better for my work Pin
VisualLive4-Feb-09 15:20
VisualLive4-Feb-09 15:20 
Questionaudit trail Pin
NidhiKanu2-Feb-09 18:58
professionalNidhiKanu2-Feb-09 18:58 
AnswerRe: audit trail Pin
N a v a n e e t h2-Feb-09 19:06
N a v a n e e t h2-Feb-09 19:06 
GeneralRe: audit trail Pin
NidhiKanu2-Feb-09 19:18
professionalNidhiKanu2-Feb-09 19:18 
QuestionSQL For selecting consecutive rows with time difference Pin
pratap19802-Feb-09 13:11
pratap19802-Feb-09 13:11 
AnswerRe: SQL For selecting consecutive rows with time difference Pin
Wendelius2-Feb-09 18:19
mentorWendelius2-Feb-09 18:19 
Questioncount total records and (number of records based on a condition) for same column in single sql query Pin
chandrubngit2-Feb-09 5:28
chandrubngit2-Feb-09 5:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.