Forum Replies Created

Viewing 15 posts - 8,266 through 8,280 (of 8,731 total)

  • RE: combine 2 rows into 1 row

    EDIT: Nevermind, I hadn't examined your code.

    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: 100 Most famous interview Questions and Answers

    Lynn Pettis (10/29/2012)


    Jeff Moden (10/29/2012)


    rajeshpalo2003 78748 (10/29/2012)


    Please go to the following link:-

    http://sqlcheatsheet.wordpress.com/2012/10/26/sql-server-2008-2008-r2-cheatsheet/

    Download the PDF (sqlserver2008r2_cheatsheet_v1-01.pdf). Password: Harinam

    This is very good document for the freshup your memories with SQL Server features.

    For...

    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: Best way to handle Null values

    For what I understood, there's one condition missing in the previous solutions.

    Here's my guess (since I have nothing to test on)

    Declare

    @OrdNbr CoNumType

    Select ISNULL( order_nbr, 'xxxxxx') order_nbr, field1, field2, field3

    from table

    where...

    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 Get Timer Like Funcationality in SSMS to Auto execute a Query every N incremenets

    Have you tried replacing the While loop with a GO N?

    SELECT *

    FROM MyTable

    waitfor delay '00:00:02'

    GO 5

    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: timestamp field converted to datetime

    AFAIK, there's no way to convert a timestamp to datetime because there are no datetime values in the timestamp.

    To avoid confusions, Microsoft has implemented the synonym rowversion.

    Reference:

    http://msdn.microsoft.com/en-us/library/ms182776(v=sql.90).aspx

    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: 100 Most famous interview Questions and Answers

    It worked using just lower case.

    The document does not have a great format. It's hard to read.

    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 TOP query with an option for all records

    Easiest way

    DECLARE @Top int --The number of records to return

    DECLARE @SelectType varchar(6) --Either Top, Bottom or ALL

    SET @Top = 5

    SET @SelectType = 'ALL'

    --SET @SelectType = 'Bottom'

    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: How show datetime select only in Sql Server?

    You have some problems in your query, I'll explain in the code

    SELECT em.EmpNo as 'EmpNo',

    --You should not compare NULLs with = or <> because it will always return unknown...

    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: Help with slow query

    AFAIK, and someone can correct me if I'm wrong, SQL Server has some problems optimizing plans for CTEs and table variables. Using a temp table might improve the performance, but...

    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: Help with slow query

    I have 2 suggestions for you (none of them include an index because I'm no expert on them).

    1. Include the actual execution plan files (.sqlplan) that contain more information than...

    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: Calculating AGE with 2 INT columns

    In SQL Server 2008 they introduced the date type if you don't need the time.

    Consider using it.

    For earlier versions, you can always eliminate the time before storing it in the...

    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: Stored Procedure that returns the number of Schemas that database has

    You can find that information in these links

    For the schemas:

    http://msdn.microsoft.com/en-us/library/ms182642.aspx

    http://msdn.microsoft.com/en-us/library/ms176011.aspx

    For the stored procedure:

    http://msdn.microsoft.com/en-us/library/ms187926.aspx

    I'll give you a tip: use google or even better press F1

    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: WildCard Performance Impact

    That's because when you use a wildcard in the beginning of a string, you won't be able to use indexes.

    I'm not sure if you can increase performance using PATINDEX or...

    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: Calculating AGE with 2 INT columns

    Sean Lange (10/26/2012)


    I would also point out that based on the calculation in your query you are possibly not going to get the data you want. Even if you first...

    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: Calculating AGE with 2 INT columns

    I've had that problem before with a really bad database design.

    I recommend you to change the type of that column to avoid more problems.

    Now, the solution would be to 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

Viewing 15 posts - 8,266 through 8,280 (of 8,731 total)