Forum Replies Created

Viewing 15 posts - 526 through 540 (of 541 total)

  • RE: Set Variable

    Try creating the table and then inserting into it; this should allow you to select the values into a variable and into the table at the same time.

    But...

  • RE: Set Variable

    Try creating the table and then inserting into it; this should allow you to select the values into a variable and into the table at the same time.

    But...

  • RE: Query scheduling!!!

    You can do some cool things directly in tSQL using "WAITFOR" with "DELAY" or "TIME".

    Example below...

    use Northwind--for this example

    IF Object_ID('tempdb..##NewCategories') is not null drop table ##NewCategories

    Create Table ##NewCategories (CategoryID int,...

  • RE: db library dead !!!!

    What datatype is the column "plant_per"? That would be the first thing I'd look at with a 6.5 to 2000 conversion.

    Look at BOL for an example of problems like...

  • RE: Locking problem

    I've found that using the query hint (Nolock) helps, especially when selecting against a table locked by a transaction.

  • RE: SELECT with incrementing number

    Does it have to be incremental or just unique? If just unique, the selecting with a column newid() works beautifully.

  • RE: Sorting of 2 columns

    Actually, to produce the results:

    6 4

    6 2

    3 7

    2 3

    You actually want to sort by:

    64

    62

    37

    23

    so:

    Select * from Table

    order by cast(col1 as varchar) + cast(col2 as varchar) Desc

  • RE: DTS

    For some odd reason it seems the Wrox "SQL Server 2000 DTS" book is no longer available. I was looking for it a couple of weeks ago and couldn't...

  • RE: UpDate using T-SQL

    You can use a case statement and set the value back to itself if it doesn't fit certain criteria. An example below...

    /*--------------------------------

    Updates #Test1 with values from #Test2 only when...

  • RE: Outer join failing

    I don't know if this will work, but try to qualify the column poprj_UID as po_projects.poprj_UID.

  • RE: VBScript command-line performance question

    This may be a dumb question, but is DTS an option for you?

    Using a text file as the source and an table as the destination can be extremely fast. ...

  • RE: Question about the QA

    That's a good question. Check out BOL keyword "constraints, PRIMARY KEY" for some info on it. The gist of the matter seems to be that Primary Key's are...

  • RE: SELECT short date

    If you're not working with a datetime field you'll have to cast as datetime first.

    varchar output: Convert(varchar,cast(dteShipped as datetime),101)

    datetime output: cast(Convert(varchar,cast(dteShipped as datetime),101) as datetime)

  • RE: identity column

    Actually, it's Truncate TABLE <Table Name>, and that's definitely the way to do it. If you have any foreign keys that reference that table you'll have to drop them...

  • RE: group by optimize

    jraha's query forces the index to be used, but you may want to rethink that composite index.

    For example, tShortTerm has a one to many relationship with tLongTerm, but...

Viewing 15 posts - 526 through 540 (of 541 total)