Forum Replies Created

Viewing 15 posts - 46,801 through 46,815 (of 49,552 total)

  • RE: NULL & Count()

    karthikeyan (4/23/2008)


    Carl Federl

    select @Nm = 'Age'

    select @Null = count(*) from #t1 where (@Nm) is null

    As "where (@Nm) is null" will always be false, zero rows will meet the

    restriction....

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: NULL & Count()

    Carl Federl (4/23/2008)

    Why are you expecting a value of 3 ?

    He wants to specify the column name in a variable.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: NULL & Count()

    Because the variable @Nm is not null. It is equal to 'Age'

    If you want to have a variable column specified in the where clause, you'll have to use dynamic SQL,...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: index size qn

    That's not what spaceused is saying.

    Spaceused lists your data size (the clustered index) as 12 GB. The page count confirms that.

    What spaceused lists as index size is the total space...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Update a table from select statement results

    You're referencing the table FDIT_SAP_AUC_IMPORT in the set and in the where, but it's not in the from.

    Is this perhaps what you want?

    update FDIT_SAP_IMPORT

    set AUC=FDIT_SAP_AUC_IMPORT.auc

    from FDIT_SAP_AUC_IMPORT

    where FDIT_SAP_AUC_IMPORT.WBSnumber=FDIT_SAP_IMPORT.wbsnumber;

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Query Optimization problem(Heavy cost in Top n Sort)

    Can you post the entire query please, the table structure and all the indexes on it? Also, please save the execution plan as a .sqlplan file (right-click the exec plan,...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: index size qn

    It might be. How many other indexes do you have on the table?

    Run this and see what it regarding page count for the clustered index (index_id 1) and the other...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Update a table from select statement results

    Maybe.

    Can you post the entire update statement please?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: I need to reinstall the Sql Server 2005 Agent

    Try connecting from full management studio, rather than management studio express.

    You can install the workstation componenents alone on your client PC from the same DVD that you installed the server.

    btw,...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Encrypting Stored Procs

    Not that I know of. In SQL 2000, encryption means that the object cannot be scripted of modified without either having the original code, or decrypting the proc.

    Especially in SQL...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Encrypting Stored Procs

    It still works in SQL 2000 and later. What error are you getting?

    This works fine in SQL 2005

    CREATE PROCEDURE Test

    WITH ENCRYPTION

    AS

    SELECT 1

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: ALTER TABLE char to datetime

    ALTER TABLE <Table name>

    ALTER COLUMN <Column name> DATETIME NULL

    Make sure all the data in that column can be converted to date time, or you'll get some interesting error messges

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: How to write update trigger in sql database with current system date

    A trigger fires when data in a table changes.

    If you want to run something at a specific time, you need a job, set up within SQL agent. From the...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Creating jobs in Microsoft SQL Server Express Edition

    Express does not include SQL Agent, hence you cannot create or run jobs.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: How to write update trigger in sql database with current system date

    A trigger fires when a row is updated/inserted/deleted in a table.

    From the sounds of it, you want to change data at a certain time. Is that correct?

    I'm also not 100%...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 46,801 through 46,815 (of 49,552 total)