Comma Separated Values in SQL Server 2000

  • hello everyone, i m using sqlserver 2000. i have a table name "Buyers" with the following fields

    BuyerID

    ContactName

    Phone

    Email

    PinCode

    IsCLIEnabled

    Clis

    i want to make a Stored Procedure in which i want to check the following condition:

    "" -- check if CLI is enabled, if yes, check if @cli is in the list""

    @Cli is the parameter which i gave at run time i mean when i execute the SP,

    my teacher says that use the string function to take Comma separated values and do this

    i m still confusing how i check this ke user jo CLI enter karey woh Clis list main hai yah nahi

    i m using this function but not sure this is right or not?

    declare @Clis varchar(1000)

    ""select @IsCliEnabled = IsCLIEnabled, @Clis = coalesce(@Clis++',','')+CLIs """

    plz help me

    i m in very trouble

    plz its very very very urgent

    plz help me

  • I don't even understand what you write.

    "i m still confusing how i check this ke user jo CLI enter karey woh Clis list main hai yah nahi"

    check if CLI is enabled, if yes, check if @cli is in the list -

    First you have a field named IsCLIEnabled, check what kind of data type of this field, if it is a BIT field then 0 means disabled, 1 means enabled.

    @cli is supplied by your procedure, and you said check if @cli in the list. What is that meant?  What list?  Do you mean checking @cli = each field in the table?

     

  • hey Loner u didn't get my point

    IsCLIEnabled is a bit field which returns 0/1 if 1 then i check user ne jo CLI de hai woh CLIs list main hai yah nahi ab list kahan se aye gey mujhe ik function lagana hai jis se table main stored CLI's Comma separated form main ik varaibale main store ho jaye gey then user jo cli enter karey ga mujhe check kerna hai jo list hai mere pass us main user ki de hoe CLI hai yah nahi.

     

    i hope u get my point now , now for getting values of cli in CSv i used :

    declare @Clis varchar(1000)

    ""select @IsCliEnabled = IsCLIEnabled, @Clis = coalesce(@Clis++',','')+CLIs """

    this line , or is stmt se values a jatey hain CSV ki form main but ab mujhe check kerna nahi a raha hai if u have any other idea then plz let me know how i load clis in CSv form n stored in variable then check with users CLis' value

     

    reply me asap

    its really very urgent

  • Sorry, I still did not know what you want to do?

    "IsCLIEnabled is a bit field which returns 0/1 if 1 then i check user ne jo CLI de hai woh CLIs list main hai yah nahi ab list kahan se aye gey mujhe ik function lagana hai jis se table main stored CLI's Comma separated form main ik varaibale main store ho jaye gey then user jo cli enter karey ga mujhe check kerna hai jo list hai mere pass us main user ki de hoe CLI hai yah nahi. "

    "this line , or is stmt se values a jatey hain CSV ki form main but ab mujhe check kerna nahi a raha hai if u have any other idea then plz let me know how i load clis in CSv form n stored in variable then check with users CLis' value"

    Is this some kind of code or language ? Sorry I don't understand what you are talking about and I hope someone else can help you. Good luck.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply