Forum Replies Created

Viewing 15 posts - 5,341 through 5,355 (of 8,731 total)

  • RE: Pass date format into Stored Proc

    Without more information, I have 2 possible guesses:

    Your column transaction_date_time is a string that you're comparing to a datetime and that's causing the error. To correct this error, you...

    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 answer interview question "what is the hardest sproc you have created?"

    Brandie Tarvin (1/9/2015)


    ... I told them I had bought the dev edition of SQL and gotten the disk to install SSRS for free, so I played with it at home...

    If...

    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: Can any one help me to optimize this query? Thanks.

    sonchoix (1/9/2015)


    Thanks Luis and Scott for the code.

    Using Luis code, how do I get a total based on the 12 fields' count result?

    It depends.

    Are those all the possible values?

    If...

    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: Struggling with query to retrieve five most recent

    If I'm correct, you just need to remove the IsValid condition and add Price column to the GROUP BY.

    That should give you the desired result.

    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: Are the posted questions getting worse?

    spaghettidba (1/8/2015)


    Steve Jones - SSC Editor (1/8/2015)


    It's probably not that site posting SPAM, but someone with an affiliate code, or perhaps just a vandal.

    Maybe. Meanwhile, no response from them yet.

    This...

    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: Struggling with query to retrieve five most recent

    I'm not sure I get it. Could you post an example with ddl and sample data as you did previously?

    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: Using BCP to bulk load a table. But getting garbage characters.

    I'm not sure where the problem can be. Basically is because the codepages change in the process. I'm not sure if it's because you're using unicode types and mixing them...

    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 answer interview question "what is the hardest sproc you have created?"

    Maddave (1/8/2015)


    Jeff Moden (1/8/2015)


    Now, based on what I just said, one of my first questions on an SQL Server technical interview for DBAs and Developers alike is "How do you...

    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: Can any one help me to optimize this query? Thanks.

    I guess the problem is that you're reading the table 12 times instead of once.

    Use cross tabs to help with your problem. More info in here: http://www.sqlservercentral.com/articles/T-SQL/63681/

    This is an example,...

    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: Platform Comparison - SQL vs. Oracle (Need benefits)

    Consider the expertise of the employees.

    There have been cases when companies decide to use Oracle because "it's better" but there's no one with enough knowledge to maintain it and tune...

    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: Dynamic Query

    As long as you have it defined in your linked servers, you can use the fully qualified name.

    Server.DB.Schema.Table

    If you're using QUOTENAME(), you'll need to use it for each part of...

    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: Dynamic Query

    BWFC (1/8/2015)


    In VERY simple terms:

    declare @tablename varchar(50) = 'YourTableName'

    declare @SQl Nvarchar(4000)

    set @SQL =

    N'select * from '+@tablename

    exec(@SQL)

    Careful with that, remember little Bobby Tables. http://bobby-tables.com/

    A simple change can prevent that.;-)

    declare @tablename...

    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: Using BCP to bulk load a table. But getting garbage characters.

    Could you include the following parameters?

    -c -C RAW

    bcp Table IN FileName -T -c -C RAW -f "PhoneLog.fmt"

    I'm glad that you read the questions below my name. Those questions are part...

    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: Query inside of a SQL report - look?

    For previous month, according to the first result on Google, would be using the following clause.

    SELECT * INTO #Wrap

    FROM OPENQUERY( Shoretel_Ccir, 'SELECT e.g_event_id,wc.w_name,e.event_id,ep.agent_id,

    a.a_name,et.event_name,g.g_name,e.event_time,rc.rc_name,month(e.event_time) as ''Month'',YEAR(e.event_time) as ''Year'',...

    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: Using BCP to bulk load a table. But getting garbage characters.

    Can you post the bcp command that you're using?

    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 - 5,341 through 5,355 (of 8,731 total)