Forum Replies Created

Viewing 15 posts - 5,866 through 5,880 (of 6,036 total)

  • RE: select into structure

    SELECT *

    INTO ...

    FROM ...

    There is F1 key on your keyboard. It calls BOL. It's really useful in case of syntax questions.

  • RE: Trigger question - If Updated

    There are tables inserted and deleted to indicate in which rows there are changed values.

    Of course, if you are trying to set value = 3 where it was 3 before...

  • RE: Lowest cost in a record

    Actually yes.

    There are 2 issues in your approach:

    1. You are doing full updates even if nothing changed in the table;

    2. Data in your "updated" column is inconsistant with the rest...

  • RE: Composite key with identity column...

    It's much easier to have IDENTITY column.

  • RE: Composite key with identity column...

    Sorry, it does not make any sence.

    What does it mean - multiple statuses can be entered into the table simultaneously?

    What's a point to apply status if it's already overwritten...

  • RE: Composite key with identity column...

    It's better to have DateChanged column with default GETDATE().

    Column            Data Type 

    Status_Code    Int                 Not null     

    Request_Id      Int                 Not Null       Key

    DateChanged   smalldatetime   Not Null       Key

    It gives you more information and stores some kind of...

  • RE: Trigger question - If Updated

    you cannot use variables within IF UPDATE. You must explicitly specify column name:

       IF Update(Consumer_info)

    If you wand to dynamically define which column to check for updates use COLUMNS_UPDATED().

  • RE: Lowest cost in a record

    Are you going to update whole table 4 times every time any single row is updated?

    Hard drives on your server not gonna stay long.

  • RE: self-mod stored proc

    Why you need to store your code as SP if you can execute it immediately when you need it?

    Are you trying to allow users to create SP from front end...

  • RE: conversion error

    Check data in your table first.

    Use

    SELECT ...

    WHERE ISDATE (WCvideoAmount) = 0

    It will show you all rows with values causing error.

  • RE: if statement in stored proc

    If there is no BEGIN ... END only the first followin statement is included into IF.

    After this 1st statement IF is considered finished and 2nd statement will be executed without...

  • RE: search between tow dates Problem

    SELECT ...

    FROM TABLE

    WHERE

    tarih >= convert(datetime, convert(int, GETDATE() - 0.5)) + convert(datetime, '1900-01-01 16:00:00')

    and

    tarihb <= convert(datetime,...

  • RE: search between tow dates Problem

    Can you explain in plain English what are you trying to achive?

    As I understand, you have table with log of calls or something and another table with tariff definitions, e.g....

  • RE: search between tow dates Problem

    Why?

    Everything is before your eyes.

    Just don't be lazy.

    SELECT ...

    FROM TABLE

    WHERE DateTimeColumn between convert(datetime, convert(int, GETDATE() - 0.5)) + convert(datetime, '1900-01-01 16:00:00') and convert(datetime, convert(int, GETDATE() - 0.5)) + convert(datetime, '1900-01-01...

  • RE: Entering duplicates in a Primary Key column

    Add year to PRIMARY KEY.

Viewing 15 posts - 5,866 through 5,880 (of 6,036 total)