Forum Replies Created

Viewing 15 posts - 496 through 510 (of 529 total)

  • RE: Group By function for a string column

    I don't think this is possible either.

    The only solution I can see is using a cursor to loop through all the possible groups. You can use the syntax from 'Tame...

  • RE: Col001 + Col002

    Depends on what the types of columns are.

    One solution is setting a database wide parameter :

    sp_dboption 'database', 'concat null yields null', 'FALSE'

    Or you can use the ISNULL function as in

    col001...

  • RE: SP Group Number

    You can use the following statement.

    select max(number) from sysobjects o, syscomments c where o.name = 'mySP' and o.id = c.id

  • RE: Help with Range

    If the fields are not strings

    SELECT cost FROM table

    WHERE low < 10.00 and high > 10.00

    Are the fields strings?

    Then it might be necessary to cast to floats.

    SELECT cost FROM table

    WHERE...

  • RE: Sort of Unique

    Never thought of solving this problem using only a single table.

    Typically, I opt for adding a 'history' table in which the non-active records get archived. But this becomes a hassle...

  • RE: help on multiple pivot

    Can you post the table definitions?

  • RE: columns to rows

    You could use :

    select v.vehicle_id, u.property, u.value

    from vehicles v,

    (select vehicle_id, 'chain', chain from vehicles

    UNION

    select vehicle_id, 'spacing', spacing from vehicles

    UNION

    select vehicle_id, 'teeth', teeth from vehicles

    ) u

    where v.vehicle_id = u.vehicle_id

  • RE: grouping stored procedures

    Same here.

    We try to add a prefix to 'all' the objects in our database, to indicate the owner-module of the object.

  • RE: Converting numeric data value to string

    Check the articles 'Tame Those Strings'.

    One article (part 4) is about numeric conversions, and should get you pointed in the right direction :

    http://qa.sqlservercentral.com/columnists/sjones/20010422115809_1.asp

  • RE: SQL Triggers

    Try this :

    CREATE TRIGGER ClientUpdatesTrigger ON Table1

    FOR UPDATE

    AS

    DECLARE @MyID nvarchar(50)

    if exists(select id from inserted where status = 'Taken')

    insert into testtrig2 (id)

    ...

  • RE: PageAudit is incorrect

    How did you detach the file? (Same server, other server, what version of SQL Server, ...)

    Do you have any reason to be suspicious about file corruption? (E.g. disk crash)?

  • RE: FAQ

    Good point. The same questions do return on a regular basis.

    A FAQ might be a good thing for certain questions. But, imho, that won't solve the *real* problem.

    People should search...

  • RE: Recursive trigger

    I can see no reason why the trigger is fired again. Some tests here revealed no problem...

    Can you post your trigger's code

  • RE: CASE statement and NULL values

    You can also just use the IsNull function as in :

    SELECT IsNull(F1,F2) F11, IsNull(F2,F1) F22

    FROM #Test1

  • RE: Performance of a cursor

    If possible at all, you should try to avoid the cursor loop. This is probably a greater cost than executing the query itself. You can test this, just by timing...

Viewing 15 posts - 496 through 510 (of 529 total)