Forum Replies Created

Viewing 14 posts - 76 through 89 (of 89 total)

  • RE: Performance problems while Looping

    You can add constraints to each table and them build a view to union the tables together. The end effect should be similar to creating a single table. ...

  • RE: Business Date Calculation

    How about:

    SELECT rt.account_id, rt.account_status, DATEDIFF(DAY,rt.status_creation_datetime,GETDATE())-COUNT(*)

    FROM Result_Table rt, Calendar_Table ct

    WHERE ct.DateField BETWEEN rt.status_creation_datetime AND GETDATE()

    GROUP BY rt.account_id, rt.account_status, rt.status_creation_datetime

    Brian

  • RE: Select @@IDENTITY as id returns NULL

    IDENT_CURRENT returns the current identity value for the given table, regardless of scope or session. If you need to get the identity value you just inserted, you will want...

  • RE: Parsing a Text Field into Columns

    How many records are in your table A? You can write a loop to take each value and using patindex and substring, break it into smaller chuncks of data....

  • RE: get inserted rows count

    How about an OUTPUT parameter on the procedure? You can set @Output=@@rowcount after the insert statement.

  • RE: How to embed if logic into a query

    Looks like the same thing to me. Your query just has a few additional clauses.

  • RE: How to embed if logic into a query

    Try this.

    select *

    from <table>

    where creator_id=(select uid from sysusers where name=user)

    or usage_code=0 -- where 0 means it is not private

  • RE: Backing up SQL

    Is there any software installed on the F drive? If so, you have some additional things to think about. Are you going to delete the existing partition and...

  • RE: Slow SQL Server

    Try running SQL Profiler and then access the problem pages. It would be best to do this in a test environment so you can limit the activity of the...

  • RE: Count records returned from a sp

    Set the output parameter = @@ROWCOUNT after you select the result set. If you do multiple select statements, you would set output parameter=(output parameter)+@@ROWCOUNT.

    Select * from Employee inner join...

  • RE: Connecting remote sqlserver 2K via EM problem

    Are you connecting via dialup? In any case, you would assume EM would only need to query sysdatabases to return the list of databases. However, if you run...

  • RE: After 7->2000 move, queries peg CPU

    When we upgraded from 7.0 to 2000 we had a couple of queries that exibited the same problem. We have a field in our database that only has integer...

  • RE: Timestamp and Adding a column !

    No. You can alter the table structure without affecting the timestamp columns.

  • RE: Multiple variable concatenation

    Would this work for you?

    It builds and executes the following statement:

    select col1,col2,col3.....,col487,col488,col499..... from table1 t1, table2 t2.... where t1.col1=t2.col1 and t1.col2=t2.col2.... and t1.col487=t2.col488 and t1.col488=t2.col488.....

    create table #temp (a...

Viewing 14 posts - 76 through 89 (of 89 total)