SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DYNAMIC SELECT & INSERT QUERY HELP


DYNAMIC SELECT & INSERT QUERY HELP

Author
Message
Kasinathan
Kasinathan
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 59
HI ALL

PLEASE HELP ME

AM HAVING ONE TABLE LIKE

TABLE1
----------------------------------
CA CB CC CD CE CF CG ..... CN
----------------------------------


I THIS TABLE COLUMNS OR DYNAMIC TABLE..

I NEED TO INSERT THE VALUE IN THIS SPECFIC COLUMNS..

NOW AM INSERING THE VAULE MANUALY.

I NEED TO INSERT THE VALUE DYNAMICALLY

HERE I MENTIONED MY SP SAMPLE

INSERT INTO ##cname (

vchar_Business_Group_Description,
vchar_Sub_Biz_Group_Name,
inte_Emp_Id,
Empname,

CA,CB,CC,CD,CE,CF,CG


)
--
SELECT
vchar_Business_Group_Description,
vchar_Sub_Biz_Group_Name,
inte_Emp_Id,
Empname,
SUM(CA) AS TishmanAccounting,
SUM(CB) AS OtherClientsAccounting,
SUM(CC) AS CentroAccounting,

SUM(CD) AS UnderwritingOld,
SUM(CE) AS StructuredFinance,
SUM(CF) AS SterlingAmericanProperties,


FROM
(SELECT QUERY)


PLEASE HELP ME. ITS VERY URGENT WORK FOR ME.....

THANKS IN ADVANCE
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search