Forum Replies Created

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

  • RE: Why Primary Keys can be important on large tables

    sql-lover (7/1/2014)


    There is no difference between Unique Index and Unique Constraint, besides the obvious syntax of course.

    I would disagree. They are mostly the same,yes, but you can use the INCLUDE...

  • RE: Why Primary Keys can be important on large tables

    Well of course the unused space is going to shrink, since the table is being rebuilt. After many inserts and updates, the table will get fragmented again and the unused...

  • RE: Removing the Linked Server 2 hop Limitation

    SPNs (Server Principal Names) need to be generated for all servers involved. This can be automatic by giving the AD account that is used as the service account the...

  • RE: Collation error when adding distributer

    Yes, that's the collation.

    What a pain to change it. There has to be some way to get this done without changing it.

    Any ideas on where the proc "sp_MScreate_distributor_tables" is located?...

  • RE: Fixing Divide by Zero Error

    I would agree with Lynn's post. You can not divide by zero, but if you divide by NULL, you'll get NULL.

    DECLARE @i FLOAT = 10, @x FLOAT = 0

    SELECT @i...

  • RE: F5 to refresh

    Gazareth (1/26/2012)


    Sort of relatedly, but when I first moved to SSMS from Query Analyser/Enterprise manager, took me months to stop hitting the debug button on the toolbar, rather than Execute...

  • RE: SSIS create text file and add text

    I have several SSIS packages that do this. As far as I know, the text file is created automatically if it does not exist.

    If you want that first row...

  • RE: Splitting a huge, a huge table in two or three

    To answer the immediate question, I would recommend partitioning. We have data warehouses for several clients, and this solution works great for us.

    In my opinion, the bigger question is why...

  • RE: Table that has all the dates from 2000 till today

    Here's my take. This one uses the Common Table Expression and doesn't depend on the sys.columns table.

    WITH e1 (N) AS -- 10 Records

    (SELECT 1 UNION ALL SELECT 1 UNION ALL...

  • RE: Using TOP To Rank Columns In a Table

    Yeah, I'm with most others. I find the question more interesting that the solution. Why was it he needed that?

  • RE: Export To SAS

    We have SAS import from SQL server. This seems to work for some of the jobs we run. I'm not the one that creates the SAS jobs, so some of...

  • RE: Insert into table from other table while excluding duplicates

    I personally prefer the NOT EXISTS clause:

    INSERT INTO invoices (INVNUM, PROVIDER, DIVISION, BA, AGE, SEX, TES_CRE_DT,

    INV_CRE_DT, INV_SER_DT, measure)

    SELECT A.invoice, A.Provider, A.Division, A.BA, A.AGE_AT_DOS, A.SEX, A.TES_CRE, A.INV_CRE_DT,

    A.INV_SER_DT, A.Measure

    SELECT A.invoice, A.Provider, A.Division,...

  • RE: dynamic sql

    Yeah, I would tell the developer, "No. Do it right."

  • RE: If Exists Update else Insert into table

    I would use a MERGE statement as well. Something along the lines like this:

    MERGE tblPermTask AS pt

    USING

    (SELECT

    ed1.intQuestionId,

    ed1.intSRpAttendID,

    q.strShortTask,

    ed1.dtLogged,

    ed1.intPersonnelId,

    ed1.strRemarks,

    Case WHEN ed1.strRemarks = '' THEN '' else 'SRP Notes' + ed1.strRemarks...

  • RE: Incremental load using SSIS

    If it were me, I would load the data in a staging table. Let's call that table Y. Then, I would use a MERGE statement (in a proc) like the...

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