Forum Replies Created

Viewing 15 posts - 16 through 30 (of 78 total)

  • RE: simple trigger

    so your saying from my example:

    for every new customer_id in a table, and i need to increment the sequence number by 1,

    So if I have 33 as a sequence...

  • RE: convert vb script to sql

    how can i run the script as a sql job against a database and table?

    Function GetPrefixForCustomer(CurrentValue)

    Option Explicit

    Dim sRet

    Dim iRemainder

    Dim iQuotient

    Dim intArray()

    sRet = ""

    iRemainder = 0

    iQuotient = 0

    If CurrentValue > 0...

  • RE: I need to duplicate the rows in same table , simply changing one field value

    when i try and run it with only

    where B.col2 = '5'

    the error is : Violation of PRIMARY KEY constraint

    its prob looking at the column its already inserted with the...

  • RE: cannot insert duplicate primary keys

    got it thanks

  • RE: cannot insert duplicate primary keys

    got it thanks

  • RE: cannot insert duplicate primary keys

    when you run an insert statement, it can be ran only once then you get an error?

  • RE: cannot insert duplicate primary keys

    when i check the current table col1 and col2 are the same? col1 and col2 are both primary keys, so how is this possible and how can i insert into...

  • RE: select sql query

    its just a general question? Can you have multiple inserts?

  • RE: select sql query

    can i have multiple insert statements ?

    example

    col1 = name

    col1 =name_value

    so my column should read as:

    name

    name_value

    how would i write select and insert statement for this?

  • RE: select sql query

    yes but what if i have 6 columns i need to insert into , how would i write this?

    insert into col1,col2,col3,col4,col5,col6

    col3 has 2 values = 'PRF_CAN_ORDER_LEVEL' , 'PRF_CAN_OVERRIDE' that need...

  • RE: cursor function

    this query gives me the output im looking for

    select CustomerID + '-' + AddTypeID from dbo.CustomerAddresses

    48313-1

    48313-4

    48315-1

    48315-4

    i have a question, i have a view, the column CustomerID (from table) = Account_number...

  • RE: cursor function

    i am missing the view

  • RE: cursor function

    CREATE TABLE [dbo].[CustomerAddresses](

    [CustomerID] [dbo].[C_ID] (nvarchar(30))NOT NULL,

    [AddressTypeID] [dbo].[C_ID] (nvarchar(30))NOT NULL,

    [CustomerAddressID] [dbo].[C_ID] (nvarchar(30))NOT NULL

    insert into dbo.CustomerAddresses

    (CustomerID, AddressTypeID, CustomerAddressID)

    values('48313', '1', '48313-1')

    ('48313', '4', '48313-4')

    ...

  • RE: duplicate key error

    got it thanks

  • RE: create a stored procedure with insert and update using a cursor

    Does this help any:

    COLUMN NAMES

    CustomerID

    ParentCustomerID

    ParentContactID

    Name

    ShortName

    ReferenceNo

    Logo

    CustomerTypeID

    Templates

    CorpURL

    CorpEmail

    SupportEmail

    SalesEmail

    OtherEmail

    DefaultContactID

    Markup

    DefaultCurrencyID

    PriceListID

    FreightID

    PaymentTypeID

    PaymentTermID

    PaymentTermNotes

    ShippingPolicyID

    CarrierID

    ShippingMethodID

    EffectiveDate

    ExpiryDate

    DefaultTaxRate

    DefaultQuoteDiscount

    DiscountComments

    Notes

    Deleted

    Status

    StatusComments

    StatusChangeDate

    StatusChangeUser

    CreateDate

    CreateUser

    MaintenanceDate

    MaintenanceUser

    LockUser

    LockSessionID

    LockDate

    PriceList_MaintenanceDate

    SyncStatus

    SyncDate

    SyncUser

    DiscountMode

    UpchargeMode

    CreateCustomerID

    CreateContactID

    MaintenanceCustomerID

    MaintenanceContactID

    InUse

    CustomerSalesModel

    CustomerPrefix

    State

    DefaultCustomerAddressID

    DefaultCustomerID

    datatypes, character length

    nvarchar30

    nvarchar30

    nvarchar30

    nvarchar50

    nvarchar20

    nvarchar50

    nvarchar200

    nvarchar30

    nvarchar250

    nvarchar250

    nvarchar50

    nvarchar50

    nvarchar50

    nvarchar50

    nvarchar30

    decimalNULL

    nvarchar30

    nvarchar30

    nvarchar30

    nvarchar30

    nvarchar30

    nvarchar500

    nvarchar30

    nvarchar30

    nvarchar30

    datetimeNULL

    datetimeNULL

    decimalNULL

    decimalNULL

    nvarchar500

    ntext1073741823

    intNULL

    intNULL

    nvarchar500

    datetimeNULL

    nvarchar50

    datetimeNULL

    nvarchar50

    datetimeNULL

    nvarchar50

    nvarchar50

    nvarchar36

    datetimeNULL

    datetimeNULL

    intNULL

    datetimeNULL

    nvarchar50

    intNULL

    intNULL

    nvarchar30

    nvarchar30

    nvarchar30

    nvarchar30

    intNULL

    intNULL

    nvarchar20

    intNULL

    nvarchar30

    nvarchar30

Viewing 15 posts - 16 through 30 (of 78 total)