Forum Replies Created

Viewing 15 posts - 151 through 165 (of 238 total)

  • RE: IsObject Function in SQL?

    IF <condition>

    <code block>

    ELSE

    <another code block>

    where <code block> is either one statement or block as below:

    BEGIN

    <some code>

    END

  • RE: This View has the Flu

    Greg, anybody can drop a temp table as long as that user can see it. Of course, you should use #tbl, not ##tbl. By using ## you would make it...

  • RE: Delete statement taking a LONG TIME

    In addition to everything said so far (use index!), check if you have foreign keys pointing to this table from other tables or if there are DELETE triggers on the...

  • RE: This View has the Flu

    If you really need to keep the view, in your stored procedure create a temp table, insert into that table by selecting from the view, then do your joins against...

  • RE: Finding all possible combinations

    Of course, it is possible to avoid cursors. However I cannot figure out how you built the second table. Could you be more specific? What was the pattern?

  • RE: Copying Metadata (Tables,Views,etc) definitions

    From the Enterprise Manager, selct the database desired, click on Tools, then Generate SQL Scripts. You will see from there.

  • RE: IsObject Function in SQL?

    IF EXISTS( SELECT 1 FROM sysobjects WHERE name = 'table_name' AND type = 'U' ) ...

    Type 'U' is for User-defined table.

    Alternatively, you could use the SCHEMA object.

    Edited by - mromm...

  • RE: OUTPUT as Text File

    There are several ways. The best from the perfomance viewpoint is to use bcp utility. If you need to call it from a stored procedure, then execute xp_cmdshell 'bcp...'....

  • RE: Steps to alleviate high sqlservr memory uage

    To set the memory configuration values for SQL Server right-click on the server in EM, go to Properties and open the Memory tab. You'll see the options there.

  • RE: Linked Servers

    I have not done it but may be

    @server=123.456.789.012:9876

    where 123.456.789.012 is the IP and 9876 is the port number?

  • RE: SELECT and CASE

    I know you can use CASE in SELECT, WHERE, ORDER BY and possibly HAVING clauses. The rule is the same as with other operators like +, -, etc. I think...

  • RE: Preferred method error handling in SP ??

    IF @@ERROR should be placed after EACH statement involving changes to the database. If your error handling practice is consistent and correct, it will work well. I am talking from...

  • RE: Estimating Table size

    Do not forget that each row has an overhead of about four bytes (forgot the exact number). Also, if you have indexes, add those up.

    Some tools (ERwin is one) can...

  • RE: Count off when using distinct and group by

    DISTINCT in the second query might be causing the difference.

    Edited by - mromm on 01/17/2003 6:06:37 PM

  • RE: Another Audit Trigger

    Here is what you actually need to be using in a trigger:

    IF UPDATED( ColumnName ) ...

Viewing 15 posts - 151 through 165 (of 238 total)