Forum Replies Created

Viewing 15 posts - 61 through 75 (of 267 total)

  • RE: single sql statement needed

    If you are running SQL 2K then you can use a user defined function to concatenate the data:

    
    
    CREATE function [dbo].fn_CreateString(id int)

    RETURNS varchar(4000)
    AS

    BEGIN

    declare...
  • RE: SQL Problem with case statement

    Should this line:

    CASE WHEN Answers.ANS_DATE <= Questions.QT_ANS_DUE_DATE THEN 'Y' ELSE 'N' END AS AnswerOnTime,

    be

    AnswerOnTime = CASE WHEN Answers.ANS_DATE <= Questions.QT_ANS_DUE_DATE THEN 'Y' ELSE 'N' END,

    Jeremy

  • RE: How to convert a string to a numeric

    Have a look at CAST and CONVERT eg

    declare @variable varchar(10)

    set @variable = '123'

    select cast(@variable as int)

    Jeremy

  • RE: Complicated SQL Query

    I'm not saying that this is the best way of doing it but here's an idea.

    create table #output

    (file_name varchar(25), ref_no varchar(25), container_no varchar(25) )

    declare @file_no varchar(25), @ref_no varchar(25), @container_no varchar(25)

    ,...

  • RE: Creating multiple copies of a SQL Database

    I guess one way would be to restore the original database to a database with a new name.

    You can do this in TSQL statements (I'm not sure of...

  • RE: Database size doesnt decrease

    Dropping a table only increases the amount of free space in the database.

    If you want to reduce the amount of allocated space to a database you need to shrink the...

  • RE: Sorting Columns

    Vladan,

    I wanted to check existing data because of a problem we had with the production system.

    We solved it in the end by manually rearranging the columns in excel and doing...

  • RE: Exclude from transaction

    The question was not about adjusting the transaction but if you write something to table in a separate database whether that get rolls back if your transaction in the current...

  • RE: Exclude from transaction

    Do transactions persist across databases?

    If not then you might be able to store your audit details in a separate table.

    If the do then I think you are stuck.

    Jeremy

  • RE: Sorting Columns

    It is something that should have been done on the client at the time they entered the data but hindsight is a wonderful thing.

    I need to do this within SQL...

  • RE: Can this be done without a cursor?

    Have a look at this, it should give you an idea:

    http://www.sqlservercentral.com/faq/viewfaqanswer.asp?faqid=206

    If you are using SQL 2000 you can create a User Defined Function to return this data.

    Jeremy

  • RE: Error handling

    @@error is very useful in dealing with errors within a stored procedure.

    However, I have found that if there is an error within a SP (whehter or not it...

  • RE: Creating pivot table view

    It's also in BOL. Search for "cross-tab reports".

    Jeremy

    PS Antares - you must had told Bill G how to do it.

  • RE: Deadlocking Problems

    Vladan,

    Thanks.

    I've read about phantom data but I think there is very little risk in this situation.

    Jeremy

  • RE: Deadlocking Problems

    I want to explicitly change it back but what is it best to change it to?

    Jeremy

Viewing 15 posts - 61 through 75 (of 267 total)