Forum Replies Created

Viewing 15 posts - 58,576 through 58,590 (of 59,048 total)

  • RE: Using FROM @variable in SELECT statement...

    Get the list of database names from Master.dbo.SysDataBases... build your own loop or (yeeach!) cursor to step the the DB names or ID's as the outer nest for sp_MSForEachTable.

  • RE: incrementing alpha string using SQL

    Brilliant use of recursion guys!  Absolutely awesome.

  • RE: Newbie

    Take a look at the SQL portion of w3schools.com.  It won't teach you all of the nuances of MS-SQL Server but it will give you a nice comfortable start on...

  • RE: Using FROM @variable in SELECT statement...

    The original requester pointed out the he wanted to do it without a cursor.  As David pointed out, the underlying code for sp_MSForEachTable and other similar routines are riddled with...

  • RE: Eliminate My cursor, Please.

    The "INTO" clause of SELECT/INTO creates the temp table on the fly. 

    You are correct about COALESCE... It does the work... you could replace it with ISNULL and the effect...

  • RE: database column value check

    As Kenneth suggested, ISNUMERIC may not cut it.  It allows for seemingly non-numeric characters such as "d", "e", and "." so that it will support scientific and exponential notation.  Continuing Sushila's...

  • RE: How do I create a custom identity?

    Roger that... I'll put mine in a UDF   Thanks for the tip on the deterministic thing.

  • RE: A join query

    ________________________________________________________________________________________________________________________

    Does NOT require TimeIn/TimeOut be on same day... only requires that for every TimeIn, there is a TimeOut and that there are no "straggler" TimeOut's from the previous...

  • RE: Eliminate My cursor, Please.

    --===== Create a function to concatenate orders by customer

     CREATE FUNCTION dbo.ConcatOrderNum (@pCustomerID AS INT)

    RETURNS VARCHAR(8000)

    AS

    BEGIN

            DECLARE @oResult VARCHAR(8000)

             SELECT @oResult= COALESCE(@oResult+',','')+OrderNumber

               FROM Customer_Orders WITH (NOLOCK)

              WHERE CustomerID...

  • RE: How do I create a custom identity?

    Serqiy,

    This too, is deterministic and a bit easier on the eyes...

    RIGHT('000'+CAST(XID%1000 AS VARCHAR),3)

  • RE: How do I create a custom identity?

    Just curious, Serqiy... why do you prefer the following...

    +convert(char(3), replicate('0', 3-len(convert(varchar(3), XID%1000))) + convert(varchar(3), XID%1000)), --The 3 digit numeric part

    ... over ...

     +REPLACE(STR(XID%1000,3),' ','0'), --The 3 digit numeric part

  • RE: How do I create a custom identity?

    >the only reason I mentioned 'INSTEAD OF' trigger ...

    Got it... thanks for the idea, David.

  • RE: Syntax in statement please Help !

    Cool... thanks for posting back to save us time.

  • RE: TOP n PERCENT usage in Views

    I absolutely agree... especially when they nest such views...

  • RE: How do I create a custom identity?

    Thanks for the kudo, David.  It's a real pleasure to hear coming from you.

    Lowell's idea is a good one... You very well could use the calculation as a computed column.......

Viewing 15 posts - 58,576 through 58,590 (of 59,048 total)