T-SQL (SS2K8) :: Convert Binary String To Table Value Construct?

Mar 21, 2014

Code snippet for changing '00001001001' into a table value construct containing (64,8,1)?

View 6 Replies


ADVERTISEMENT

Convert From Binary To String

Jan 15, 2008

Hi Everyone -
iam facing a small problem i want to convert an output from the context_info() which is binary to string (or int)

example:

SET CONTEXT_INFO 3


select CONTEXT_INFO() --- it will return 0x0000000300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

the requested output is to be 3 again


thanx
Maylo

View 3 Replies View Related

Convert To String From Binary Data

Mar 31, 2008

hello all,
I am reading a file that contains textual data (formatted,e.g font=bold,font size=10 etc). After reading the file, i store the data read from the file to a table in Sql server 2005. But in the table, this data is stored like this:

daohORIGINAL TEXTm............

how can i just store the original text of the file in the table and get rid of these boxes? Or when i read this data from table, how to remove these boxes and get only the original text?
Thanks in advance.
I am using C# FileStream to read the file from disk. VS 2005

View 25 Replies View Related

T-SQL (SS2K8) :: Conversion From Binary Version String

Apr 1, 2015

Trying to get this query to work, converting a binary version string to human readable output but somehow it doesn't work?

/* Version number binary from daily registy */
DECLARE @VERSION_STRING VARBINARY(16) = 0x4D5544532556564C5B504C552D675B;
/* Inline Tally for parsing the binary string */
;WITH T(N) AS (SELECT N FROM (VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL)) AS X(N))
,NUMS(N) AS (SELECT TOP(DATALENGTH(@VERSION_STRING)) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS N FROM T T1,T T2)

[code]....

View 6 Replies View Related

Integration Services :: How To Convert From String To Binary

Jul 21, 2015

In Source, we have a column of datatype string(varchar/nvarchar).

Example:
col1
True
False

In Target we need to map the column which is of type binary. Binary column accepts only 1,0.
col1
1
0

how to achieve this? can this be done in derived column?

View 4 Replies View Related

T-SQL (SS2K8) :: How To Ignore String Or Binary Data Would Be Truncated

Jan 16, 2015

I have a script to be used to backup a specific table in a weekly basis, here is the approach what I take:

1. script the source table's schema to a create
2. the new script:

If not exists (select * from sysobjects where name='EventlogHistory' and xtype='U')
CREATE TABLE [dbo].[EventlogHistory](
[LogID] [int] IDENTITY(1,1) NOT NULL,
[ProjectID] [int] NOT NULL,
[Description] [nvarchar](max) NOT NULL,
[EventType] [varchar](10) NOT NULL,
[IP] [varchar](50) NOT NULL,
[UserLogon] [varchar](30) NOT NULL,
[CreatedOn] [datetime] NOT NULL,
ArchivedOn datetime default getdate())
insert into EventlogHistory

It throws me the error message saying "String or binary data would be truncated" which is nonsense to me, I need to let sql ignore the error, it is ridiculous to do a max(len()) to find out as it should never happen, right?

View 9 Replies View Related

T-SQL (SS2K8) :: Agent Job Error - String Or Binary Data Would Be Truncated

Sep 20, 2013

I'm running into the following message, "String or binary data would be truncated. [SQLSTATE 22001] (Error 8152)" when running a sql agent job. I'm attempting to execute a stored procedure through the job. Keep in mind that when I run the stored procedure in a normal query window, it works fine and only fails when running it as a scheduled job. My guess is that it has to do with how SQL Jobs execute procedures (especially long procedures). If I use Set Ansi_Warnings OFF, the job will work fine, however, I don't know what other issues this may cause.

View 7 Replies View Related

T-SQL (SS2K8) :: Error Handling - String Or Binary Data Would Be Truncated

May 16, 2014

We have a wrapper procedure that i am looking at replacing shortly. Basic Layout is something like like

Create proc SP_Wrapper
as
SP_LogProc 'proc1','Start'
Exec proc1
SP_LogProc 'proc1','End'
SP_LogProc 'proc2','Start'
Exec proc2
SP_LogProc 'proc2','End'

SP_LogProc 'proc3','Start'
Exec proc3
SP_LogProc 'proc3','End'
....

You get the idea. So logproc just logs that the procedure has started or stopped to a table so we can monitor it easily.

The procedure is then run by an agent job every morning. This morning we had a little bit of an odd one. In the example above we effectively got to 'proc3' being started (as it was logged). However there was then an error of String or binary data would be truncated (severity 16 i believe). However when proc3 was then manually run it worked (the data was unchanged). Then going back proc2 works fine, and its actually proc1 that has the error.

I have looked through the procs in question (and the wrapper) and cant find any error handling that is relevent (there one try and catch block completely separate at the end of the wrapper procedure for a small routine).

View 5 Replies View Related

T-SQL (SS2K8) :: Convert String To Date?

Sep 5, 2014

I'm importing dates into a table with Bulk insert

SET DATEFORMAT DMY

it works with dates e.g. "14/01/2009"

However sometimes I get dates in the format

"Fri 14/01/2009"

What is the best way to convert these.

I can only think of putting them in a staging table with all date fields as varchars Then updating these varchar fields

LTRIM(REPLACE(dtField, 'Mon', ''))
LTRIM(REPLACE(dtField, 'Tues', ''))

View 9 Replies View Related

T-SQL (SS2K8) :: Using CAST Or CONVERT To Change Data From String To Datetime?

Apr 16, 2014

i am trying to take a field that has part of a date in it, so I have to parse it out as follows:

SUBSTRING(a1.Field1, 3, 2) + SUBSTRING(a1.Field1,5,2) + '20' + LEFT(a1.Field1,2)

This is because a date of 04/16/2014 will show as 160416 in the first part of the field I need to parse it out of, thus becoming 04162014.

From there I then need to convert this "date" into a legitimate SQL datetime type, so that I can then run a DATEDIFF to compare it to when the record was actually entered, which is a separate field in the table, and already in datetime format.

When I use the below statement, I am getting the message that, "Conversion failed when converting date and/or time from character string."

CAST((SUBSTRING(a1.Field1, 3, 2) + SUBSTRING(a1.Field1,5,2) + '20' + LEFT(a1.Field1,2)) as datetime)

I also tried CONVERT(datetime, (SUBSTRING(a1.Field1, 3, 2) + SUBSTRING(a1.Field1,5,2) + '20' + LEFT(a1.Field1,2)), and got the same message.

how I can parse that field, then convert it to a datetime format for running a DATEDIFF statement?

View 9 Replies View Related

T-SQL (SS2K8) :: Convert Unique Identifier From String To Use In A Join / Where Clause

Jan 6, 2015

I am wanting to get the job name based on sys.sysProcesses.[Program_name] column. Why is this query not returning any results even though the 2nd substringed guids are found the the sysJobs table?

SELECTCASE
WHEN RTRIM([program_name]) LIKE 'SQLAgent - TSQL JobStep (Job %' THEN J.Name
ELSE RTRIM([program_name])
END ProgramName
, Val1.UqID
, Val1.UqIDStr

[Code] ......

View 6 Replies View Related

T-SQL (SS2K8) :: Store Binary Data Rather Than Int Or Binary?

May 7, 2015

I'm using a bit-wise comparison to effectively store multiple values in one column. However once the number of values increases it starts to become too big for a int data type.you also cannot perform a bitwise & on two binary datatypes. Is there a better way to store the binary data rather than int or binary?

View 9 Replies View Related

User Defined Function: Convert String Value Of Table To Table Object

Jul 20, 2005

Does anyone know where to find or how to write a quick user defined fucntionthat will return a table object when passed the string name of the tableobject. The reason why I want dynamicallly set the table name in a storedprocudue WITHOUT using concatination and exec a SQL String.HenceIf @small_int_parameter_previous = 1 then@vchar_tablename = "sales_previous"else@vchar_tablename = "sales"Endselect * from udf_TableLookup(@vchar_tablename )So if I pass 1, that means I want all records from "sales_previous"otherwise give me all records from "sales" (Sales_Previous would last yearssales data for example).udf_TableLookup would I guess lookup in sysobjects for the table name andreturn the table object? I don't know how to do this.I want to do this to avoid having 2 stored procedures..one for current andone for previous year.Please respond to group so others may benfiit from you knowledge.ThanksErik

View 2 Replies View Related

String Or Binary Data Would Be Truncated. (only For 1700 Character String?)

Nov 2, 2006

I am trying to insert a row into a table of Microsoft SQL Server 2000.

There are various columns.















[SNO] [numeric](3, 0) NOT NULL ,
[DATT] [char] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
,
[DATTA] [char] (3000) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
,
[CODECS] [char] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
,

The [DATTA] column is causing a problem. Even if I am trying to put only 1700 character string into [DATTA], the java code throws the following exception:-



StaleConnecti A CONM7007I: Mapping the following
SQLException, with ErrorCode 0 and SQLState 08S01, to a
StaleConnectionException: java.sql.SQLException: [Microsoft][SQLServer 2000
Driver for JDBC]Connection reset

      at
com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)


Why is it throwing an exception even though the sum-total of this row doesn't exceed 8000 characters?

Can anyone please tell me what's wrong?

View 6 Replies View Related

T-SQL (SS2K8) :: Pivot Query - Convert Data From Original Table To Reporting View

Apr 8, 2014

I want to convert the data from Original Table to Reporting View like below, I have tried but not get success yet.

Original Table:
================================================================
Id || Id1 || Id2 || MasterId || Obs ||Dec || Act || Status || InstanceId
================================================================
1 || 138 || 60 || 1 || Obs1 ||Dec1 || Act1 || 0|| 14
2 || 138 || 60 || 2 || Obs2 ||Dec2 || Act2 || 1|| 14
3 || 138 || 60 || 3 || Obs3 ||Dec3 || Act3 || 1|| 14
4 || 138 || 60 || 4 || Obs4 ||Dec4 || Act4 || 0|| 14
5 || 138 || 60 || 5 || Obs5 ||Dec5 || Act5 || 1|| 14

View For Reporting:

Row Header:
Id1 || Id2 || MasterId1 || Obs1 ||Desc1 ||Act1 ||StatusId1||MasterId ||Obs2 ||Desc2 ||Act2 ||StatusId2 ||MasterId3||Obs3 ||Desc3 ||Act3 ||StatusId3||MasterId4||Obs4||Desc4 ||Act4 ||StatusId4 ||MasterId5||Obs5 ||Desc5 ||Act5 ||StatusId5||InstanceId

Row Values:
138 || 60 || 1 || Obs1 ||Desc1 ||Act1 ||0 ||2 ||Obs2 ||Desc2||Act2 ||1 ||3 ||Obs3||Desc3 ||Act3 ||2 ||4||Obs4||Desc4 ||Act4 ||0 ||5 ||Obs5 ||Desc5 ||Act5 ||1 ||14

View 6 Replies View Related

How To Convert Int Value To Binary Format

Dec 10, 2001

Hi, guys,

I need something that can be used in a select statement to convert a int value to binary display format, for example:

5 would be displayed as 0101, etc...

Thanks

View 2 Replies View Related

Convert Binary To Decimal In A SP

Jun 3, 2002

Hi,

I need to write Stored Procedures to convert a Binary number to a Decimal number and Decimal back to Binary (i.e. 2 sp's).

I don't have a clue how I'm to do this. Can anyone help me !?

Pieter

View 1 Replies View Related

How Can I Convert Binary(8) To Datetime?

Feb 16, 2006

HI! :shocked:

I tried to convert 0x01C3F0F5012D36E0, binary(8) to datetime
But
How can I do that?

thanks for all

View 2 Replies View Related

How To Convert From Decimal To Binary In SQL?

Apr 10, 2008

Does anybody know
how to convert in SQL a number from decimal to binary:
Example: 'F' = 1111

I tried select convert(binary, 12.22) but SQL interprets the word 'binary' as Hex.

Thanks a lot!

View 10 Replies View Related

Convert Varchar(12) To Binary(12)

May 31, 2007

I need help converting a varchar field to binary.

I have a Data Control Task that has a OLE DB Source and corresponding OLE DB Destination Data Flow Task. In the referenced source table there exists a field defined as a varchar(12), in the corresponding destination table it is defined as a binary(12). How do I perform this conversion?

I tried inserting a Data Conversion Task and assigning the new data type as byte stream[DT_BYTES] and a Length = 12, but this was a bust. Output test is as follows:

Error: 0xC020901C at DFT - Windows, OLE_SRC - Windows [1]: There was an error with output column "Payload" (40) on output "OLE DB Source Output" (12). The column status returned was: "The value could not be converted because of a potential loss of data.".

Can anyone help me out here?

Regards,

View 1 Replies View Related

How To Construct Table With Unique PK

Oct 31, 2006

Let say I have 6 tables. I want to autogenerate the PK for each table and that is unique for each table and cant be duplicated on other tables. Let say I have table with PK of 1, so table2 to table6 wouldnt have a PK of 1. If table2 have a PK of 2, table1, table3 to table6 wouldnt have a PK of 2. Same for others. Identity will not be appropriate. Will 'uniqueidentifier' data type suffice? How bout guid? Or what must be my datatype? Or what will I do to implement this? Any links? Thanks

View 8 Replies View Related

How Can I Convert Binary(16) To Integer Or Numeric?

Feb 16, 2006

HI!!!:shocked:

Im trying to convert 0x00085180F0A2D511B69600508BE96424 to Integer or numeric format.

I just tried, At to many forms and combinations of that query
Help me !!!

SELECT CAST(CAST(CAST("field name " AS nvarchar) AS varbinary) AS float)

select cast(cast("field name " as varbinary)as integer)

select convert(int," field name") from FILE

select convert(varchar," field name") from FILE



The only answer that I have is
-1947638748 or ‘ ‘ or

And if I try with to many rows of the field at the same format,
It Answer me the same: -1947638748 for all the rows.

Thank`s for all

View 5 Replies View Related

How To Convert Binary Or Hexa To Decimal?

Jul 23, 2005

Hello,I'm trying to decifer the data in the table that stores the data in thebinary format. All numbers are placed in varbinary fields. All I know is theMS SQL 2000 database useing collation SQL_Latin1_General_CP1_CI_AS(default).For example the content of the field is:(0xB4F5000000000000) in unicode and defined as varbinary(8).Are there any procedures that convert the unicode binary (or hexa) numbersback to ascii or readable form?I tried as following but it didn't work.select cast(0xB4F5000000000000 as decimal(8,2))Any help is appreciated,Adam

View 1 Replies View Related

How To Convert Binary Trace Data

Jul 23, 2005

There must be a way to convert the binarydata field in the SQL trace outputto text data when the event type is a show plan. SQL Profiler does it buthow can it be done from an imported table?Danny

View 6 Replies View Related

Needed Sql Script To Convert Binary Content

Apr 1, 2007

Hi all,how r u everyone, guys i need a help, i have a interface in my application, adding attachments to issues, ie  users can attach a file for a particular issue and if anyone have to view they ve click a link and it will download.iam using filestream and binaryreader concept in that, ie read the file using filestream and then use binaryreader.readbytes method to convert it into byte array and store it in the database in a column with a image datatype as a binary content.            FileStream oImg;            BinaryReader oBinaryReader;            byte[] oImgByteArray;             oImg = new FileStream(sFilePath,FileMode.Open,FileAccess.Read);            oBinaryReader = new BinaryReader(oImg);            oImgByteArray = oBinaryReader.ReadBytes((int)oImg.Length);             oBinaryReader.Close();            oImg.Close(); this is the code iam using.when i use this its taking so much of time to get uploaded. so what i thought of doing is save the file in a specific folder using some postedfile.saveas(not sure of syntax) and when the user wants to view the file they can just download the file. i can do this by googling but what i want is wat abt the existing attachments in the database. so i need a help to do this........ is it possible to create a query to read the files and convert it into original file and save it in the specific folder or do i ve to create a simple interface to create do it manually , pls someone help me what to do ......thanks in advance.waiting for a reply soon Note: any unclear statement in my question kindly reply meWishes n RegardsVenkat. 

View 2 Replies View Related

SIMPLE Command To Convert String To Number? Not CAST Or CONVERT.

Aug 15, 2006

Dear Experts,Ok, I hate to ask such a seemingly dumb question, but I'vealready spent far too much time on this. More that Iwould care to admit.In Sql server, how do I simply change a character into a number??????In Oracle, it is:select to_number(20.55)from dualTO_NUMBER(20.55)----------------20.55And we are on with our lives.In sql server, using the Northwinds database:SELECTr.regionid,STR(r.regionid,7,2) as a_string,CONVERT(numeric, STR(r.regionid,7,2)) as a_number,cast ( STR(r.regionid) as int ) as cast_to_numberFROM REGION R1 1.00112 2.00223 3.00334 4.0044SELECTr.regionid,STR(r.regionid,7,2) as a_string,CONVERT(numeric, STR(r.regionid,7,2) ) as a_number,cast (STR(r.regionid,7,2) as numeric ) as cast_to_numberFROM REGION R1 1.00112 2.00223 3.00334 4.0044Str converts from number to string in one motion.Isn't there a simple function in Sql Server to convertfrom string to number?What is the secret?Thanks

View 4 Replies View Related

Function Required To Convert Packed Decimal In Binary(6) To Int (or Float)

Mar 8, 2007

I have been given some data from a Mainframe (AS400?) which has some fields coded in Packed Decimal. I have been able to load the data into a SQL2005 database table, but I now need to convert the Packed Decimal data in the binary(6) field to the appropriate integer (or float) value.

The field contains values such as the following:-

0x20202020200C

0x202020022025

0x20202020DFFA

I don't know how to interpret these. Has anyone got a function that can do this for me?

I've read several articles online that explain how packed decimal works, but none tell me how to interpret the last of my three examples. Can you help?

Thanks!

View 2 Replies View Related

Converting Binary To String

Jun 27, 2006

is there a way to query a varbinary column and print the readable char in query analyzer?
thanks in advance!
Ryan

View 3 Replies View Related

Converting A Hex String To Binary

Jul 18, 2006

I am trying to write a function to convert a hex string to binary. I would like it in a function so I can use it on aggregate data in queries (instead of having to cursor through the data). So, I write my function:

CREATE FUNCTION HexToBinary (@hexstring char(16)) RETURNS binary(8)
AS
BEGIN
declare @b binary(8)
,@sql nvarchar(255)

SET @sql = N'SET @b = 0x' + @hexstring
EXEC sp_executesql @sql,N'@b binary(8) out',@b output
RETURN @b
END

Then, I try to call my function:

SELECT HexToBinary('E0')

...and I get:

Msg 195, Level 15, State 10, Line 1
'HexToBinary' is not a recognized built-in function name.

However, I can get it to work if I use a slightly different syntax:

declare @b binary(8)
exec @b = HexToBinary 'E0'
select @bAny thoughts as to what might be going on? Obviously, the lower syntax does not help me call this function in queries, which is really my goal.

View 6 Replies View Related

String Or Binary Data Would Be Truncated

Aug 9, 2006

Hi Folks,
After I inserted a row in my Database (row 27) I started getting this error when I try to insert, update or delete the record in the database.
I've searched about the error on google and it says that I should have a field that crossed the limit of characters.
I have only the autoincrement field, two varchar fields and a text field, neither one of the varchar fields crossed the limit, they arent even close. I found in google that one solution would be turn the field that is having problems in a text field, but the only field that actually can be causing the problem already is of the text type.
The exact error I get on VS 2005 when trying to change something in the row 27 is:
"No row was updated.
The data in row 27 was not committed.Error Source: .Net SqlClient Data Provider.Error Message: String or binary data would be truncated.The statement has been terminated.
Corret the errors and retry or press ESC to cancel the change(s)."
I need some help guyz, see ya, hugs.

View 3 Replies View Related

String Or Binary Data Would Be Truncated.

Jan 21, 2007

Hi Guys, I'm trying to save the data into 2 table when i click the button. But it pops out this error: String or binary data would be truncated. The statement has been
terminated. Description:
An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and
where it originated in the code. Exception Details:
System.Data.SqlClient.SqlException: String or binary data would be
truncated. The statement has been terminated.Source Error:




Line 116:Line 117: Sqlinsert.Connection.Open()Line 118: Sqlinsert.ExecuteNonQuery()Line 119:Line 120: Sqlinsert.Connection.Close()  I Don't know what it means so i paste my codes regarding the button & the redline   Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
'add the data into shopper


Dim strsqlcmd As String

Dim strName, straddress As String
Dim strContact, strEmail, strPw As String
Dim strIC As String


strName = txtName.Text
straddress = txtAdd.Text
strEmail = txtEmail.Text
strContact = txtboxContact.Text
strIC = txtIC.Text


strsqlcmd = "Insert Into Shopper (Name, Address, Contact, Email, IC) Values (@Name, @Address, @Contact, @Email, @IC)"

SqlCommand1.CommandText = strsqlcmd
With SqlCommand1.Parameters
.Add("@Name", strName)
.Add("@Address", straddress)
.Add("@Contact", strContact)
.Add("@Email", strEmail)
.Add("@IC", strIC)
End With
SqlCnt.Open()

SqlCommand1.ExecuteNonQuery()

SqlCnt.Close()

'add the data into the presc


strsqlcmd = "Insert Into Prescription (Name, Address, Contact, Email, IC) Values (@Name, @Address, @Contact, @Email, @IC)"

Sqlinsert.CommandText = strsqlcmd
With Sqlinsert.Parameters
.Add("@Name", strName)
.Add("@Address", straddress)
.Add("@Contact", strContact)
.Add("@Email", strEmail)
.Add("@IC", strIC)
End With

Sqlinsert.Connection.Open()
Sqlinsert.ExecuteNonQuery()

Sqlinsert.Connection.Close()


' go the add item
Response.Redirect("NewPrescItem.aspx")  why my sqlinsert.excutenonquery will have this error? and what is this error really means? Thanks in advance 

View 3 Replies View Related

String Or Binary Data Would Be Truncated

Sep 12, 2007

I am currently developing a simple program that will upload ms-word documents to a database so users can view them within the department.
The program worked prefectly while using sql 2005 with the these fields:
FormId            intFileName        nvarchar(50)FileBytes        varbinary(Max)
This was done in unit testing, now in system testing there is a difference.
A slight downgrade in the database and server software!
We are using sql 2000 on a 2000 server and the FileBytes datatype had to change to the following:
FormId           intFileName       nvarchar       50 FileBytes       varbinary      8000
There is no 'Max' option in sql 2000 for the datatype varbinary. 
So when the insert is perform, we get this error message:
 String or binary data would be truncated.The statement has been terminated.
I am guessing it has something to do with FileBytes, because this is the only thing that changed.
I just don't know how to solve the problem.P.S.The application is in ASP.NET 2.0
 
Thanks,
xyz789
 
 
 
 

View 4 Replies View Related

String Or Binary Data Would Be Truncated.

Oct 8, 2007

I keep getting the error "String or binary data would be truncated." when I try to insert data into SQL Sever 2005 from an ASP.net page.  Having searched thoughout the web, I know this is generally caused because one of the values being inserted is bigger than the size of the field it's going into.  But, I have tested this out in many different ways, and this is not what's causing the problem.
I have tried doing the insert as a SQL statement and using the "ExecuteNonQuery" command.  I have also tried running this through a stored procedure.  Neither works.  In both situations, I have captured the TSQL statements via SQL Profiler and run them in a query window.  In both cases, the statements work just fine in a query window.
When I try to do the insert via a stored procedure, all of the statements in the stored procedure show up in SQL Profiler, including the final SELECT statement I have the indicates a successful result.  But, the data does not end up in the table and the ASP.net page returns an error.
Also, I have run both the Stored Proceure and the SQL insert statement making all of the fields blank as a way of ensuring that no value can be longer than a field's size.  But, in both cases I still get the same error.
Here's the line I use when doing a regular insert:
Dim Command4 = New Data.SqlClient.SqlCommand("INSERT INTO ResourceCenter(UserEmail, UserPassword, Region, FirstName, LastName, Company, JobTitle, Address1, Address2, City, StateProvince, ZipPostalCode, Country, BusinessPhone, WebSiteURL, HowDidYouFind, Industry, WhatTypeOfSolution, CompanySize, NumLogins, LastLogin) VALUES ('" & UserEmail & "', '" & UserPassword & "', '" & Region & "', '" & FirstName & "', '" & LastName & "', '" & Company & "', '" & JobTitle & "', '" & Address1 & "', '" & Address2 & "', '" & City & "', '" & StateProvince & "', '" & ZipPostalCode & "', '" & Country & "', '" & BusinessPhone & "', '" & WebSiteURL & "', '" & HowDidYouFind & "', '" & Industry & "', '', '', 1, " & Now & ")", conn2)
Dim NumRowsUpdated2 = Command4.ExecuteNonQuery()
Here's my code when I call a stored procedure:
Dim dsSignup As New Data.DataSet()Dim Command4 As New Data.SqlClient.SqlDataAdapter("ap_ResourceCenterModify", conn2)Command4.SelectCommand.CommandType = Data.CommandType.StoredProcedureCommand4.SelectCommand.Parameters.Add("@UserID", Data.SqlDbType.Int, 0).Value = 0Command4.SelectCommand.Parameters.Add("@UserEmail", Data.SqlDbType.VarChar, 100).Value = UserEmailCommand4.SelectCommand.Parameters.Add("@UserPassword", Data.SqlDbType.VarChar, 20).Value = UserPasswordCommand4.SelectCommand.Parameters.Add("@Region", Data.SqlDbType.VarChar, 50).Value = RegionCommand4.SelectCommand.Parameters.Add("@FirstName", Data.SqlDbType.VarChar, 100).Value = FirstNameCommand4.SelectCommand.Parameters.Add("@LastName", Data.SqlDbType.VarChar, 100).Value = LastNameCommand4.SelectCommand.Parameters.Add("@Company", Data.SqlDbType.VarChar, 100).Value = CompanyCommand4.SelectCommand.Parameters.Add("@JobTitle", Data.SqlDbType.VarChar, 100).Value = JobTitleCommand4.SelectCommand.Parameters.Add("@Address1", Data.SqlDbType.VarChar, 100).Value = Address1Command4.SelectCommand.Parameters.Add("@Address2", Data.SqlDbType.VarChar, 100).Value = Address2Command4.SelectCommand.Parameters.Add("@City", Data.SqlDbType.VarChar, 100).Value = CityCommand4.SelectCommand.Parameters.Add("@StateProvince", Data.SqlDbType.VarChar, 50).Value = StateProvinceCommand4.SelectCommand.Parameters.Add("@ZipPostalCode", Data.SqlDbType.VarChar, 50).Value = ZipPostalCodeCommand4.SelectCommand.Parameters.Add("@Country", Data.SqlDbType.VarChar, 200).Value = CountryCommand4.SelectCommand.Parameters.Add("@BusinessPhone", Data.SqlDbType.VarChar, 100).Value = BusinessPhoneCommand4.SelectCommand.Parameters.Add("@WebSiteURL", Data.SqlDbType.VarChar, 200).Value = WebSiteURLCommand4.SelectCommand.Parameters.Add("@HowDidYouFind", Data.SqlDbType.VarChar, 100).Value = HowDidYouFindCommand4.SelectCommand.Parameters.Add("@Industry", Data.SqlDbType.VarChar, 100).Value = IndustryCommand4.SelectCommand.Parameters.Add("@WhatTypeOfSolution", Data.SqlDbType.VarChar, 250).Value = WhatTypeOfSolutionCommand4.SelectCommand.Parameters.Add("@CompanySize", Data.SqlDbType.VarChar, 100).Value = CompanySizeCommand4.Fill(dsSignup)Any ideas of what else I can try?  Thanks in advance.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved