Forum Replies Created

Viewing 15 posts - 211 through 225 (of 2,893 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...

  • 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...

  • 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...

  • 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...

  • 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()....

  • RE: query

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

    SELECT ItemName

    FROM (SELECT *

    FROM ...

  • 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...

  • 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...

  • 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...

  • 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:

  • 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.

  • 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...

  • 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...

  • 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...

  • 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 .......

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