Forum Replies Created

Viewing 15 posts - 16 through 30 (of 86 total)

  • RE: Issue with string or binary data truncation

    mcfarlandparkway - Friday, March 3, 2017 9:41 AM

    I have a stored procedure where I am inserting data form stage table to main...

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

  • RE: ERROR_MESSAGE not iisplaying the full message

    Since you're using 2014, use THROW instead of RAISERROR:

    BEGIN TRY

    RESTORE DATABASE TestRestore

    FROM DISK = 'SomeCorrectPath'

    WITH RECOVERY,

    MOVE 'WrongDataName' TO 'D:\SQL2014\Data\TEMPCOPY.mdf',

    MOVE 'WrongLogFile' TO 'E:\SQL2014\Logs\TEMPCOPY.ldf';

    END TRY

    BEGIN CATCH

    THROW;

    END CATCH;

    The downside of this approach is...

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

  • RE: where fldValue=123 vs join to table with one row

    souLTower (1/23/2013)


    The execution plans are pretty big. I'm not sure how to post them.

    I get completely different execution plans between fldValue=123 and fldValue IN (select value from tempTable). ...

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

  • RE: where fldValue=123 vs join to table with one row

    souLTower (1/23/2013)


    I have a huge DB and a view that pulls records from multiple tables, some as big as 2M records. I have great indexes. I can query:...

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

  • RE: SELECT vs INSERT INTO

    Sean Lange (1/11/2013)


    Roland Alexander STL (1/11/2013)


    As to the destination table already existing, that shouldn't be a problem if you're selecting into a temp table. SQL Server will give it a...

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

  • RE: SELECT vs INSERT INTO

    Sean Lange (1/11/2013)


    Also select into will throw an exception if the the destination table already exists. You do not have as much control over the datatypes when using a select...

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

  • RE: SELECT vs INSERT INTO

    I believe that SELECT...INTO results in less impact on the transaction log. Also, if there are differences in collation between the db you're in and tempdb, SELECT...INTO will create a...

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

  • RE: UPDATE common table expression

    dave harris 45446 (1/9/2013)


    Hi all

    Can anyone advise please, I have a TSQL 2008r2 headache...

    I'm calculating the geo distance between a previous geo point and current geo point.

    The code below,...

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

  • RE: Error when running job, package execution failure

    hogpen (1/4/2013)


    I used:

    GRANT ALTER ON [EdwStaging].[RAW].[DimUnitOfMeasure...] TO [SSISExecuter]

    GO

    I was told by a coworker to use that because the job runs through a service account that has table specific access,...

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

  • RE: Error when running job, package execution failure

    hogpen (1/4/2013)


    Hi, so I'm very new to SQL Server but I keep running into this error when I manually run a job from SQL Server Agent.

    The error from the log...

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

  • RE: Insert Into #temp table

    twahl0630 (1/3/2013)


    Hello all

    need to find a faster way to do this select into I'm using or ststatementso filter on multiple columns

    any ideas

    select m.RecordId,m.NumberForSearch into #dump

    from table1...

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

  • RE: Count Records in Table and....

    Well, it's not printing anything because @totalrecs is NULL when you concatentate it, and NULL concatenated with anything else yields NULL. You will need to assign @totalrecs a value. Why...

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

  • RE: How to Update Columns of a Table with two instance in one update Statement.

    Nicely done, Phil, thanks!

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

  • RE: How to Update Columns of a Table with two instance in one update Statement.

    That code wasn't quite right:

    UPDATE

    dbo.Table1

    SET

    Name1 = CASE

    ...

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

  • RE: How to Update Columns of a Table with two instance in one update Statement.

    azhar.iqbal499 (12/31/2012)


    I have two tables Table1 and Table2 with ID in both tables. I want to update records of First table that matched with second table and also does not...

    Roland Alexander 
    The Monday Morning DBA 
    There are two means of refuge from the miseries of life: music and cats. ~ Albert Schweitzer

Viewing 15 posts - 16 through 30 (of 86 total)