Forum Replies Created

Viewing 15 posts - 3,886 through 3,900 (of 4,085 total)

  • RE: system views sql

    You can also use the Information_Schema.Columns system view. It does all of the joins for you, and I find it much easier to remember one view.

    SELECT Table_Schema, Table_Name, Column_Name,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: to check value exist in a node or not

    Instead of pulling back all nodes and then checking whether the local name matches, you should just pull back the nodes that do match.

    @x.exist('//ConsumerID') = 1

    From there, it's simple to...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Basic xml formatting question

    You can specify attributes using [path/@attr]. For example,

    SELECT

    'center' AS ,

    td = [server] ,

    '' ,

    'center' AS ,

    td = [DatabaseName] ,

    '' ,

    'center' AS ,

    td = [Status] ,

    '' ,

    'center' AS ,

    td =...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to use store procedure to insert data in aspx page textboxes.

    SQL is unaware of the calling application, so it cannot manipulate the calling application. SQL just returns the data. It is up to the calling application to use...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Adding a trigger for new Customer Order

    The main issue is that you are using

    INSERT INTO TABLE(Fields)

    VALUES(Values)

    when you should be using

    INSERT INTO TABLE(Fields)

    SELECT expressions

    FROM INSERTED

    I would also recommend using TRY...CATCH blocks.

    There are also undefined variables in your...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Adding a trigger for new Customer Order

    If you have a specific problem, it would help if you specified what it was. If you just want to know how to get started, look up CREATE TRIGGER...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Creating Table in Stored Proc With Phrase and Today's Date

    Also, the format that you're looking for in the CONVERT is 112, which gives you YYYYMMDD without the need to use REPLACE to get rid of extraneous characters.

    SELECT Convert(varchar(8), Getdate(),...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Return set of dates from Date table for each group of records.

    Jim-720070 (9/2/2010)


    Why couldn't I use CTE's? You're kinda right.. I'm actually writing a Crystal report and this is the SQL I'm using in a command. Wish I could use CTE's...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Incremental data

    Depending on the number of tables and the types of updates, replication may actually be your best option. SSIS is going to have a hard time dealing with deletes,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Using CASE WHEN to return a logical value in WHERE clause

    A conditional expression can't appear in your THEN clause. The generic way to fix this is to move it to the WHERE clause with an AND.

    WHERE CASE

    ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Try...Catch not catching

    Matt Miller (#4) (8/30/2010)


    Actually - compile errors (which I believe is what you'd get if you try to insert into a column that doesn't exist)

    Actually, that's a runtime error. ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Weird Sorting based on csv requirement

    Arjun Sivadasan (8/31/2010)


    So, as you can see, I need the entire list of records to generate the row number. If I take only a percent of the effective records, my...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: how can i do the delete statement without having to re-index?

    I think he's inserting into a temp table, then deleting from the temp table, and then inserting the remaining records into the production table.

    If that is the case, you might...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Weird Sorting based on csv requirement

    Arjun Sivadasan (8/30/2010)


    I can't use batch processing as I need the entire set of recordids at one go. This is only a small part of the query and I have...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Try...Catch not catching

    Brandie Tarvin (8/30/2010)


    Drew, the code author had no specific transactions within the TRY block. He's treating the TRY as all one transaction. It should be an All or Nothing proposition....

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 3,886 through 3,900 (of 4,085 total)