Component GUID

Apr 28, 2008

Exists any easy way to renew component GUID without having to recreate the component?

View 6 Replies


ADVERTISEMENT

The Component Metadata For Component DataReader Source (1113) Could Not Be Upgraded To The Newer Version Of The Component.

Oct 26, 2007

Hello,

I have a package that has a data lfow task. this task imports data from a db2 database (using the IBM Ole DB provider fro db2) and adds it to sql server database table. This package was created on the server. then though version control (using TFS source control) I check out the package on my local machine. and when I open the package I get the foll 3 errors.

Error 1 Validation error. Import Account Num from BMGP_BDR: DTS.Pipeline: The component metadata for "component "DataReader Source" (1113)" could not be upgraded to the newer version of the component. The PerformUpgrade method failed.

Error 2 Error loading BMAG Download Xref Tables - bmag.dtsx: Microsoft.SqlServer.Dts.Pipeline.ComponentVersionMismatchException: The version of component "DataReader Source" (1113) is not compatible with this version of the DataFlow. [[The version or pipeline version or both for the specified component is higher than the current version. This package was probably created on a new version of DTS or the component than is installed on the current PC.]] at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostCheckAndPerformUpgrade(IDTSManagedComponentWrapper90 wrapper, Int32 lPipelineVersion)

Error 3 Error loading BMAG Download Xref Tables - bmag.dtsx: The component metadata for "component "DataReader Source" (1113)" could not be upgraded to the newer version of the component. The PerformUpgrade method failed.


Please advice.
Thank you.





View 7 Replies View Related

The Component Metadata For Component DataReader Source Could Not Be Upgraded To The Newer Version Of The Component.

Jan 23, 2007

Hi,

I have a package which reads an Access file from a folder. My connection manager to this file is .NET providers for OledbMicrosoft Jet 4.0 OLE DB Provider.

Package works from my computer. But when I execute it on the server as a SQL Agent job, I get







The component metadata for "component "DataReader Source" (1) could not be upgraded to the newer version of the component. The PerformUpgrade method failed.  

I copied the mdb file to a folder on the server which my packages have no problem reading data from.

My packages run under the same domain account as defined in proxies.

Appreciate a help.

Gulden

 

 

View 4 Replies View Related

Populate GUID Column In Table B With Values From GUID Column In Table A

Mar 4, 2008


How do I update the OrderGUID column in Table B with Values from OrderGUID column in Table A. I have already populated the OrderGUID column in Table A using NEWSEQUENTIALID(). Now I need to populate the OrderGUID column in Table B with Matching GUID values from the OrderGUID Column in Table A.

Does any one have a script to accomplish this task. thanks

View 4 Replies View Related

Use Of A SSIS Variable Of Type “Object� Inside Script Component And Task Component

Mar 16, 2007

In a Data Flow, I have the necessity to use a SSIS variable of type €œObject€? inside Script Component and assign to it the content of 'n' variables of string type.
On exiting from the script the variable of type object should contain something like in the following lines:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
DDDDDDDDDDDDDDDDDDDDDDDDDDDDD
€¦€¦€¦€¦€¦€¦€¦.
€¦€¦€¦€¦€¦€¦€¦.
On exiting from the data flow I will use the variable of type Object in a Script Task, by reading each element in a cyclic fashion.
Is there anyone who have experienced something like this? Could anyone provide any example of that?
Thanks in advance!

View 3 Replies View Related

A Custom Component For Use As A VIEW In SSIS- Is It Possible To Create One MERGE Like Component With More Than 2 Inputs

Aug 13, 2007

Hi all
I'm into a project which uses a lot of views for joining 2 or more tables. Using the MERGE component in SSIS will be a huge effort coz it only has 2 inputs and I gotta SORT the input too.
Isnt it possible to have a VIEW like component that joins more than 2 tables and DOESNT need sorting??
(I've thought about creating views in database engine but it breaks my data floe in SSIS and is'nt a practical solution)

View 4 Replies View Related

Reference To Preceeding Component From Custom Dataflow Transformation Component

Mar 30, 2006

I am writing a custom dataflow transformation component and I need to get the name of the preceeding component.

I have been trying to find a way to get a reference to the Package object, MainPipe object or IDTSPath90 object (connecting to the IDTSInput90 of my component) from my component because I think from there I can get to the information I want.

Does anyone have any suggestions?

TIA . . . Ed

View 7 Replies View Related

Serious Script Component Bug - Clears Out All Code Inside Component

Nov 27, 2007



No idea where this bug crept in from. Have been using SSIS for 1.5 years now without hitting this problem.

I had a script component opening an XML document and parsing it using XPATH. I added some code that uses StreamReader / Streamwriter (closing one stream before starting the other). The code works without issue in my C# app.

And it ran without issue 2-3 times in SSIS. Then suddenly after running my package again, the script component says it completes successfully, yet nothing happens. I set a breakpoint on the first line of code - it never hits it. I add a msgbox as the first line of code - and it never displays.

I then close my package / exit out of ssis ... and then re-open it. When i open my script component, all of my code is GONE. All references that I added are gone.

I tried adding the streamreader/writer process to a dll I created from my c# app ... and added the DLL to the package -- same result.

I can reproduce this on 2 different computers.

Anyone experience this problem ? Any idea how to stop it ? Or debug it ?


Here is a slimmed down code sample of what causes the error :


Public Class ScriptMain
Public Sub Main()
Try
Dim xmlDoc As New XmlDocument
xmlDoc.Load("c:ulkasync_86281519_20070628045850225_4.xml")
MsgBox("xmlLoaded") --this doesn't display once the package starts "acting up"
Catch ex As Exception
MsgBox(ex.Message)
UpdateXML("c:ulkasync_86281519_20070628045850225_4.xml", ex.Message)
End Try
Dts.TaskResult = Dts.Results.Success
End Sub
Private Sub UpdateXML(ByVal fileName As String, ByVal message As String)
Try
Dim invalidChar As String = message.Trim().Substring(message.Trim().IndexOf("0x"), 4)
Dim rd As StreamReader = New StreamReader(fileName)
Dim xml As String = rd.ReadToEnd()
Xml = Xml.Replace(invalidChar, String.Empty)
xml = xml.Replace("", String.Empty)
xml = xml.Replace("<![CDATA[<![CDATA[", "<![CDATA[")
xml = xml.Replace("]]>]]>", "]]>")
MsgBox("replaced")
rd.Close()
Dim wr As StreamWriter = New StreamWriter(fileName)
wr.Write(xml)
wr.Close()
Dim xdoc As XmlDocument = New XmlDocument()
xdoc.Load(fileName)
Catch ex As Exception
UpdateXML(fileName, ex.Message)
End Try
End Sub
End Class

View 4 Replies View Related

GUID&#39;s

Feb 1, 2001

we are currently using id's as primary key and replication is not part of our project.
will this be a problem if we decide to do replication? will microsoft generate an identifier then.
what is the advantages of using GUID now or doing it latter?

View 1 Replies View Related

GUID

May 26, 2006

Hello,

I'm working on a smart client app that has an offline sql express store and needs to work with several types of central databases (support for multiple products - ms sql, DB2 etc)

While trying to put together some offline functionality that needs the user to create records on the offline sql express data store, we've run into the need of being able to uniquely identify records so replicating the data in the offline store back into the primary database should not be a problem.

The data created offline spans many tables and involves several tables with relation ships - FK etc...Clearly not a simple case of store and forward.

We dont want to get into the mess of performing key replacement during a synch job with the server. Thats way too much trouble.

GUID seems like a good choice, but as always we have several stake holders having different opinions. And with databases other than MS SQL we will have to store them as strings.

To cut to the chase - can we not hash a GUID to get an integer while retaining atleast the same likelyhood of producing unique ids ? [no drop]

Thanks,

Aviansh



View 13 Replies View Related

Profile GUID

Apr 13, 2007

I am using a SqlDatasource and need to set a SelectParamter to the ProviderUserKey (The GUID of the user when Profiles are enabled)
 Can anyone tell me whether it is possible and How?
I am currently using the session state to store it in and then using the session=... to get the value into the parameter.
Is there a direct way of passing this value into a SelectParameter when using a SqlDataSource?
Thanks in advance.

View 3 Replies View Related

How To Specify A Guid In A WHERE Clause

Sep 25, 2007

Hi Everyone,
  I'm trying to create a SQL Delete statement using a string builder and the WHERE clause uses a Guid. Here is the code:stb.Append("DELETE FROM UserRights WHERE UserIDPtr = ");
stb.Append(TargetUserID);The resulting string is:  "DELETE FROM UserRights WHERE UserIDPtr = e01549fb-edf5-4668-de8b-b13dd5661a6e"
When I try to do an ExecuteNonQuery() using the string as the CommandText, I get an error.
Invalid column name 'e01549fb',Invalid column name 'edf5',Invalid column name 'de8b',Invalid column name 'b13dd5661a6e'
It is also strange that '4668' did not show up as an invalid column name, but I don't think that is relavent to this issue.
Can someone show me (or point me to an article) about using Guid's in a text string as a SQL command? Thanks in advance!

View 2 Replies View Related

GUID Issues

May 5, 2008

My database is using the membership store for all the user information. I added a tabel "Skills" with 3 fields "SkillID (GUID)" "SeekerID (GUID, This is the UserId)" and "SkillName ( Varchar(MAX))"
on the page i have a ListView setup to display the SkillName fields based on the SeekerID.
The original code was     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
          ' Get a reference to the currently logged on user          Dim CurrentUser As MembershipUser = Membership.GetUser
          ' Determine the currently logged on user's UserId value
          Dim SeekerID As Guid = CType(CurrentUser.ProviderUserKey, Object)
     End Subthat kept returning string to GUID conversion errors, so i had to change  Dim SeekerID As Guid = CType(CurrentUser.ProviderUserKey, Object) to Dim SeekerID As Object = CType(CurrentUser.ProviderUserKey.ToString(), Object) that appears to be working now. On the same page however, I want to insert records into the table, I tried 2 options both of which have a different problem.
     Option 1: Use a textbox (ID = NewSkill) and a button with the following code on it:
          Protected Sub SetNewSkill_Click(ByVal sender As Object, ByVal e As System.EventArgs)               Dim CurrentUser As MembershipUser = Membership.GetUser
               Dim SeekerGUID As Object = CType(CurrentUser.ProviderUserKey, Object)
 
               Dim NewSkill As TextBox = CType(FindControl("NewSkill"), TextBox)               Dim connectionString As String = ConfigurationManager.ConnectionStrings("QJSdatabase").ConnectionString()
               Dim insertSql As String = "INSERT INTO Skills(SeekerID, SkillName)VALUES(@SeekerGUID, @NewSkill)"               Using myConnection As New SqlConnection(connectionString)
                    myConnection.Open()                    Dim myCommand As New SqlCommand(insertSql, myConnection)
                    myCommand.Parameters.AddWithValue("@SeekerGUID", SeekerGUID)                    myCommand.Parameters.AddWithValue("@NewSkill", NewSkill.Text.Trim())
                    myCommand.ExecuteNonQuery()
                    myConnection.Close()
               End Using
          End Sub
 
     Problem: myCommand.Parameters.AddWithValue("@NewSkill", NewSkill.Text.Trim())  gets outlined and returns the error: Object reference not set to an instance of an object
 
     Option 2: Use a DetailsView linked to a SQLDataSource on the page
           <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="210px"
               AutoGenerateRows="False" DataSourceID="SqlDataSource2" DefaultMode="Insert">                    <Fields>
                         <asp:BoundField DataField="SkillName" HeaderText="Add Skill:" SortExpression="SkillName" />
                         <asp:CommandField ShowInsertButton="True" />
                         <asp:TemplateField InsertVisible="False">
                              <EditItemTemplate>
                                   <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                              </EditItemTemplate>
                              <ItemTemplate>
                                   <asp:Label ID="Label1" runat="server"></asp:Label>
                              </ItemTemplate>
                    </asp:TemplateField>
               </Fields>
          </asp:DetailsView>
           <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:database %>"
               DeleteCommand="DELETE FROM [Skills] WHERE [SkillID] = @SkillID"                InsertCommand="INSERT INTO [Skills] ([SeekerID], [SkillName]) VALUES (@SeekerGUID, @SkillName)"
               SelectCommand="SELECT SkillName FROM [Skills]"
               UpdateCommand="UPDATE [Skills] SET [SkillName] = @SkillName WHERE [SkillID] = @SkillID">
                    <DeleteParameters>
                         <asp:Parameter Name="SkillID" Type="Object" />
                    </DeleteParameters>
                    <InsertParameters>
                         <asp:Parameter Name="SeekerGUID" Type="Object" />
                         <asp:Parameter Name="SkillName" Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                         <asp:Parameter Name="SkillName" Type="String" />
                         <asp:Parameter Name="SkillID" Type="Object" />
                    </UpdateParameters>
            </asp:SqlDataSource>
 
            http://junk.icore-studios.com/junk/Codeissues/postresumeerror.html
The @SeekerGUID is being generated by the same pageload code as the first chunk i gave (I have 2 variables SeekerID is the GUID converted to string to work with the ListView filter and SeekerGUID is the GUID)
 
Ultimatly getting either option to work would be fine. Though I think the second would be preferable because I think it'd be easier to replicate later on.
Thanks in advance for your time and any help

View 3 Replies View Related

GUID Troubles.

Apr 17, 2004

Hi,

I am having a hard time updating a database row using a UNIQUEIDENTIFIER. I retrieve the row into a datagrid and then use the GUID as a parameter to a stored procedure, but it doesn't update. If I run the query in SQL Analyser ... it works. Any ideas ? Here's my stored proc ... I tried passing a varchar and doing the conversion in the SP ... no go !! I am using MApplicationBlockD.


CREATE PROCEDURE spScanUpdate
@id varchar (100),
@name varchar (75)
AS
DECLARE @GUID_ID as uniqueidentifier
SELECT@GUID_ID = CAST ( @id as uniqueidentifier )

UPDATE tScan
SET name = @name
WHEREid = @GUID_ID
GO

View 5 Replies View Related

GUID Vs Integer

Apr 17, 2006

I use MS SQL Server 2005...Is there a structural advantage/disadvantage with using GUID as oposed to an integer?(also I use the sqltableprofileprovider and it doesnt seem to work with uniqueidentifiers)

View 6 Replies View Related

A GUID Question

Sep 26, 2007

does SQL Server have the equivalent of the Identity or Scope_Identity functions that can be used to return the last GUID PK?

View 5 Replies View Related

GUID Performance

Apr 11, 2008

I have a database with tables with GUID's als primary keys.

Because of the uniqueness GUID's are a performance hit on INSERT records.

So I wanted to use NEWSQUENTIALID() to make INSERTS faster.

Does NEWSQUENTIALID() increase performance as well with SELECT statements? Or is the benefit between NEWID() and NEWSQUENTIALID() only when INSERTing records?



Henri
~~~~
There's no place like 127.0.0.1

View 3 Replies View Related

Loving GUID's

Apr 29, 2008

I'm reluctant to admit I'm in love with uniqueidentifiers AKA guid's.

However, this love comes with a cost because of the size and thus SQL Cache and thus IO reads (and fragmented index pages and so on)

My love has to do with generic programming and keeping multiple database updateable (adding core functionality with the flexibility to let users add and change data in tables that have core data in it as well). Also merging databases is easy or relate different entities by storing a metadata link table.

So, what I'm trying to do is making the disadvantages as small as possible.

So I'm using NEWSEQUENTIAL Id's and retrieve new made records with OUTPUT as TABLE.

So I changed the default CLUSTERED INDEX as NON-CLUSTERED.

I'm not fond on usings numerics for some primary keys and uniqueidentifiers for others.

What else can I do to keep using GUID's as primary keys with as less disadvantages as possible?

Henri
~~~~
There's no place like 127.0.0.1

View 13 Replies View Related

GUID As Primary Key

Mar 13, 2008

I have a table profiles and a table resumes.
The id's are currently int indentity fields.
I was thinking of using a GUID as ID.

Why would i do this ?

In my webapplication I have i.e. this page
DeleteProfile.aspx?profileId=1

I don't want to give the user the ability to change this to f.e.
DeleteProfile.aspx?profileId=3

A user will almost possibly never guess a certain GUID, right ?

Is this a good idea, or not ?

View 6 Replies View Related

Guid Vs Identity

Jul 20, 2005

Hi,Is there any replace for "Select @@identity" that could return "justinserted" GUID as a primary key?Has anyone tested what's faster, working with Guid or Autonumber ?

View 24 Replies View Related

Is A GUID Always Unique?

Jul 20, 2005

Greetings All, I have read many upon many articles here regarding GUIDdata types and uniqueness. There have been many opinions regardingthe effectiveness of GUID's and when they should/should not be used.However, every article strongly implies, if it does not state itoutright, that GUID's are always unique. My question is this, whathappens if you have a database that uses GUID's and the NIC is changedout on the box? From what I understand the MAC address of the NIC isused as part of the algorithm to generate a GUID. If you change outthe NIC after generating 1 billion GUID's do you run the chance ofgenerating a duplicate GUID?I look forward to your insightfulness on this issue.Regards, Louis.

View 4 Replies View Related

How To Get The SQLEXPRESS GUID ?

Feb 26, 2007

Hi, please can someone be so kind and tell me the fastet way to get the GUID of the running SQLExpress instance ?

Sincerely,gonzo883.

View 5 Replies View Related

GUID In Mobile SQL

Mar 12, 2006

I have been trying to setup the GUID new GUID when I add a row into a Pocket PC WM 5.0 Mobile SQL (*.sdf) utilizing C# through Visual Studio 2005 - targetting Pocket PC Smart Device

Any help would be most welcome...

Thanks

View 7 Replies View Related

GUID Question

Sep 17, 2006

I am reading a book and it talks a little bit about using GUIDs as primary keys. I am very confused about this because if this is a generated value per table, how could you use it as a foreign key in another table as it appears to be uniquely generated per table. Here is the code in the book which I don't understand. Can someone explain this in simple terms?

I know the identity column would be a problem if I had a multi-terabyte database with huge tables, so what do I do in this situation?

create table dbo.product(

productid uniqueidentifier not null

rowguidcol default (newid())

primary key nonclustered

etc

thx,

Kat

View 5 Replies View Related

Return GUID On Insert

Oct 24, 2007

once upon a time someone told me how to do this, but i forget, and it was for classic asp..
 so what im trying to do is create a new record (a workstation) and get back the auto generated ID (its not actually a GUID, its an int which is set to the identity) and then once i have that create other records (for external devices, different table) that will have a link to which machine they are attached to (that Id im looking to get returned)
I know this can be done in a two step process, create the record, query it for its id, and then slap that in my next insert statement for the external devices... but... i know there was a way to do it before and i assume there is a way to do it now...
anyone know how?
Thanks
Justin

View 8 Replies View Related

Getting GUID Value From StoredProcedure.ExecuteScalar()

Jun 12, 2008

I need to execute stored procedure which is suppose to return GUID to my IF statement and if it is Nothing I execute other Stored procedures else some other procedures. My problem is that even though by looking at the data I know that after the execution of the procedure it should return some guid value it doesn't anybody who had the same issue??? That is the code block where I am trying to return guid from my stored procedure:   getGroupID.Parameters("@GroupName").Value = dr.Item("Group ID").ToString()            If getGroupID.ExecuteScalar() = Nothing Then                'Find Group by IP address if input Data Table doesn't have group                getGroupIDByIP.Parameters("@IP").Value = dr.Item("IP").ToString()                If getGroupIDByIP.ExecuteScalar() = Nothing Then                    insertGroup.Parameters("@GroupID").Value = Guid.NewGuid                    insertGroup.Parameters("@Group").Value = dr.Item("Group ID")                    insertGroup.Parameters("@ACCID").Value = getAccID.ExecuteScalar()                    insertGroup.ExecuteNonQuery()                    command.Parameters("@Group_ID").Value = getGroupID.ExecuteScalar()                Else                    command.Parameters("@Group_ID").Value = getGroupIDByIP.ExecuteScalar()                End If            Else                command.Parameters("@Group_ID").Value = getGroupID.ExecuteScalar()            End If Thank you 

View 2 Replies View Related

How Can I Verify A GUID Number ?

May 13, 2004

Dear SQL,

I need to SELECT something from a database that has a UNIQUEIDENTIFIER (GUID) field,

If the number is wrong (has some other than A-Z 0-9) than the ASP page just freaks out and gets "error converting from a character string to uniqueidentifier"

How can I check that the GUID is OK before I SELECT ?
this is the number format:
{7A9B5F81-4936-4A31-B4E2-9168AAB75A0}

I tried to cast this "error" number with no successs:
"WHERE Deceased_ID = cast('"& "---------4936-4A31-B4E2-9168AAB75A0" &"' as uniqueidentifier)"


Thanks in advance, Yovav.

View 5 Replies View Related

Inserting Into A Table With Guid As Key

May 23, 2004

I am having a terrible time doing an insert.... dispite what the error message says, I think it has something to do with trying to insert a GUID (my primary key).... but I am probably wrong :-)

Any ideas


The error message


Server Error in '/LightQuote' Application.
--------------------------------------------------------------------------------

Prepared statement '(@User_ID uniqueidentifier,@User_Type int,@Status int,@UserName ' expects parameter @UserName, which was not supplied.
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: Prepared statement '(@User_ID uniqueidentifier,@User_Type int,@Status int,@UserName ' expects parameter @UserName, which was not supplied.

Source Error:


Line 195: dbConnection.Open()
Line 196: Try
Line 197: rowsAffected = dbCommand.ExecuteNonQuery
Line 198: Finally
Line 199: dbConnection.Close()



The Insert Function

Public Function InsertOneUser( _
ByVal user_ID As System.Guid, _
ByVal user_Type As Integer, _
ByVal status As Integer, _
ByVal userName As String, _
ByVal password As String, _
ByVal secret_Question As Integer, _
ByVal secret_Answer As String, _
ByVal company As String, _
ByVal company_Type As Integer, _
ByVal first_Name As String, _
ByVal last_Name As String, _
ByVal address1 As String, _
ByVal address2 As String, _
ByVal city As String, _
ByVal state As String, _
ByVal zip As String, _
ByVal country As String, _
ByVal day_Phone As String, _
ByVal night_Phone As String, _
ByVal fax As String, _
ByVal email As String, _
ByVal web_Site As String) As Integer
Dim myConnection As New Connection
Dim connectionString As String = myConnection.ConnString
Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)

Dim queryString As String = "INSERT INTO [tblUser] ([User_ID], [User_Type], [Status], [UserName], [Password], " & _
"[Secret_Question], [Secret_Answer], [Company], [Company_Type], [First_Name], [L" & _
"ast_Name], [Address1], [Address2], [City], [State], [Zip], [Country], [Day_Phone" & _
"], [Night_Phone], [Fax], [Email], [Web_Site]) VALUES (@User_ID, @User_Type, @Sta" & _
"tus, @UserName, @Password, @Secret_Question, @Secret_Answer, @Company, @Company" & _
"_Type, @First_Name, @Last_Name, @Address1, @Address2, @City, @State, @Zip, @Coun" & _
"try, @Day_Phone, @Night_Phone, @Fax, @Email, @Web_Site)"
Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection

Dim dbParam_user_ID As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_user_ID.ParameterName = "@User_ID"
dbParam_user_ID.Value = user_ID
dbParam_user_ID.DbType = System.Data.DbType.Guid
dbCommand.Parameters.Add(dbParam_user_ID)
Dim dbParam_user_Type As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_user_Type.ParameterName = "@User_Type"
dbParam_user_Type.Value = user_Type
dbParam_user_Type.DbType = System.Data.DbType.Int32
dbCommand.Parameters.Add(dbParam_user_Type)
Dim dbParam_status As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_status.ParameterName = "@Status"
dbParam_status.Value = status
dbParam_status.DbType = System.Data.DbType.Int32
dbCommand.Parameters.Add(dbParam_status)
Dim dbParam_userName As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_userName.ParameterName = "@UserName"
dbParam_userName.Value = userName
dbParam_userName.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_userName)
Dim dbParam_password As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_password.ParameterName = "@Password"
dbParam_password.Value = password
dbParam_password.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_password)
Dim dbParam_secret_Question As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_secret_Question.ParameterName = "@Secret_Question"
dbParam_secret_Question.Value = secret_Question
dbParam_secret_Question.DbType = System.Data.DbType.Int32
dbCommand.Parameters.Add(dbParam_secret_Question)
Dim dbParam_secret_Answer As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_secret_Answer.ParameterName = "@Secret_Answer"
dbParam_secret_Answer.Value = secret_Answer
dbParam_secret_Answer.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_secret_Answer)
Dim dbParam_company As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_company.ParameterName = "@Company"
dbParam_company.Value = company
dbParam_company.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_company)
Dim dbParam_company_Type As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_company_Type.ParameterName = "@Company_Type"
dbParam_company_Type.Value = company_Type
dbParam_company_Type.DbType = System.Data.DbType.Int32
dbCommand.Parameters.Add(dbParam_company_Type)
Dim dbParam_first_Name As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_first_Name.ParameterName = "@First_Name"
dbParam_first_Name.Value = first_Name
dbParam_first_Name.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_first_Name)
Dim dbParam_last_Name As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_last_Name.ParameterName = "@Last_Name"
dbParam_last_Name.Value = last_Name
dbParam_last_Name.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_last_Name)
Dim dbParam_address1 As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_address1.ParameterName = "@Address1"
dbParam_address1.Value = address1
dbParam_address1.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_address1)
Dim dbParam_address2 As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_address2.ParameterName = "@Address2"
dbParam_address2.Value = address2
dbParam_address2.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_address2)
Dim dbParam_city As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_city.ParameterName = "@City"
dbParam_city.Value = city
dbParam_city.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_city)
Dim dbParam_state As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_state.ParameterName = "@State"
dbParam_state.Value = state
dbParam_state.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_state)
Dim dbParam_zip As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_zip.ParameterName = "@Zip"
dbParam_zip.Value = zip
dbParam_zip.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_zip)
Dim dbParam_country As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_country.ParameterName = "@Country"
dbParam_country.Value = country
dbParam_country.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_country)
Dim dbParam_day_Phone As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_day_Phone.ParameterName = "@Day_Phone"
dbParam_day_Phone.Value = day_Phone
dbParam_day_Phone.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_day_Phone)
Dim dbParam_night_Phone As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_night_Phone.ParameterName = "@Night_Phone"
dbParam_night_Phone.Value = night_Phone
dbParam_night_Phone.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_night_Phone)
Dim dbParam_fax As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_fax.ParameterName = "@Fax"
dbParam_fax.Value = fax
dbParam_fax.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_fax)
Dim dbParam_email As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_email.ParameterName = "@Email"
dbParam_email.Value = email
dbParam_email.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_email)
Dim dbParam_web_Site As System.Data.IDataParameter = New System.Data.SqlClient.SqlParameter
dbParam_web_Site.ParameterName = "@Web_Site"
dbParam_web_Site.Value = web_Site
dbParam_web_Site.DbType = System.Data.DbType.StringFixedLength
dbCommand.Parameters.Add(dbParam_web_Site)

Dim rowsAffected As Integer = 0
dbConnection.Open()
Try
rowsAffected = dbCommand.ExecuteNonQuery
Finally
dbConnection.Close()
End Try

Return rowsAffected
End Function


The Sub that calls the Insert function



Public Sub Add_New_User()
m_User_ID = New Guid 'm_User_ID is the private field for the public User_ID Property
myData.InsertOneUser( _
User_ID, _
User_Type, _
Status, _
UserName, _
Password, _
Secret_Question, _
Secret_Answer, _
Company, _
Company_Type, _
First_Name, _
Last_Name, _
Address1, _
Address2, _
City, _
State, _
Zip, _
Country, _
Day_Phone, _
Night_Phone, _
Fax, _
Email, _
Web_Site)

End Sub

View 2 Replies View Related

Clustered Index On GUID

Dec 5, 2005

I have a 3rd party app which creates tables for developers. It uses a guid as the unique key which is indexed. However none of these indexes are clustered. I have hear both good and bad about clustering on a GUID. i can't change this design other than to make these indexes clustered. Any opinions?

View 2 Replies View Related

Inserting GUID Data

Jun 7, 2002

Hi everybody
I have a table named GrpMembership which has columns ParticipantId and InterestGroupId that have datatypes uniqueidentifier.When I try to run the following insert stmt:
insert into grpmembership
(guparticipantid,guInterestGroupId,bIsAdmin,dtCrea ted)
values
({EE0BC83E-01DD-4B0D-BFAA-34B508C28CF3}
{D149BD88-55B6-4EB9-AA81-1E1B5141EFA6},
0,6/7/2002)

it gives error:

[Microsoft][ODBC SQL Server Driver]Syntax error or access violation

Please Help

Regards
Jignesh

View 1 Replies View Related

GUID&#39;s Req&#39;d For Transactional Replication??

Aug 22, 2002

Does SQL Server 2000 (Enterprise Edition), mandate the creation of a GUID on each table used in transactional replication?

I was told that in addition to defining a Primary Key, I "MUST" also define a GUID on each table. As I recall - this is not true. Can someone who's setup Transactional Replication please field this question?

thx -
~BT

View 1 Replies View Related

GUID And Curly Braces

Jun 19, 2001

If I return a GUID as an output parameter in an ASP page, it has curly braces around it. When I query the table in QA, there are no braces around it. Why is that.

View 1 Replies View Related

How To Generate Guid In Sql Server

Jun 11, 2008

Dear Expert,
Iam new to sql server2000

I have table Table1 in that table I want to generate unique guid in one column.I want the code for that one kindly help me.

View 2 Replies View Related







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