Forum Replies Created

Viewing 15 posts - 11,011 through 11,025 (of 13,469 total)

  • RE: Syntax error near select.

    VALUES SELECT

    it's one or the other, never both...

    you either insert into (columnlist) values(val1,val2,etc)

    OR

    insert into (columnlist) select val1,val2,etc from somesource.

    an extra pair of eyes always helps in these situations..trees and...

  • RE: Create exclusive lock for a period of time

    here's an example of Sergiy's suggestion:

    begin tran

    select top 1 * from mytable with (tablockx) --exclusive table lock this table to me and my transaction

    --do more stuff

    commit tran --commit the tran,...

  • RE: Issues with script for updating structures

    SET XACT_ABORT ON only works in combination with BEGIN TRAN and COMMIT TRAN.you set XACT_ABORT on just once...and that is how it works for the session, or until you explicitly...

  • RE: SQL Count Statement

    this is just a WAG, but every A.ItemCode would only have one status, right?

    don't you need a rollup by Customer of all the status?

    something like the query below, that you...

  • RE: Copy a table from a DB to another DB

    glad it worked for you; you clearly grasped the concept once you got an example.

    way to go.

  • RE: Linked Servers: SQL Native vs OLE DB Provider

    wouldn't problems with distributed transactions be because the "Distributed Transaction Coordinator" service one one or both servers are not running / on manual start instead of automatic?

  • RE: Linked Servers: SQL Native vs OLE DB Provider

    ok i learned i can alias a linked server, excellent...

    but even though i explicitly said to use a SQLOLEDB provider, when i look as sys.servers, SQLNCLI is being used, as...

  • RE: Linked Servers: SQL Native vs OLE DB Provider

    as i understand it, when a linked server is created between two 2005/08 servers, the linked server will always use the native client SQLNCLI provider instead of SQLOLEDB; if you...

  • RE: SQL Count Statement

    sorry bumble-read your post...my dyslexia kicked in and i thought i only saw CASE WHEN A.destroyed = 0 as the first case condition.

  • RE: SQL Count Statement

    add these columns to your SQL:

    SUM(CASE WHEN A.destroyed = 0 AND A.Retrieved = 0 THEN 1 ELSE 0 END) AS INCOUNT,

    SUM(CASE WHEN A.destroyed = 0 AND A.Retrieved = 1 THEN...

  • RE: Updating Null Values In A Table

    you'll want to use the metadata to generate the scripts for you;

    something like this:

    SELECT

    'UPDATE ' + SYSOBJECTS.NAME + ' SET ' + SYSCOLUMNS.NAME +...

  • RE: Copy a table from a DB to another DB

    brennendeliebe05 (6/9/2009)


    Hello everybody;

    I am here again, I want to copy a table Time.dbo from my DB WorksBI to a DB BusinessIntelligence, both are int he same machine and server.

    can help...

  • RE: Search for one string inside another.

    i believe you might be looking for the behavior of a full text index.

    With a full text index, you can do WHERE CONTAINS(columnname,'AB'), and it only does "whole word" matching,...

  • RE: SQL2005 database creation script

    there's a lot of ways to do this;

    the most basic is simply 3 words: CREATE DATABASE [WHATEVER], where whatever is the database name. when you do that, a copy of...

  • RE: buld a rule with Numeric chars only

    thanks everyone; RBarryYoung made the light go on when he said "escape" the second minus sign.

    Lynn's example works, as well as using a different rule, which in turn uses...

Viewing 15 posts - 11,011 through 11,025 (of 13,469 total)