Forum Replies Created

Viewing 15 posts - 376 through 390 (of 607 total)

  • RE: ShrinkFile on Varbinary column

    GilaMonster (6/12/2013)


    Sean Pearce (6/12/2013)


    I prefer Paul Randal's method:

    1. Create new filegroup.

    2. Create new file on new filegroup. Set this to your required size.

    3. Rebuild all indexes with the new filegroup...

  • RE: Querying two time columns for sum of datediff

    You are welcome.

    You can also use ISNULL instead of creating a new condition.

    DECLARE @T TABLE

    (StartDate DATETIME,

    EndDate DATETIME,

    Comments VARCHAR(255));

    INSERT INTO @T VALUES ('2013-01-01 01:00', '2013-01-01 04:00', 'Not needed');

    INSERT INTO @T VALUES...

  • RE: Can we call stored Procedure inside a function

    $w@t (6/12/2013)


    can anyone explain me what is happening here?????

    OPENROWSET (Transact-SQL)

    Includes all connection information that is required to access remote data from an OLE DB data source. This method is an...

  • RE: ShrinkFile on Varbinary column

    GilaMonster (6/12/2013)


    SQL Show (6/12/2013)


    Gail,

    Will You advice any workaround to reclaim space?

    Patience. 🙂

    Why are you shrinking anyway? Has the database been permanently reduced in size? Will the space you're trying to...

  • RE: Querying two time columns for sum of datediff

    DECLARE @T TABLE

    (StartDate DATETIME,

    EndDate DATETIME,

    Comments VARCHAR(255));

    INSERT INTO @T VALUES ('2013-01-01 08:00', '2013-01-01 16:00', 'Overlapping Both Ends');

    INSERT INTO @T VALUES ('2013-01-01 08:00', '2013-01-01 12:00', 'Overlapping Front');

    INSERT INTO @T VALUES ('2013-01-01 13:00',...

  • RE: Execution plan shennanigans......

    mrbonk (6/11/2013)


    Is that enough info?

    No. We need the actual execution plans and DDL for your tables and indexes.

  • RE: SQL agent configured to call a SP

    wolfkillj (6/10/2013)


    I would consider adding a line of code that writes those values to a log table so I could view their values later.

    SELECT

    recipients,

    copy_recipients,

    blind_copy_recipients,

    send_request_date,

    sent_date,

    sent_status

    FROM

    msdb..sysmail_allitems

  • RE: High Memory utilization

    DBA_007 (6/10/2013)


    since sqlserver is the only one running in the machine why do we need to set Max memory setting

    as it can allocate memory dynamically when ever required

    since sqlserver is...

  • RE: The size of a table. (space_used against calculated space).

    ben.brugman (6/10/2013)


    If everything seems to be going well, you have obviously overlooked something.

    For me it's not obvious what I am overlooking, hence the question.

    Don't mistake the cheeky signature line as...

  • RE: How to get results from an SP into a table.

    ben.brugman (6/10/2013)


    The output from a stored procedure is often a resultset which is or is similar to a table.

    Output from a stored procedure MIGHT be a resultset. What do you...

  • RE: 0xc0202009 Primary Key Error

    Insert your data into a staging table then check for duplicates there:

    SELECT KeyColumn

    FROM StagingTable

    GROUP BY KeyColumn

    HAVING COUNT(*) > 1;

  • RE: Division problem in SQL

    Dird (6/7/2013)


    To fix this you need to declare a decimal type (if in a procedure) or convert to float or decimal:

    select 1/cast(2 as float);

    select convert(decimal(8,2), (1))/5;

    A simple decimal point will...

  • RE: Hi guys this urgent reg int to varchar conversion

    This behavior is due to data type precedence.

    The following query might help you understand better:

    -- This fails

    SELECT 1

    UNION

    SELECT 'One'

    -- This works

    SELECT '1'

    UNION

    SELECT 'One'

  • RE: Execution plan shennanigans......

    One thing that stands out is the number of Key Lookups in each plan. Viewing the actual plans would be useful though.

  • RE: NOLOCK is giving different result sets.Why?

    sachin6139 (6/4/2013)


    I have 2 select statements. One with NOLOCK hint and other without NOLOCK hint. I am getting different result sets. Rows are same but there order is different....

Viewing 15 posts - 376 through 390 (of 607 total)