Forum Replies Created

Viewing 14 posts - 1 through 14 (of 14 total)

  • RE: Date Query Help

    Kyle:

    Try

    select datepart(d,t1.dt), min(t1.dt) from crudefilo as t1

    inner join crudefilo as t2 on t1.dt=t2.dt

    Where t1.dt > DatePart(Day, DateAdd(day,-30,GetDate())) 

    group by datepart(d,t1.dt)

    You might choose a different value to return as the base...

  • RE: Appropriate use of Read Uncommitted?

    Yes READ UNCOMMITTED would seem to do as you ask

    BOL has this to say

    READ UNCOMMITTED

    Implements dirty read, or isolation level 0 locking, which means that no shared locks are...

  • RE: Could use some help with an INSERT

    The null message may be because the CONFIG field is a primary key to the _SMDBA_._CONFIG_ table and thus cannot be null. When you insert into the _SMDBA_._CONFIG_  the value of...

  • RE: facing a 50% line limit when loading text file

    If the wizard always loads 50% of the file no matter the size. Concatenate the file onto itself. so your 370K file becomes 740K rows 50% of that will be the whole thing...

  • RE: How to Transforming Data

    Try an aggregate statement using the Group By statement BOL will be great help figuring out how to use it.

  • RE: Output results based on row comparison?

    Maybe I'm a little dense, but I just can't see where your example dataset shows the linkage between part 7000-B20 and 7000-B30

  • RE: Alter table name

    Guess what I was trying to tell you without saying it is thats not really a good to do it.

    but in case that's how you really want to go....

    Declare @filename...

  • RE: Alter table name

    If you have a inventory database with the following structure

    InvID int, qty real....

    Make a warehouse type table that dimensions this information by date

    so the new table will be InventoryByDate

    RecordDate datetime,...

  • RE: Update a table and display value

    I'm a little confused by the terminology of the question. As written above to actually return the value of intcount to a process outside the statement a third statement would be needed:

        ...

  • RE: How does getdate() and IS NOT NULL affects the query performance?

    I would recomend you trace the script yourself with and without the "getdate" and "is not null" statements. There may be many other factors that affect the performance of a...

  • RE: Formatting a date for oracle to read

    try:

    SELECT REPLACE(CONVERT(varchar(11),@theDate,113)' ','-')

    06/17/2004

    becomes

    17-Jun-2004

    much simpler than the function above

     

  • RE: Assign multiple variables in a Case Statement

    Business logic changes, hopefully with the business. Instead of hard coding the logic create a table that has the values you want to assign using FullOrderNumber as the primary key and...

  • RE: Optimizing Stored Procedure

    make sure to check out index usage in the execution plan. If the optimizer can't find an appropriate index to make the query plan it'll be forced to do a...

  • RE: Use table name in a variable?

    Try using Dynamic SQL

    Define a variable @dsql as varchar(1000)

    On the inside of your cursor loop

    SET @dsql = 'INSERT INTO ' + @Code_tab + ' VALUES (@New_code, @seq_num,...

Viewing 14 posts - 1 through 14 (of 14 total)