Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Joining a #table created on the SP with a existant one
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01305959
Message ID:
01305963
Vues:
7
What's releationship between #treport an apvadr ?

>Hi I am trying to modify a Stored procedure that returns a result set at the end with
>
>execute ("select * from #table")
>
>
>to this i would like to join another table that already exist on the database called apvadr
>lets say that #table has these columns
>code, item, descr, qty
>1     1     1      1
>2     2     2      2
>
>and apvadr has this struc
>cvendno    caddr1    caddr2
>3          3         3
>
>
>i am trying to get this result
>cvendno    caddr1    caddr2     code, item, descr, qty
>3          3         3          1     1     1      1
>3          3         3          2     2     2      2
>
>is it possible or i am just making a mistake?
>
>this is the actual script
>
>select @lcsqlcmd = "select *, apvadr.cphone as cBphone, apvadr.ccontact as cBcontact, " +
>		       "apvadr.ccompany as cBcompany, apvadr.caddr1 as cBaddr1, apvadr.caddr2 as cBaddr2,"+
>		       "apvadr.ccity as cBcity, apvadr.cstate as cBstate, apvadr.czip as cBzip, " +
>                       "apvadr.ccountry as cBcountry " +
>		       "from #treport, apvadr " +
>		       "were apvadr.cvendno = 'Z_SKIPS' and apvadr.ctype='O' and apvadr.caddrno = 'MIA' " +
>		       "order by 79, " + @lcsortno
>
>execute (@lcsqlcmd)
>
>as I mentioned before #treport is created on the SP, apvadr already exists on the database
>
>
>i forgot to mentione that this seems not to be working, when i run the report, oh yes, this SP is used by a crystal rpt, when i run it gives me an err of databse
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform