Forum Replies Created

Viewing 15 posts - 31 through 45 (of 51 total)

  • RE: On Using JOINS in FROM clause

    Thanks Grant for the answers.

    Grant Fritchey (1/22/2009)


    If I understand the question, yes, you can join one table to more than one other table like this:

    SELECT...

    FROM Table1 t1

    JOIN Table2...

  • RE: Offset in the date-time inserted while insertion

    You could try this:

    select convert(datetime,convert(varchar(10),getdate(),101))

    When you use smalldatetime, seconds are rounded off to the nearest minute.

  • RE: Automate comments in stored procedure? (e.g., author, modified date...)

    peterzeke (1/22/2009)


    Although I thought I had once come across something that helped add comments automatically when a stored procedure is altered, I've come to conclude that I'm simply mixed-up-in-the-head on...

  • RE: Automate comments in stored procedure? (e.g., author, modified date...)

    I'm not very clear on this. As I know, VSS and sql code is related via macros. In VSS the macros are defined.

    For example: $ID, to say when the...

  • RE: converting from varchar to int/decimal

    Can you give more info like what is the size of total, the exact error message, sample data for which the error is thrown..

  • RE: converting from varchar to int/decimal

    Error is because 0.116 is a float value and you are trying to convert it to int. Convert it to float.

    declare @total varchar(10)

    set @total = '0.116'

    select convert(float,@total)

  • RE: insert into table criteria

    From your code, the first IF statement says if table1 has records, insert them into table2 and truncate table1.

    For example: table1 - has records. Then at the end of...

  • RE: Four Tables, One Common Column Schema

    Grant Fritchey (1/16/2009)


    Actually, I don't think you laid that out correct.

    Account

    AccountID, Desc

    1, AccountA

    2, AccountB

    Course

    CourseID,AccountId,Desc (you may need a unique constraint on the name, but then it might make a better...

  • RE: Four Tables, One Common Column Schema

    Grant Fritchey (1/16/2009)


    You could make the Course and Unit pk into a compound PK that includes AccountId. Then the UnitCourse table will have an added column used as a constraint...

  • RE: Comparing procedures on different servers

    select name, type from sys.procedures

    where name not in (select name from FIVER.AHOG.dbo.sys.procedures)

    order by name

    'from' is missing in the sub-query in WHERE clause..

  • RE: update problem

    Did you mean to say you are trying to refer a table mentioned in your UPDATE statement in your SELECT statement? How is that possible?

    pat (1/14/2009)


    if (EXISTS(select name from tablename...

  • RE: Use SQL Server to insert data in Pervasive database

    Have you also tried

    insert into [testdb].[testdb].[dbo].[Part Master] (PartID) values ('test');

    What was the error?

  • RE: Cascade Update/Delete...:)

    Krishna_DBA (1/12/2009)


    If a customer changes the card details, I would like that to be updated on the carddetails table as well? How could I do that?

    If a customer changes the...

  • RE: How I can sort this

    Its because in the case statement all the return values must be of the same datatype.

  • RE: sql query help

    Suppose 'user_id' is the primary key in users table, and 'user_id' is the foreign key in the customers table,

    a simple query will do the task for you

    SELECT cust.full_name

    FROM...

Viewing 15 posts - 31 through 45 (of 51 total)