Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Insert new controls into a form via SQL INSERT INTO

Avatar of jeremyll
jeremyll asked on
DatabasesMicrosoft SQL ServerMicrosoft SQL Server 2008
8 Comments1 Solution387 ViewsLast Modified:
I wish to insert a checkbox control into a form via sql INSERT INTO. I’m using MS Sql Server Management Studio 2008.

I know I need to use a sql statement something like below.

INSERT INTO [M1_TJ].[dbo].[FormDefinitions]
           ([xaoFormID]
           ,[xaoControlName]
           ,[xaoClassID]
           ,[xaoType]
           ,[xaoProperties]
           ,[xaoCode])
     VALUES
           (<xaoFormID, char(75),>
           ,<xaoControlName, char(70),>
           ,<xaoClassID, char(35),>
           ,<xaoType, numeric(1,0),>
           ,<xaoProperties, text,>
           ,<xaoCode, text,>)

I would like to insert the following values below into M1_TJ dataset

xaoFormID: PART-FSIP*
xaoControlName: CHKLINTPOT                                                            
xaoClassID: M1.M1CHECKBOX                      
xaoType: 2
xaoProperties: Top = 1640 Left = 877 Height = 44 Width = 96 DataSource = "M1DataControl" Caption = "Lint Pot"
xaoCode: Function CHKLINTPOT_Change() Call UpdateSummary()   End Function

*For xaoFormID above, I would like to insert all the other values into xaoFormID where xaoFormID like ‘%PART-FSIP%’

My concern is the xaoCode field. When I go into design studio to edit the code, there are line breaks which adhere to VBscript coding conventions.

To check if your solution is getting proper results, I would like to first fun a Select and check the data and if it is ok, run the update or insert statement.

Thanks heaps! J
ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5anFlag of Germany imageSenior Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answers