SQL Server Performance

INSERT from SELECT result

Discussion in 'General Developer Questions' started by GermanC4, Apr 2, 2004.

  1. GermanC4 New Member

    Hello.<br /><br /> I have a Table with the users that have access to a web page, each person has 5 users cus' there are 5 places in the city from where they can Access the information and depending on the user they enter the web page shows them some information and the new info entered by them will be stored in diferent pages....<br /><br /> the problem is that now there are 6 places and I have to create 1 user more for each person.<br /><br />each user has they're user names like this...<br /><br /> Name_CitySpot1<br /> Name_CitySpot2<br /> Name_CitySpot3<br /> Name_CitySpot4<br /> Name_CitySpot5<br /><br />so with this next statement i can get they're name...<br /><font color="blue">SELECT SUBSTRING(Usuario,0,CHARINDEX('_',Usuario)) AS UsuarioSolo<br />FROM Usuario<br />WHERE cve_Tipo_Usuario = 1 and CHARINDEX('_',Usuario) &lt;&gt; 0<br />GROUP BY SUBSTRING(Usuario,0,CHARINDEX('_',Usuario))<br />ORDER BY SUBSTRING(Usuario,0,CHARINDEX('_',Usuario))</font id="blue"><br /><br /><br />so can I conbine that instruction with an Insert and Apend '_CitySpot6'<br />so every user registered will have they're new user automatically?<br /><br />German [<img src='/community/emoticons/emotion-1.gif' alt=':)' />]

Share This Page