Forum Replies Created

Viewing 15 posts - 211 through 225 (of 2,894 total)

  • RE: Getting extended properties from every database

    I wouldn't use foreachDB:

    SET NOCOUNT ON;

    IF OBJECT_ID(N'tempdb..#TempDBs') IS NOT NULL DROP TABLE #TempDBs;

    CREATE TABLE #TempDBs(DatabaseName NVARCHAR(250), ExtendedProp NVARCHAR(MAX));

    DECLARE @sql VARCHAR(MAX);

    SET @sql = '';

    SELECT @sql = @sql + 'INSERT #TempDBs...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: How to make a function a system function.

    As far as I am aware, it is impossible to create new system functions in SQL Server (unlike system procs).

    Closest think you might want to do is to create function...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: List DB users

    But it ony gives me AD users and I need AD Users, AD Groups and SQL users.

    ...

    Do you Active Directory groups and user? If so...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Multiples address lines on a single row. Pivot?

    What I want is this:

    RowID, 1stAddr1, 1stAddr2, 1stAddr3, 1stAddr4, 1stPostcode, 2ndAddr1, 2ndAddr2, 2ndAddr3 (etc)

    If you need just two columns: RowId and ConcatenatedAddress - use advised FOR XML with STUFF thingy.

    If...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Odd (n)VarChar Behavior

    Select and RaisError only display the string up to the Char(0), but Print displays the entire string, even though both strings show the same Len() and DataLength()....

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: query

    No need in windowed functions, you can achieve the same by simple ORDER BY of UNION ALL:

    SELECT ItemName

    FROM (SELECT *

    FROM ...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: NULL issue

    GilaMonster (8/23/2013)


    Eugene Elutin (8/23/2013)


    SET ANSI_NULLS OFF;

    IF 'x' <> NULL PRINT 'Well, it is known, sometimes... '

    In a future version of SQL Server, ANSI_NULLS will always be ON and any applications...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: NULL issue

    GilaMonster (8/23/2013)


    The only comparison with NULL that can return TRUE is the IS NULL/IS NOT NULL comparison.

    'x' = NULL returns UNKNOWN, not TRUE or FALSE

    'x'<> NULL returns UNKNOWN, not TRUE...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Techniques for improving stored procedure performance

    Does your proc have input parameters which then used directly in WHERE clauses or JOINS?

    If so, try to declare local variables at the top of proc, assign them to input...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: NULL issue

    There is another, more cryptic way, if you wish:

    select * from @t where case when name = 'Check' then 1 else 0 end = 0

    :hehe:

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Fulltextsearch in varbinary field

    You need to specify TYPE COLUMN which holds file type extention.

    Read BoL: http://technet.microsoft.com/en-us/library/ms187317.aspx

    So you need a column to keep extention in.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: Grouping by columns to create single record

    BFSTEP (8/1/2013)


    I am in a time crunch, many things on my plate today, and I just can't seem to get this problem, thought I would toss it out to the...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: WITH (NOLOCK), allows dirty reads.

    Eugene Elutin (8/1/2013)


    GilaMonster (8/1/2013)


    Eugene Elutin (8/1/2013)


    3. Dirty read may not read data which was committed long ago...

    That's not a dirty read. The definition of dirty read is reading uncommitted data.

    That...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: WITH (NOLOCK), allows dirty reads.

    GilaMonster (8/1/2013)


    Eugene Elutin (8/1/2013)


    3. Dirty read may not read data which was committed long ago...

    That's not a dirty read. The definition of dirty read is reading uncommitted data.

    That nolock can...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • RE: CTE

    vignesh.ms (8/1/2013)


    How do I nested common table expression?

    To nest CTE just use comma:

    ;WITH cte1 AS (SELECT .... FROM [sometable])

    ,cte2 AS (SELECT .......

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 15 posts - 211 through 225 (of 2,894 total)