Forum Replies Created

Viewing 15 posts - 14,971 through 14,985 (of 15,381 total)

  • RE: Stored Procedure in dynamic SQL

    Can you just delete the existing data and then insert from the other table?

  • RE: Scalar function using data from table

    Not exactly what you mean. What are you trying to do?

  • RE: stored procedure help in dynamic SQL

    Please don't cross post as this just clutters things up and makes it harder for others to find the resolution.

    The original thread is here

  • RE: Stored Procedure in dynamic SQL

    Welcome to sql server central.

    Keep in mind that we can't see your screen from here. 😉

    Are you trying to replace this data? Are you trying to append data? If we...

  • RE: how grab text before a "-" character in a join

    Jeff Moden (3/2/2011)


    drew.allen (3/2/2011)


    Another option is to use the LIKE operator. I don't know which will perform better.

    SELECT *

    FROM TableA

    INNER JOIN TableB

    ON TableA.ID LIKE Cast(TableB.ID as varchar(11)) + '%'

    This...

  • RE: how grab text before a "-" character in a join

    That is what i showed you. 😀

    Try this to see if it makes it more clear.

    select *

    from table A

    join table b on a.ID = SUBSTRING(b.IDFieldWithExtra, 0, charindex('-', b.IDFieldWithExtra, 0))

  • RE: how grab text before a "-" character in a join

    Yeap.

    declare @OddBallKey varchar(10) = '1234-01'

    select SUBSTRING(@OddBallKey, 0, charindex('-', @OddBallKey, 0))

  • RE: Epoch to readable format

    something like this should get you pretty close.

    select DATEADD(ss, 211114134, '1970/01/01'), DATEADD(hh, datediff(hh, GETUTCDATE(), GETDATE()), DATEADD(ss, 211114134, '1970/01/01'))

    Lowell - you had the calculation backwards. You would want -5 for EST....

  • RE: Hide Rows and columns

    varunkum (3/1/2011)


    Q1. I have a row with all zero's and another row with all nulls(empty). How do i hide them both ?

    Q2. I have a column with all...

  • RE: Test

    Infotech Canada (3/1/2011)


    i am very sorry, i just couldn't find a forum for test posts.

    reported as spam too....

  • RE: Epoch to readable format

    I think you are looking for something like?? If I understood your question correctly.

    select DATEADD(ss, yourEpochDateIntegerHere, '1970/01/01') from YourTableWithEpochInteger

  • RE: Get Top and bottom record

    bobbalsman (2/28/2011)


    Actually, if you use a UNION only one ORDER BY clause is allowed & it's scope is the entire UNION'd query.

    -Bob

    :blush: It is Monday....you are correct.

    something like this should...

  • RE: 80004005 error after connection is valid

    Short of a connection string or permissions i don't know what else would cause this. Did you say you were able to reproduce the error while profiler was running? What...

  • RE: Get Top and bottom record

    bobbalsman (2/28/2011)


    Try this:

    USE <databasename>

    GO

    SELECT * into #maxRemind

    FROM

    (

    SELECT TOP 1 CompanyName, ReminderNo

    FROM <tablename>

    ORDER BY ReminderNo DESC

    ) AS TopRemind

    GO

    SELECT * into #minRemind

    FROM

    (

    SELECT TOP 1 CompanyName, ReminderNo

    FROM <tablename>

    ORDER BY ReminderNo ASC

    ) AS BotRemind

    GO

    SELECT...

  • RE: 80004005 error after connection is valid

    I am about 99.9999% certain that the user is not able to insert to the calls table. Is there a trigger on this table that is maybe doing another insert...

Viewing 15 posts - 14,971 through 14,985 (of 15,381 total)