Forum Replies Created

Viewing 15 posts - 76 through 90 (of 149 total)

  • RE: Continue on error

    On a separate note.

    GO is a batch separator.

    https://msdn.microsoft.com/en-us/library/ms188037.aspx

    and the definition of a batch is...

    "a group of one or more Transact-SQL statements sent at the same time from an application to...

  • RE: Merge Output statement [Combine Deleted.* with Inserted.*]

    You can join Deleted & Inserted so you can include columns of both in one result set. Just make sure you have a unique key to join on.

    There are...

  • RE: Schema

    ZZartin (12/8/2016)


    Inside those views are they maybe referencing things with schema specified, ie SELECT <columns> FROM dbo.TABLE in the views in both schemas?

    Quoting ZZartin to bring more attention to his...

  • RE: Query optimization

    drew.allen (12/6/2016)


    CELKO (12/6/2016)


    Using proprietary dialect constructs like CROSS APPLY and TOP make optimization difficult

    Now you're just making up stuff to support your claims.

    and portability impossible.

    Who cares?!?! Most people...

  • RE: Query optimization

    Igor Micev (12/5/2016)


    I'll have to check about the DISTINCT. it seems that can be removed, but i'm not sure about whether there could be duplicates. will it make a bigger...

  • RE: can this be done in another way

    mxy (12/1/2016)


    ;WITH summary AS (

    SELECT p.Studentstatus,

    p.StudentId ,

    ...

  • RE: Query optimization

    DDL & DML would help.

    First of all, you've created a temp table #LocalizedCategories, but you are doing a Select Distinct on it. Is there any reason you couldn't have...

  • RE: Search query based on four separate parameters.

    mack53nico (12/1/2016)Is it possible to rewrite the code that encapsulates all these combinations in a concise way?

    SELECT Source_System, Identifier, Forename, Surname, Date etc....

    FROM tblTable

    WHERE

    (Identifier = @identifier

    OR...

  • RE: SQL Query

    Another option:

    SELECT @Dummy = CASE WHEN LEN( Med_Rec_Nbr ) < 7

    THEN RIGHT('000000'...

  • RE: SQL Query

    SELECT ps.Med_Rec_Nbr, REPLACE(STR(ps.Med_Rec_Nbr,7),' ','0')

    FROM @Primary_Summary AS ps

    This approach also makes it obvious if you got a number larger than expected, rather than truncating to 7 characters.

  • RE: Functions Database

    - Cross database access requires some additional security checks.

    - The connection to another database will require an additional session, which will have its own CPU and memory overhead....

  • RE: Search query based on four separate parameters.

    mack53nico (12/1/2016)


    He may be wrong, but I won't be the one to tell him that 😀

    You said you're new, but I strongly recommend you do tell him. His response...

  • RE: Update Table Left Join Linkserver

    On an unrelated note, you've created these objects in the master database. That is a very bad idea. If at all possible, you should move those to a...

  • RE: Running Visual Basic 6.0 Application (Old SQL Inline Queries + Depreciated Functions with SQL Server 2014/ 2016

    wajahatabbas (11/25/2016)


    We want to upgrade our database to the latest SQL Server 2014 or 2016, but we dont want to put our efforts on the application upgrade side.

    How much...

  • RE: A scenario where SQL Server doesn't seem to help

    A couple more questions:

    You said lots of queries time out, but not all. Have you looked to see if there are specific columns that experience the timeouts? I...

Viewing 15 posts - 76 through 90 (of 149 total)