Forum Replies Created

Viewing 15 posts - 18,466 through 18,480 (of 18,926 total)

  • RE: Case in Where with Null

    I guess that my test case is wrong because when I run this :

    set ansi_nulls off

    Declare @FkParentOBJ as int

    SET @FkParentOBJ = null

    Select top 10 * from dbo.ObjSQL WHERE FkParentOBJ...

  • RE: Select only stand alone statistics to drop

    How's this for reverse engineering :

    Select Object_name(id) as TableName, 'DROP STATISTICS [' + Object_name(id) +'].[' + name + ']' from dbo.SysIndexes where indid > 0 and indid 0...

  • RE: How to get available memory using SQL

    It's not a table : run this in the master table

    Select objectproperty(object_id('sysperfinfo'), 'TableIsFake')

    It will return 1. This means than when you query that table, Sql server meterializes it so...

  • RE: Way to get full @@rowcount even when using "top"?

    I'm curious to see what other people are gonna say but I think you'll have to run a second query to get the actual count. Or run the query...

  • RE: Table Join

    BTW... I forgot to say that something like this is better handled at the client side of the app because it's really presentation stuff. I only HAD TO use...

  • RE: Memo field

    That's why I love this site... so many simple solutions that make your life easier. Thanx for everyone's input (even if I didn't start the thread).

  • RE: Table Join

    hmm ya... I'm used to return strings that end with ', '.. but even then LEN() would chop the last space.

    To sum up the best approach in all...

  • RE: Table Join

    Actually it might run faster like this :

    Select A.PPID, dbo.fnItems(A.PPID) as Items from

    (Select DISTINCT PPID FROM dbo.YourTable) A

    ORDER BY A.PPID

  • RE: Table Join

    CREATE FUNCTION [dbo].[fnItems] (@Id as int)

    RETURNS varchar(500) AS

    BEGIN

    Declare @Items as varchar(500)

    SET @Items = ''

    Select @Items = @Items + CAST(acctnum as varchar(10)) + ',' + CAST([time]...

  • RE: Case in Where with Null

    Personal preference: don't like to play with set options unless I have to... especially when someone else may be changing the sp later on.

    I had considered PW's option of ISNULL(,...

  • RE: Shared ADO Connection

    For the global connection :

    Open a module and declare the connection like so

    Public MyCn as ADODB.Connection

    'run this on the program startup

    public sub AutoExec ()

    set mycn = new adodb.connection

    mycn.open "..."

    end...

  • RE: Managing Constraints

    Disable

    ALTER TABLE ObjSQL NOCHECK CONSTRAINT ALL

    enable

    ALTER TABLE ObjSQL CHECK CONSTRAINT ALL

  • RE: Case in Where with Null

    I still don't think it would work because null doesn't equal null so that part of the query wouldn't work...

    how about :

    where product_id is null and @ProductId is null...

  • RE: cookies/ session

    Create procedure dbo.MySP @UserId as int

    as

    --do something here

    go

    in asp net

    Dim iUid as integer

    iUid = mycookie.value

    call the stored proc and set the @UserId parameter using iUid

  • RE: Starting to hate ASP.NET....pls help

    On which line are you getting this error (read is the error coming from sql server or asp net).

    Can you post the strUser value before executing?

Viewing 15 posts - 18,466 through 18,480 (of 18,926 total)