Forum Replies Created

Viewing 15 posts - 18,751 through 18,765 (of 18,923 total)

  • RE: DateDIff ???

    Here's an example from my Punch table

    SELECT FkEmploye, DateDebut, DATEDIFF(hh, DateDebut,

    ...

  • RE: Help - New to T-SQL

    All my method does is generate new random numbers everytime the query is run. But if you run this query as a subquery then it is run 1 time...

  • RE: Self Join (how to retrieve multiple records)

    Wouldn't this be simpler (assuming each combinaison is unique)?

    Select UserID from MyTable where RoleID in (1, 2, 3) Group by UserID having count(*) = 3

  • RE: record lenght

    Just a variation on mkeast's answer (so you get all tables) :

    SELECT O.Name, Sum(C.length) as MaxDataBytes

    FROM dbo.sysobjects O JOIN dbo.syscolumns C ON O.id = C.id

    where O.XType = 'U' and...

  • RE: record lenght

    I don't have a script that does that. But one thing you could do if this is a one time shot is to script out the table in QA....

  • RE: Help - New to T-SQL

    Here's an idea...

    CREATE TABLE [Numbers] (

    [PkNumber] [int] IDENTITY (1, 1) NOT NULL ,

    CONSTRAINT [Pk_Number] PRIMARY KEY CLUSTERED

    (

    [PkNumber]

    ) ON [PRIMARY]

    ) ON [PRIMARY]

    GO

    Declare @i as int

    set @i = 0

    while @i < 8000...

  • RE: Question of the Day for 14 Dec 2004

    David, this is extactly why I am wondering about the strings. I have a search sp that can be ordered by pretty much any field and always asc or...

  • RE: Question of the Day for 14 Dec 2004

    Nice shortcut. Is there a similar trick to sort dates and strings dynamically?

  • RE: SQL to rename a field where it is duplicated

    Then you can tweek the first query I posted, it should give you what you need.

  • RE: SQL to rename a field where it is duplicated

    That's not possible. A column name must be unique to a table.

    The code I gave you scans ALL the columns from all the tables for duplicate field name (excluding...

  • RE: SQL to rename a field where it is duplicated

    Hmm. Why exactly do you need to do this?? I'm currently rebuilding an application and every single little structure modification takes hours/weeks to implement. Something like this that...

  • RE: Need help with ADO Connection

    Holds true for all objects Frank... But even more for RecordSets.

  • RE: SELECT AND UPDATE

    Happy to help.

  • RE: SELECT AND UPDATE

    I think that would solve the problem (just make sure that the derived table dtOrderedSales has the order by you need and you should be fine) :

    SELECT identity (int,...

  • RE: Convert positive to negative and vice versa

    Actually if you only want ONLY positive values you'd be better off doing something like this :

    Select ABS(MyCol) from dbo.MyTable

Viewing 15 posts - 18,751 through 18,765 (of 18,923 total)