Forum Replies Created

Viewing 15 posts - 5,566 through 5,580 (of 15,381 total)

  • RE: Insert is Slow

    yuvipoy (3/4/2014)


    Thanks for your quick replay.

    uniqueidentifier column(with primary key (now)) has been used in table joining in current design.

    so if i remove the current primary key on uniqueidentifier, will...

  • RE: replace () not working on nvarchar(max) column

    Jack Corbett (3/4/2014)


    Can you post the code you are using. I just tested using this:

    DECLARE @data NVARCHAR(MAX) = 'EXEC Proc_gen @PsID=12, @kID=-1, @ID=3183';

    SELECT @data AS theData...

  • RE: Insert is Slow

    yuvipoy (3/4/2014)


    I am having 10 Master table with 10 million records each.

    For unique(primary key) i have use uniqueidentifier as column data type.

    While inserting more records on this table insert is...

  • RE: Database creation

    aalianebhan (3/4/2014)


    Hello.

    I would like to make a database for a university system, including "Employees , Teachers & Students" entities.

    Actually all these 3 entities have some type of same attributes ,...

  • RE: Database Triggers to prevent large DDL transactions

    A server I'm working on has a very unique situation, where user tables and production tables reside on the same database.

    However it seems that the whole basis for the issue...

  • RE: passing comma delimited string as parameter to stored proc

    bikrant.sharma (3/3/2014)


    REPLACE(@DefaultValue, ',',''',''')

    @DefaultValue = '''' + @DefaultValue + ''''

    That doesn't help with a parameter. That is why you have to parse it. Read through the responses in this thread.

  • RE: t-sql self join and use dates

    wendy elizabeth (3/3/2014)


    I read the article. I am not certain what else you are looking for. Can you point me to a post that is well written so I can...

  • RE: How to avoid using a cursor?

    EricEyster (2/28/2014)


    Try this out:

    create table inventory (

    InvID int,

    ActivityCode int,

    MovementDate datetime,

    OldLocationID int,

    NewLocationID int

    )

    select I.InvID, I.ActivityCode, I.OldLocationID ,

    sum(datediff(day,I.inDateTime, I.OutDateTime))

    from (

    select I.InvID,...

  • RE: How to avoid using a cursor?

    It seems that Lynn posted a solution very similar to mine. 😉 Nicely done sir!

  • RE: How to avoid using a cursor?

    This should work.

    with HistoryWithDates as

    (

    select InventoryItemID, NewLocationID, [DATE] as MyDate, ROW_NUMBER() over (partition by InventoryItemID order by [Date]) as RowNum

    from #history

    group by [DATE], InventoryItemID, NewLocationID

    )

    select h1.InventoryItemID, h1.NewLocationID as LocationID,...

  • RE: How do I write this Case When

    halifaxdal (2/28/2014)


    Thanks for reply, maybe I didn't make it clearer, I decided to go this way:

    ALTER PROC ddGetDevStatsByUnitStateAndYear (@Unit varchar(20), @State varchar(10), @Year int)

    AS

    IF @Year = 0

    BEGIN

    SELECT Unit =...

  • RE: Need help with writing procedure to update or append records to my table

    Hi and welcome to the forums. It is difficult to know what you are trying to do. I suspect you might want to look at MERGE.

    If that doesn't do it...

  • RE: How to avoid using a cursor?

    No you don't need to continuously quote. 😀

    This sounds like an islands and gaps issue. Take a look at this article and see if it helps.

    http://www.sqlservercentral.com/articles/T-SQL/71550/%5B/url%5D

    I am kind of swamped...

  • RE: Performance troubles

    Jake Shelton (2/28/2014)


    Hi all,

    Client site has a 2K DB with several tables each containing millions of rows, none of them have indices (yeah....I'm serious), in violation of at least one...

  • RE: Is using 0x0 faster than a 0 in a WHERE clause

    smrtstpetesmith (2/28/2014)


    I am but my results thus far are statistically insignificant...

    I would surprised if there is any difference. Throw together a few million row test table and give it a...

Viewing 15 posts - 5,566 through 5,580 (of 15,381 total)