Forum Replies Created

Viewing 15 posts - 286 through 300 (of 375 total)

  • RE: Help needed on concatination of data into variable problem

    The

    SELECT @variable = @variable + myfield

    FROM mytable

    portion is this undocumented feature Sergiy wrote about.

    It allows you to concatenate all myfield values selected by a query into a variable in a...

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

  • RE: Help needed on concatination of data into variable problem

    I think the problem comes from the 'golden plate'

    SELECT @Message = ISNULL(@Message + ',', '') + Z.REP+':'+ Z.INFO

    FROM (

    SELECT LEFT(SLPRSNID,2) AS REP,INFO

    FROM @Stage

    WHERE SLPRSNID...

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

  • RE: Help needed on concatination of data into variable problem

    Actually I was referring to you first post while you were adding that little bonus of the concatenation when you do a select into a variable.

     

     

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

  • RE: Help needed on concatination of data into variable problem

    Sergiy,

    do you always hand out everything on a golden plate?

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

  • RE: Help needed on concatination of data into variable problem

    I don't know if I understand the problem correctly but if you question why your @message is NULL at the end of the loop then the answer is because it is...

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

  • RE: Can anyone think of a good reason for NOT having a PK?

    Well. In a case when you have limited amount of data that fits into single page creating an index will decremet the performace because you will ask the server to...

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

  • RE: Find File Name of Database

    I think you could access the sysfiles directly if what you mean by accessing is reading their content. Actually I would advice anyone to learn about them and use them as...

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

  • RE: Drop column when referenced?

    You should be able to do it using something like this

    ALTER TABLE yourtable DROP CONSTRAINT yourconstraint, COLUMN yourcolumn

    you can also list any indexes you have this column tided up to.

    If you want...

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

  • RE: IDENTITY_INSERT and SELECT *

    I don't know if it was apparent from the previous posts but you should be fine if you change this

    SELECT @sql = 'SET IDENTITY_INSERT ' + @tablename + '...

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

  • RE: insert multiple rows into 1

    I don't know if I understand you correctly but I think you could get the records combined by using something like this

    INSERT INTO realtable

    (

    ...your fields....

    )

    SELECT

    item,

    branch,

    month,

    source

    SUM(inv_value),

    SUM(cme_value) 

    FROM mc_staging

    WHERE ...your condition...

    GROUP...

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

  • RE: Calendar and Business Date Functions/Calculations

    Depending on your particular case you could do the following:

    Create a table that will hold all the holidays

    CREATE TABLE Holidays (holiday SMALLDATETIME)

    Populate this table with all holidays that do not...

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

  • RE: Calendar and Business Date Functions/Calculations

    Jeff,

    I came up with somewhat similar code but I didn't have the + 1 in the first line. Otherwise there is 1 business day between today and today and I...

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

  • RE: Update Table Failure when more Data Items entered

    I am glad I could help a bit. Views can be very sensitive and tricky. Sometimes they don't aways work as you would expect them to, especially when you start joining them.

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

  • RE: Calendar and Business Date Functions/Calculations

    Do you need to deal with holidays as well or do you want to exclude Saturdays and Sundys only?

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

  • RE: Is it possible to do.....Query help

    I don't know if this is a viable solution but one of the things you could do is to create a table with something like this

    CREATE TABLE itemmultiplier (...

    ---------------------------------------------
    [font="Verdana"]Nothing is impossible.
    It is just a matter of time and money.[/font]

Viewing 15 posts - 286 through 300 (of 375 total)