Forum Replies Created

Viewing 15 posts - 1 through 15 (of 18 total)

  • RE: Creating tables in tempdb

    One big reason for doing this is concurrency.  If you have a large number of transactions where the same proceedure can be called multiple times in a short period of...

  • RE: Help with COUNT

    In your simple table this should provide the results you need.  Maybe somebody has a more elegant solution.

     

    SELECT

    'One EndPoint',

  • RE: help with this query please?

    Sounds like you need to do a left join to the user scores table and use ISNULL to default the missing values to 0.  Try this out and see...

  • RE: Moving tables across databases

    I don't know how it would be possible to move teh table with all data except for creating the table in the new database and then inserting the data into...

  • RE: Using a calculate column in the Where clause

    Try putting your calculation in the where clause, not the aliased column name

    Select a.order_number, a.customer, qty_in_stock = stock_calc(<param>

    From Orders a

    Where stock_calc(<param&gt

  • RE: what''''s my name?

    You can get an Id of the stored procedure by using the @@ProcID value and then quering sysobjects to get the name. 

  • RE: Management Studio (Annoying behavior)

    Do you have the latest service pack?  There was an update I think in SP2 that allowed you to create a new query window or open a new file and...

  • RE: Sql server ''''sa'''' password

    Not sure how to get it, but can you change the password using sp_password?

  • RE: Urgent Help Needed!!!!

    In order to roll back a transaction, you need to begin the query with begin transaction.  Without a begin transaction, SQL automatically commits the transaction when it is done running...

  • RE: Converting int to Date

    What does the value 1177091222608  represent?  I can see some errors in the code but not sure how to fix it.

     

    You are looking for a value of @k...

  • RE: Skip Primary Key Constraint Error

    If they are unique, can you either SELECT DISTINCT or GROUP BY to remove the duplicates?  Other options is to place the records in a temp table and only insert...

  • RE: join on 2 fields?

    Just join to the teams a second time using the AwayTeamID in the join.  You will need to alias the table to tell them apart.

     

    SELECT tblSchedule.*, HomeTeam.teamName as HomeTeam, AwayTeam.TeamName AS...

  • RE: question mark in the WHERE clause.

    Books Online mentions Parameter Markers and this sounds like it is what you are looking for. 

     

     

    From BOL for SQL Server 2000:

     

    Parameter markers are supported by the ADO, OLE DB,...

  • RE: GROUP BY

    You could write your query like this

     

    SELECT db.Server_Name, db.Database_Name, db.Size

    FROM DatabaseTable db

    JOIN (

            select server_name, max(size) as size from tableA group by server_name

           ) tbl

    ON db.Server_Name = tbl.Server_Name

    AND db.Size =...

  • RE: Urgent help on SQL Query

    How about

     

    SELECT TOP 1 ItemId,UserId,Max(EffTime) as ETime FROM ItemAuditTrail WHERE NewValue ='Matched'  GROUP BY ItemId,UserId  ORDER BY EffTime DESC

     

    This will give you the first record with the largest time value.

Viewing 15 posts - 1 through 15 (of 18 total)