Forum Replies Created

Viewing 15 posts - 31 through 45 (of 85 total)

  • RE: Help with SQL update

    Jpotucek (12/28/2012)


    My criteria is I was given a list of 1200 TS_FA_NUM values and they all have to be changed from TS_ACTIVEINACTIVE = 0 to TS_ACTIVEINACTIVE = 1

    Sounds like I...

  • RE: Help with SQL update

    Which 1200? Any 1200? Or 1200 selected on some criteria?

  • RE: NOT EXISTS - tortoise or horse ?

    karthik M (12/26/2012)


    All,

    I have often worked on the below requirement.

    There are two tables and fetch the record from TableA which doesn't exists in TableB.

    I use NOTEXISTS or else I use...

  • RE: How to get a count of duplicate records

    🙂

  • RE: How to get a count of duplicate records

    jillk (12/19/2012)


    I have a query that returns a duplicate account listing:

    SELECT Account

    FROM Account_Table

    WHERE Account IN

    (

    SELECT Account

    FROM Account_Table

    GROUP BY Account

    ...

  • RE: OR in JOIN condition

    Yes, that will make for a slow-running query. Try writing two separate queries, one to check for each condition, then UNION ALL to combine the records.

  • RE: Importing Text files

    My advice would be to stick with SSIS. For someone with an Access background, SSIS would be a much friendlier road to travel than bcp. Far simpler to map your...

  • RE: Which table join should I use

    ron.grace (12/10/2012)


    Roland,

    That worked a treat, many thanks, I was obviously over complicating things

    LOL! I've outsmarted myself many times, I know what you mean!

  • RE: Which table join should I use

    ron.grace (12/10/2012)


    I've got 2 tables Order & Despatch and I'm trying to add some keys to the tables. The OrderNo field is a primary key in Order and a foreign...

  • RE: Alter statement

    ALTER TABLE

    ADD CONSTRAINT [constraint_name] DEFAULT [default value] FOR [column]

  • RE: Dynamic SQL variable questions

    You bet. An extra pair of eyes never hurts...that's why I love code reviews!

  • RE: Dynamic SQL variable questions

    Take away the extra apostrophes before and after the variable:

    SET @Query = N'

    INSERT INTO dev.dbo.ServerDetails ([MachineName] , [ServerName], [Instance], [Edition], [ProductLevel], [ProductVersion],[COLLATION], [IsClustered], [IsFullTextInstalled] , [IsIntegratedSecurityOnly])

    SELECT * FROM OPENROWSET(''SQLNCLI'', ''Server='...

  • RE: Defaults

    Hugo Kornelis (11/15/2012)


    Roland Alexander STL (11/15/2012)


    No, I don't believe I'm confused. Have a look at the list at http://msdn.microsoft.com/en-us/library/ms143729.aspx where you'll find this entry:

    Use of DEFAULT keyword as...

  • RE: Defaults

    Hugo Kornelis (11/15/2012)


    Roland Alexander STL (11/15/2012)


    We ought to make note here that DEFAULT has been deprecated in an unspecified future version of SQL Server, so don't get too attached to...

  • RE: Defaults

    Hugo Kornelis (11/15/2012)


    Roland Alexander STL (11/15/2012)


    We ought to make note here that DEFAULT has been deprecated in an unspecified future version of SQL Server, so don't get too attached to...

Viewing 15 posts - 31 through 45 (of 85 total)