Forum Replies Created

Viewing 15 posts - 2,176 through 2,190 (of 5,504 total)

  • RE: Get count for each row

    Are there any duplicates?

    If not, you could simply use

    ROW_NUMBER() OVER(ORDER BY Value) - 1

  • RE: Number of weeks between two dates

    JenMidnightDBA (1/6/2011)


    mister.magoo (1/6/2011)


    Rem70Rem (1/6/2011)


    This seems to be a good approach, but some year have 52 weeks when some other have 53.

    The DATEPART function has a WEEK datepart that displays the...

  • RE: trigger update and compare string !?

    christophe.bernard 47659 (1/6/2011)


    Hi,

    thanks you so much for your sample now i understand that we can add a relation between the table deleted and inserted ..

    Sorry i'm a beginner and i...

  • RE: sp_executesql

    deepikamm (1/6/2011)


    hmm

    Another advice: once you posted something, don't delete or replace it by a comment like you just did. Stick to what you posted. Deleting posts is not following forum...

  • RE: sp_executesql

    deepikamm (1/6/2011)


    actually i posted it in different forum..but i didnt get a reply..dats y posted here.

    You posted about an hour ago on the other thread.

    I strongly recommend to lower...

  • RE: sp_executesql

    deepikamm (1/6/2011)


    thank u ..simple and clear explanation.

    consider this,

    Original query

    update workmgmtplan with(rowlock) set IsWebPlannerTracked=1 where planid=@WMPID

    update workmgmtplan with(rowlock) set IsWebPlannerTracked=1 where planid in

    (select workmgmtplanid from workmgmtlinkedplans with(nolock) where linkedworkmgmtplanid=@WMPID)...

  • RE: parameters to SP to Insert/Update

    If you're using SS2K8 (as indicated by the forum selected), you could pass the parameter using a table variable. That would avoid the additional overhead caused by XML tags.

  • RE: sp_executesql

    Henrico Bekker (1/6/2011)


    deepikamm (1/6/2011)


    what is the major difference between EXEC and sp_executesql?

    they are the same....

    Dave explains is very nicely...

    http://blog.sqlauthority.com/2007/09/13/sql-server-difference-between-exec-and-execute-vs-exec-use-execexecute-for-sp-always/

    No, both are different. And the link you provided shows the difference...

  • RE: To manage tables

    That's not how auto-incrementing works.

    Usually, auto-incrementing is used to create a unique number to refernce that in another table. If you renumber your values, you'd change the references.

    Why do you...

  • RE: Annoying problem with XQuery

    Something like this (assuming you're using SS2K5 or above)?

    DECLARE @xml XML

    SELECT @xml='<Root>

    <Data>

    <Item ID="1" AdditionalInfo="Some info">

    <SubItem ID="1">1</SubItem>

    <SubItem ID="2">2</SubItem>

    <SubItem ID="3">3</SubItem>

    </Item>

    <Item ID="2" AdditionalInfo="Some info">

    <SubItem ID="1">1</SubItem>

    <SubItem ID="2">2</SubItem>

    </Item>

    </Data>

    </Root>'

    SELECT

    y.value('@ID[1]','INT') AS SubItemId,

    y.value('.','INT') AS SubItemValue,

    c.value('@ID[1]','INT') AS ItemId,

    c.value('@AdditionalInfo[1]','varchar(30)') AS...

  • RE: Getting a mail when a DB is created

    franck.maton (1/6/2011)


    Thanks for fast reply !

    If I use a job, I'll get a mail every day even if no DB was created, right ?

    The purpose is to get a mail...

  • RE: Problem with top record

    hoanglong88i (1/6/2011)


    Oh, Lutz, you're master. So many things to learn, I'm taking time on them. By the way, how to get the exact time when executing a query (to compare...

  • RE: Getting a mail when a DB is created

    To slightly change Henricos script to exclude tempdb:

    SELECT name FROM sys.databases

    WHERE create_date > (GETDATE() -1)

    AND name <>'tempdb'

  • RE: Interview

    @ITJITS:

    I first thought it was WayneS who replied due the avatar.

    May I kindly ask you to change it?

    Kinda confusing...

  • RE: How do you change the width of a displayed column?

    C3PO-594572 (1/5/2011)


    SQL Server is so inferior to Oracle its unbelievable!

    Spam. Reported. (Not because of the message. Because of the signature. ;-))

Viewing 15 posts - 2,176 through 2,190 (of 5,504 total)