Forum Replies Created

Viewing 15 posts - 1,381 through 1,395 (of 2,007 total)

  • RE: select update

    Simon Parry (11/9/2011)


    thanks, but that just returns 0 as the result

    any more ideas

    thanks

    simon

    It returns 0 because "dur" is an integer. So as I said, you'll need to CONVERT it.

    e.g.

    UPDATE my_table

    SET...

  • RE: select update

    Simon Parry (11/9/2011)


    Hi

    i am having problems with a query i have

    i am trying to do a select update

    i want to have something like

    update my_table

    set dur = (SELECT

    @rec_count = (select ...

  • RE: create delimited list from table column

    First, thanks for the sample data! It makes things much easier 🙂

    Let's just tidy it up a little bit: -

    IF object_id('tempdb..#testEnvironment') IS NOT NULL

    BEGIN

    DROP TABLE #testEnvironment

    END

    SELECT IDENTITY(INT,1,1) AS ID,

    stock,...

  • RE: how to specify an exact amount of rows to display in a table?

    anthony 80098 (11/9/2011)


    Hi Jeff, even in the instance where there are only 2 rows, i still need to display 15 rows.

    We got that you want to display 15 rows. What...

  • RE: Max() conundrum

    JimS-Indy (11/9/2011)


    I have a table (ID identity,ProjectID foreign key,MICAPID foreign key,ODD datetime...) called tblxrefProjectMICAP. ProjectID+MICAPID is a unique key. A project may have multiple MICAPs, and a MICAP may have...

  • RE: How to retrieve tables , sp's, views , functions related to a particular field?????

    Hakuna Matata (11/9/2011)


    Hi,

    I need to retrieve all the tables, stored procedure's, views, functions etc which are related to a particular field in a database.

    For example if the field...

  • RE: Convert and call Function to Insert Statement

    Hello and welcome to SSC!

    It seems that your DDL script has become detached from your post, or perhaps you were unaware of the benefits of providing one.

    When you have time,...

  • RE: Group by 60 minutes but on the 1/2 hour, not hour

    JayK (11/9/2011)


    Hi,

    I have a query which sums the total number of commercial seconds aired in a clock hour

    SELECT SUM(BookedLength) As TotalPerHour

    FROM ComercialsBreaks

    GROUP BY ClockHour

    So a result might be 700 seconds...

  • RE: RBAR

    goofbauer (11/8/2011)


    I have a new favorite method, courtesy of Mike Powell at

    http://stackoverflow.com/questions/58429/sql-set-based-range

    No dependencies, backward compatible w/ 2005.

    DECLARE @MyDates TABLE(d DATETIME NOT NULL);

    WITH CTE AS (

    SELECT1 AS n

    UNION ALL

    SELECTn + 1...

  • RE: Help searching a string within a set number of words apart

    The complication is in allowing more than 2 words.

    The following checks for 2 words that are 5 or less words apart.

    using System;

    using Microsoft.SqlServer.Server;

    using System.Data.SqlTypes;

    using System.Text.RegularExpressions;

    namespace searchFeatures

    {

    public...

  • RE: UK Postcode Sector

    Damion (11/8/2011)


    Hello,

    I am trying to retrieve the first part and the first letter on the second part of a UK postcode, i.e. if a postcode is AB12 3CB, I would...

  • RE: How to backup a table with data?

    Interesting.

    I don't have time to develop a fully working script, but this will generate SELECT statements of the data from your table.

    Note, it's reliant on the size of VARCHAR(MAX), so...

  • RE: RBAR

    Assuming you're using SQL Server 2008 (due to the forum you posted in), you could do this: -

    DECLARE @MyDates TABLE (d DATETIME NOT NULL)

    INSERT INTO @MyDates (d)

    SELECT DATEADD(day, N, getdate())

    FROM...

  • RE: How to modify code to display '21:30:00 PM' as '09:30:00 PM'?

    adonetok (11/7/2011)


    The code below will display as '21:30:00 PM'

    How to modify code to display as '09:30:00 PM'?

    declare @date datetime

    set @date = '2011-11-08 21:30:00.000'

    select CONVERT(VARCHAR, @date, 108) + ' '...

  • RE: Format date time

    adonetok (11/7/2011)


    I need pass exact string format from getdate() to third party application in which I can not do anything.

    The third party applicaton only take format like below(including space):

    '11/07/2011 09:30:00...

Viewing 15 posts - 1,381 through 1,395 (of 2,007 total)