Forum Replies Created

Viewing 15 posts - 6,571 through 6,585 (of 8,731 total)

  • RE: Moving Values from Temp table to another tamp Table

    Two solutions come to my mind. The first one assumes you don't have duplicate values for Resourcekey.

    INSERT #Resource (Resourcekey)

    SELECT Resourcekey

    FROM #Base_Resource

    INSERT #Resource_Trans (StringId, value)

    SELECT r.StringId, b.value

    FROM #Base_Resource b

    JOIN #Resource r...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: [High Important]Could not continue scan with NOLOCK due to data movement

    yuvipoy (4/9/2014)


    Lynn Pettis (4/9/2014)


    Simple, don't use NOLOCK.

    What is the cause of the problem ?

    I have been using this statement for nearly 6 years in prodution i did not get any...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: how to update value from c2 to c1

    I'll try to explain the query. I already updated my previous post to add comments and remove an unnecesary column.

    The first part is a recursive query that will add a...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Need help with a stored procedure that has been timing out in the program.

    There are some improvements that can be done but you need to help us first. To get better answers, you should follow the advices on this article: http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

    You should avoid...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: SQL Server books for Administration

    There's a Books section[/url] in this site. You should take a look at it, maybe you can find something interesting.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Import a data from mysql to mssql

    Eirikur Eiriksson (4/8/2014)


    You should look into linked server, check this out

    😎

    It could help in other cases, but I'm not sure that it's the best option if you're trying to copy...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: self-join; getting one "unique" record

    Would something like this help you?

    SELECT ssn

    ,repeatedvalues = STUFF(( SELECT DISTINCT '; ' + name + '-' + CAST( number AS varchar(20))

    FROM @tmp x

    WHERE x.ssn = t.ssn

    FOR XML PATH('')), 1,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Rounding up to fifth decimal

    Maybe you didn't play enough with the ceiling function. 😉

    DECLARE @num numeric(10, 8) = 83.00381433 ;

    SELECT CEILING( @num * 100000) / 100000;

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: What is wrong with this syntax? Query will work, but CTE will not "compile"

    Since you're correcting this code, why don't we make it simpler and faster?

    WITH UnloadDates AS(

    SELECT ShipmentID,

    MIN(starttime) StartTime,

    MAX(Endtime) EndTime

    FROM tblInvoice O

    WHERE O.startTime IS NOT NULL

    AND O.EndTime IS NOT NULL

    AND...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Import a data from mysql to mssql

    Bulk insert is used to import data from a flat file (txt, csv or anything with that structure).

    If you generate the file, you could use it.

    You could as well use...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Complex SQL Pivot Query Urgent Help Needed

    I was working on a cross tabs solution but Sean beat me to do it.

    I just wanted to point out that it should out perform the previous solutions because it...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Moving over from Oracle

    sqlbuddy123 (4/7/2014)


    hboswell (4/7/2014)


    sqlbuddy123 (4/7/2014)


    hboswell (3/21/2014)


    I have recently retired from my previous job as an Oracle DBA, now I'm working for a small IT firm where I'll be doing some SQL...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Arrival and Depart location query help.

    This might become confusing, but I believe that it could help you solve your problem.

    Try to understand it and post any questions that you have.

    WITH Limits AS(

    SELECT tktnum,

    MAX( seqnum) Maxseq,

    CAST(...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Combining multiple rows into columns

    You might want to take a look at these articles:

    http://www.sqlservercentral.com/articles/T-SQL/63681/

    http://www.sqlservercentral.com/articles/Crosstab/65048/

    The first one covers the basics and the second one covers a dynamic approach that you might need.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Arrival and Depart location query help.

    How would you know that it's MIA-ATL-MIA instead of ATL-MIA-ATL? Remember that there's no default order on sql server.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 6,571 through 6,585 (of 8,731 total)