Forum Replies Created

Viewing 15 posts - 571 through 585 (of 668 total)

  • RE: Finding duplicates + an extra column

    Removed

  • RE: Working with Temp Tables

    you could do it dynamically, but not sure about the logic issue that Steve brought up.

    declare @vs_sql nvarchar(1000)

    IF 1 <> 0

    BEGIN

    set @vs_sql = '

    Select ''A'' field1 INTO #myTemp1

    select...

  • RE: Need help with a trigger

    if you setup the foreign key to cascade deletes, then you won't need the overhead of a trigger. It will handle multiple deletes and you will never have orphan...

  • RE: Error Handling (@@Error Vs Try...Catch)

    @@Error reports the error from the line directly before it. One of the issues with it is the severity of the error. If it is 16, then you...

  • RE: NOOB DOUBT: Storing data into 2 related tables

    You might want to think about reversing the foreign key. In you scenario, you will have to insert the address first and then get the ID to put into...

  • RE: Insert Summary Record After Stripping Old Records

    do you have any table layouts and sample data? What have you tried so far? Is there a reconciled flag in the table? If you provide sample...

  • RE: How do I count the occurrences of a sequence of records

    Do you have any DDL and sample data for us to use? Also what have you tried so far. See the first link in my signature on how...

  • RE: Help needed reading xml files in T-SQL

    I was able to do this using dynamic syntax and a temp table. Here's an example

    declare @filname nvarchar(50), @vs_Syntax nvarchar(max)

    Create table #vt_Results (XMLPath nvarchar(200))

    set @filename = 'c:\File.Config'

    set @vs_Syntax =...

  • RE: error handling

    set Ansi_Warnings off. Look at this code. The first select returns the correct number, but also the message "Warning: Null value is eliminated by an aggregate or other...

  • RE: Formating a Select Statement

    acogswell (5/13/2010)


    This isn't going to look pretty...:hehe:

    d057c210-1f77-4c88-9807-23d7ff0d94a052e94064-b993-46ab-aa3f-3a9f42f8f4bd5/311005/13/2010 1:46:00 PM8624335f-ca90-4cc2-9ec3-388b7b2857e0

    10405e79-a94a-4b31-ada3-594e3d9b7c77a23b7c9f-9721-48b6-8440-6d683ec41923Adam11005/13/2010 1:46:00 PM8624335f-ca90-4cc2-9ec3-388b7b2857e0

    3849b2a2-37fd-4886-95f0-7fd61487e6222e9fe800-fa58-4b1f-b55e-52ea7e7705239:10 AM11005/13/2010 1:46:00 PM8624335f-ca90-4cc2-9ec3-388b7b2857e0

    589fae6d-f5c2-4858-99d2-f87c3fc14b75c31a5c91-7429-4933-b2da-f73a036505b1Factory 211005/13/2010 1:46:00 PM8624335f-ca90-4cc2-9ec3-388b7b2857e0

    c1b47cc6-3aff-4cd9-8996-838326e9070da23b7c9f-9721-48b6-8440-6d683ec41923John Dobbs11005/13/2010 10:41:00 AMed80718e-157a-4970-8a79-c7df29083b1f

    be368f4b-0481-4b85-a71f-ce3621379d59c31a5c91-7429-4933-b2da-f73a036505b1Team-Max Gear11005/13/2010 10:41:00 AMed80718e-157a-4970-8a79-c7df29083b1f

    45a341d3-6e7d-496c-9487-7a65fffb8c4a52e94064-b993-46ab-aa3f-3a9f42f8f4bd5/9011005/13/2010 10:41:00 AMed80718e-157a-4970-8a79-c7df29083b1f

    d589faca-f98f-4d03-991f-3bfe48917e752e9fe800-fa58-4b1f-b55e-52ea7e7705239:101011005/13/2010 10:41:00 AMed80718e-157a-4970-8a79-c7df29083b1f

    acogswell,

    you can download a...

  • RE: SQL to manipulate rows of data

    It would be much easier if you provided table scripts and sample data. Can the project be in the table more that twice? If so, how should that...

  • RE: Duplicate key issue

    You said that you were trying to create a unique index on date. In order to do that, you can only have one date. What were you looking...

  • RE: Duplicate key issue

    The reason for the duplicates has to do with the join. It is returning every date and then just finding the previous time. Try this

    declare @sp-2...

  • RE: Save details of who deleted data from a table

    you can also use the output clause if the data is accessed through stored procedures. It would have to be added to each proc where the data is modified...

  • RE: Different Views depending on Roles

    Henk,

    here's a starting point for you.

    -- Create and Populate Regions Table

    declare @Regions table (RegionName varchar(30) not null)

    insert into @Regions

    select 'North America' union all

    select 'Latin America' union all

    select...

Viewing 15 posts - 571 through 585 (of 668 total)