Forum Replies Created

Viewing 15 posts - 256 through 270 (of 608 total)

  • RE: Data Engine tuning Advisor

    Sounds like a windows issue. Have you or can you try from another machine?

  • RE: Brain Fried on a JOIN Question

    You will not get the results you want if the values are NULL.

    When I compare tables I use a CHECKSUM.

    SELECT

    *

    FROM

    (SELECT

    [compareHR].[dbo].[TableOLD].[Pos_no],

    CHECKSUM(*) AS XSum

    FROM

    [compareHR].[dbo].[TableOLD]) AS Old

    FULL JOIN

    (SELECT

    [compareHR].[dbo].[TableNEW].[Pos_no],

    CHECKSUM(*) AS XSum

    FROM

    [compareHR].[dbo].[TableNEW]) AS New

    WHERE

    Old.Pos_no IS...

  • RE: Is there a short cut (Like 'SELECT *') for selecting all but a few fields in a table??

    You could create a view that only has the columns you are interested in.

  • RE: exception handling: how would you do it?

    AndrewSQLDBA (10/3/2013)


    Sorry, but I do not see any example using Dynamic SQL. I see the examples using straight Transact SQL.

    I NEVER, EVER use Dynamic SQL. No matter what.

    Andrew SQLDBA

    Dynamic SQL...

  • RE: Update Columns dependency over other column on same table

    Dwain, that constraint won't allow you to disable editing.

    UPDATE #usTab1

    SET Col2 = 1

    WHERE Col1 = 1;

    GO

  • RE: SQL Server version

    SELECT

    CASE SUBSTRING(CAST(SERVERPROPERTY('ProductVersion') AS VARCHAR(50)), 1, 4)

    WHEN '10.5' THEN '2008 R2'

    WHEN '11.0' THEN '2012'

    END AS 'SQL Server',

    SERVERPROPERTY('ProductLevel') AS 'Level',

    SERVERPROPERTY('Edition') AS 'Edition',

    SERVERPROPERTY('ProductVersion') AS 'Version';

  • RE: Huge Increase in Logical Reads for 17 Hour Period

    Can we see the actual execution plan?

  • RE: Data Engine tuning Advisor

    Which operating system are you running?

  • RE: DATEDIFF in hours and minits In Decimal Format

    CREATE TABLE JobTran

    (JobNbr VARCHAR(10),

    ClockIn DATETIME NOT NULL,

    ClockOut DATETIME NULL);

    INSERT INTO JobTran (JobNbr, ClockIn, ClockOut)

    VALUES('Job1', '2013-10-03 06:17:34.387', NULL),

    ('Job1', '2013-10-03 05:17:34.387', '2013-10-03 08:10:34.387'),

    ('Job2', '2013-10-03 09:17:34.387', '2013-10-03 10:05:34.387'),

    ('Job2', '2013-10-03 09:17:34.387', NULL);

    DECLARE @getdate-2 DATETIME...

  • RE: exception handling: how would you do it?

    create table A (col_1 varchar(1), col_2 int);

    insert into A values('a',100);

    create table B (col_1 varchar(1), col_2 int);

    insert into B values('b',200);

    create table C (col_1 varchar(1), col_2 int);

    insert into C values('c',300);

    -- Use a...

  • RE: Trigger with RAISERROR

    The behavior is the same with a stored proc

    CREATE TABLE test (ID INT NOT NULL, Val INT);

    GO

    INSERT INTO test VALUES (1,1), (2,2), (3,3);

    GO

    CREATE PROCEDURE trg_test_upd

    AS

    UPDATE test SET val...

  • RE: Trigger with RAISERROR

    You need to use ROLLBACK inside the trigger.

    CREATE TRIGGER trg_test_upd ON test AFTER UPDATE

    AS

    RAISERROR('Error', 16, 1);

    ROLLBACK;

    GO

  • RE: Update script

    kapil_kk (9/30/2013)


    SrcName (9/30/2013)


    can you put your code in more details?

    What are these T.labeltext , T.LabelKey, T.FileID.

    error message is clear

    SELECT 'UPDATE table_1 T

    SET labeltext ='+ T.labeltext

    'WHERE LanguageID = 10

    AND...

  • RE: Using Alias in Where

    BlackIceAngel (9/27/2013)


    And no I'm not aware of the pitfalls of No Lock could you please elaborate?

    http://thesqlguy.blogspot.com/2013/02/nolock.html

  • RE: Using Alias in Where

    You could try a CTE.

    WITH CTE AS (

    SELECT TOP 5

    ID,

    MID,

    RName,

    Pic1,

    FoodType.Descr AS FoodType,

    Average_P_PP,

    lat,

    lng,

    (SELECT GEOGRAPHY::Point(Lat, Lng, 4326).STDistance(GEOGRAPHY::Point(- 1.33821478, 36.71208143, 4326))) AS Distance

    FROM

    Member

    INNER JOIN

    FoodType

    ON (Member.FoodTypeID = FoodType.FoodTypeID)

    WHERE

    Zoom > 10

    AND MAct = 'Full'

    ORDER BY...

Viewing 15 posts - 256 through 270 (of 608 total)