Forum Replies Created

Viewing 15 posts - 14,041 through 14,055 (of 14,953 total)

  • RE: passing parameters to function w/ inner join

    How accurate do you need this to be?

    If a few miles off one way or the other is okay, the way I would do this is a reverse distance lookup....

  • RE: Can't connect to sqlserver 2005 express

    In that case, is the user and password in your connection string set up correctly? Does it match a valid user, who has rights to the database you're trying...

  • RE: To Cascade or not To Cascade...that is the question

    I dislike using automatic cascading deletes.

    First, they have problems with tables with more than 1 foreign key in them. For example, you can't put a cascading delete on a...

  • RE: Why my function is returning NULL value but actural code can return correct value?

    Can you post the actual create script for the function?

    The way this is written, it should return 0 instead of null. Unless there's a problem with the way the...

  • RE: see full data of type NTEXT.

    If you check the options for Query Analyzer, you'll find that it has a maximum number of characters to display per column. There's a cap on that, but I...

  • RE: Local Variable & Performance

    The existence of the variables shouldn't affect the performance directly. Assuming, of course, that they are actually needed for the proc.

    How they are used can very definitely affect performance.

  • RE: Working on Triggers

    A couple of more general points on database logging:

    Using triggers to do logging will make your database slightly slower, since the triggers have to fire for any logged transaction.

    Having log...

  • RE: Working on Triggers

    One thing you can do is:

    create trigger dbo.MyTableLog on dbo.MyTable

    after insert, update, delete

    as

    declare @TransactionID uniqueidentifier

    select @TransactionID = newid()

    if update(MyColumn1)

    insert into MyLogDatabase.dbo.MyTable (Col, Val, Act, Trans)

    select 'MyColumn1', coalesce(inserted.MyColumn1, deleted.MyColumn1, 'No Value'),

    case

    when...

  • RE: Historical prices with data gaps

    You can use something like this for your first question:

    declare @Date datetime

    select @Date = '3/28/08'

    ;with MostRecent (RetailerID, PriceDate) as

    (select id, max(date)

    from dbo.pricehistory

    where date <=...

  • RE: GREATEST and LEAST function

    I'm not sure if what you're asking for is "max" and "min". Take a look at those in Books Online and see if they will do what you need.

    If...

  • RE: Can't connect to sqlserver 2005 express

    When you installed SQL Server, what login(s) did you create? Or did you tell it to use Windows authentication only?

  • RE: Scripting CREATE statements for Indexes

    I know ApexSQL Diff can be used for that. RedGate SQL Compare can probably do it too.

    Might be a way to do it that doesn't require buying software. ...

  • RE: Data load problem.

    At first glance, I'd import into a "staging table" (a table that matches the spreadsheet). Then I'd build a final table that has the structure I really want. ...

  • RE: How to prevent insert/update trigger sequence?

    Leo Nosovsky (4/23/2008)


    It would -- as long as there is no performance hit while retrieving data from a table that has a computed column that is not persisted and not...

  • RE: Audit Table - Trigger

    Copying the table schema is simply having two copies of the table. One copy is the live table, one is the log table. The log table usually has...

Viewing 15 posts - 14,041 through 14,055 (of 14,953 total)