Forum Replies Created

Viewing 15 posts - 31 through 45 (of 51 total)

  • RE: detach and reattach

    In general, you will detach a db when you want to disable, or otherwise curtail use of it.

    This has the effect of "deleting" it from the server, without actually deleting...

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

  • RE: Conditional select

    re:

    what i am trying to pull out is a dataset where I do not have duplicate records because, for example, the record has 'SS18' in code1 and 'SS18' in code3....

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

  • RE: Conditional select

    if present select the record. If not then check code2 for 'SS18' OR 'SS19'. If present then select the record. If not then check code3 for 'SS18' OR 'SS19' If...

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

  • RE: Conditional select

    This returns the 1st instance of 'SS18':

    SELECT top 1 * FROM #REF

    WHERE 'SS18' in (Code1, Code2, Code3)

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

  • RE: Explain plan save as pdf file

    Using Office 2007, one can:

    - Install: 2007 Microsoft Office Add-in: Microsoft Save as PDF

    - With plan displayed in MSMS, hit ALT-PrtSc

    - Open new doc in MSWord 2007

    - Hit Ctrl-V to...

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

  • RE: Stored procedure parameters

    Explanation: Stored procedure calls will silently truncate strings.

    I believe the Explanation here is more fundamental than "Stored procedure calls...", instead having to do simply with the declaration of the...

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

  • RE: treatment of white space in string operations

    I think your prob is not in the SQL.

    In MSMS, if you send your Results to Text, you get this:

    1234567 89

    123 ...

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

  • RE: How to prohibit empty strings globally?

    ...so that it wouldn't be necessary to remember to add the above constraint to each and every table?

    Do it in one operation:

    EXEC sp_MSForEachTable 'ALTER TABLE ? ADD CONSTRAINT ck_FieldName CHECK...

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

  • RE: SQL Query Analyzer Output Result to nul:

    I'm unsure what you were trying to achieve here, but your example lead me to this interesting phenom:

    In effect, the statement:

    SELECT @dummyvar = name FROM foo

    acts like a...

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

  • RE: Installing Query Tool for Various Users

    You can use Query Analyzer(2000) to query 2005 dbs.

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

  • RE: Is there any way to delete records withouta dropping FKs

    PaulB (7/6/2009)


    molson (7/6/2009)


    I'm shocked and appalled some people have a total disregard for Referential Integrity.

    Sometimes a DBA's gotta do what a DBA's gotta do...

    :blink: do you mean... trash referential integrity?...

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

  • RE: Is there any way to delete records withouta dropping FKs

    I'm shocked and appalled some people have a total disregard for Referential Integrity.

    Sometimes a DBA's gotta do what a DBA's gotta do...

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

  • RE: printing 1 to 100 in SQL Server as a batch....

    here's fast, less typing:

    print ('1 ' + '2 ' + '3 ' + '4 ' +'...')

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

  • RE: What is the TRACE to see all the sql statements run

    - Start Profiler

    - File Menu / New Trace

    - 'Events Selection' Tab

    ---- Uncheck all except Stored Procedures RPC: Completed (and maybe TSQL:SQLBatchCompleted )

    ---- Check 'Show all columns'

    ---- Ensure 'Text...

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

  • RE: extact last 3 characters from a string

    select substring ('ABC123',4,3)

    -MarkO

    "You do not really understand something until you can explain it to your grandmother" - Albert Einstein

Viewing 15 posts - 31 through 45 (of 51 total)