Forum Replies Created

Viewing 15 posts - 271 through 285 (of 287 total)

  • RE: Dynamic SQL SELECT Query has UDF's as Tables in the FROM Clause

    Berry had some good suggestions. Those "catch-alls" can be nasty. I just did a quick glance and didn't see a real reason why this is all dynamic. I'm sure there...

  • RE: User-defined, Database-level constant: is there a 'best' technique?

    starunit (5/15/2009)


    Glenn Dorling (5/14/2009)


    One way to do this would be to use the db_name() function. You don't need elevated privileges to run it either.

    I've only done very limited testing...

  • RE: Gen Bogus SSNs?

    Yeah, random data can be problimatic. One quick and dirty thing you coudl do is create a temp table with the PK on the SSN using the IGNORE_DUP_KEY And just...

  • RE: CASE WHEN Column IS NULL

    I think Lynn covered it, but maybe this sample would help to demonstate:DECLARE @Foo TABLE(EmergencyContact VARCHAR(50), EmergencyRelation VARCHAR(50))

    INSERT @Foo

    SELECT 'Jean', 'Mother'

    UNION ALL SELECT NULL, 'Father'

    UNION ALL...

  • RE: Insert into table w/PK, not identity column

    If you are using SQL 2005 or later you could use a ranking function:INSERT INTO 3rdPartyDatabase.dbo.Table1 --(table w/UserID PK)

    (fullname, title, phone, emailaddr, dept, location, fax, employee_id, UserID)

    SELECT

    upper(lname) + ',...

  • RE: handling Distinct rows of data

    To build on Johns example, here is a mroe simplified version:SELECT

    ID,

    Color,

    Date

    FROM

    (

    SELECT

    ...

  • RE: How do you compare two big tables in same database on the same server?

    WebTechie38 (5/12/2009)


    You know I've met some great people on this forum and some I truly look up to as mentors.

    Then there are times people post things and you are not...

  • RE: Error Handling

    Your procedure should/will continue (unless you have changed the default settings)

    SELECT 1/0

    SELECT 1

  • RE: How do you compare two big tables in same database on the same server?

    Sergiy (5/11/2009)


    CHECKSUM is not good enough.

    Different records may have the same CHECKSUM.

    I agree that the checksum function will produce the same number for different rows.

    However, the chance of a...

  • RE: convert datetime to integer

    WayneS, has a nice description of how dates are stored internally. But, what do you want the INT to represent? Do you want a number like YYYYMMDD or the integer...

  • RE: display 0.00 when no records found

    You may need to change the INNER JOIN to a RIGHT OUTER JOIN between the two derived tables, as the WHERE clause on the Daily table is different than the...

  • RE: need help regarding SSIS

    There is also the SCD (Slowly Chaning Dimension) control that you can use to achieve this. This control tends to perform poorly (like other solutions) if you need to compare...

  • RE: Disallowed constructs while creating Index on a view.

    The indexing of a view asside, there are several other options that you might want to investigate:

    1. Add a IsCurrent flag to your table.

    2. Just create the view and...

  • RE: SET vs SELECT

    I think people get hung up on the performance issue because of that article. How often are you assigning a value to a variable? If you are doing some wacky...

  • RE: Convert varchar to numeric

    Atif Sheikh (4/29/2009)


    if you are willing to ignore records with non-numeric value in MPANCORE,

    try this

    select *

    from thangela.NpowerNorthern_v1 a

    INNER JOIN EPPS.dbo.Customers b ON case when IsNumeric(b.MPANCORE) = 1 then b.MPANCORE...

Viewing 15 posts - 271 through 285 (of 287 total)