Forum Replies Created

Viewing 15 posts - 1 through 15 (of 853 total)

  • Reply To: Tables with constant data

    Since these tables are constant, you can pack them very tightly and not worry about a fill factor. Just declare a primary key and keep things simple.

    :

    CREATE TABLE Lookup

    (lookup_code CHAR(3)...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: Flattening of hierarchy

    Why did you post any DDL? I know this is not SQL Server, but you could've at least tried to help us a bit. If you have models or hierarchies...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: Need street name generator, one word

    If you Google around, you can find tools for generating such data. In particular, there is a standard for street addresses in the United States called "nine – one –...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: What am I doing wrong with this subquery?

    International classification of diseases amended – version 9

    This is the standard encoding used in medicine. However, I think they might be on version 11 by now. Some of the newer...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: What am I doing wrong with this subquery?

    >> I am trying to return all values from the lookup table to columns on the same row for the Diagnosis code. <<

    Please read any book, and I do mean...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: cursor not getting next values

    >> I've built this cursor to build a new diag_code from all the values in the cursor. <<

    I've been doing SQL for over 30 years and spent some time on...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: Where condition for performance

    This is a tricky question that depends on the product. In the case of SQL Server, the IN() is a shorthand for OR-ed predicates. We added it to the SQL...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: UNION ALL with CTE

    Yes, and the history table should be a single table with columns that indicate the start and end times of a state of being of the data element being modeled. It...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: UNION ALL with CTE

    >> I am trying to UNION ALL two tables 1) Current receipts 2) Historical receipts. Both of those tables have CTE because it was the only way how could it...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: group records by week

    Did you know that we've had a DATE data type in SQL Server for many years now? There is no need to use the old DATETIME that was inherited from...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: Create a matrix view from a table

    Hi,

    I have a table called facility:

    id name

    123 Hospital blah blah

    124 Dr's office 1

    125 Dr's Office 2

    126 Hospital 2

    It joins on a table called patient

    patient_id facitility_id

    1234 124

    1234 236

    2345 236

    2345 124

    1235 126

    1235...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: Recursive Triggers

    >> I know there is, somewhere, T-SQL that will allow me to update (keep in sync) a field [sic] that appears in two different tables without them continuously triggering each...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: Help with query

    One of Dykstra's best quotes to his students when they were trying to learn programming was "you're doing everything completely wrong." And he really

    meant it. I prefer the gentler version...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: Complicated Insert SQL with Calculations

    Did you know that by definition, a table must have a key? We cannot have NOT NULLs, so what you post can never be a table. You also have more...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Reply To: The same value across 5 or more columns in a table , How can I write a query

    >> I got a table with 5 integer columns and one varchar(100) column. <<

    Where is the DDL? I guess you want us to do everything for you , including read...

    Please post DDL and follow ANSI/ISO standards when asking for help. 

Viewing 15 posts - 1 through 15 (of 853 total)