Forum Replies Created

Viewing 15 posts - 5,101 through 5,115 (of 7,191 total)

  • RE: Dynamically checking rows in a table for data changes in SQL

    I see what the issue is here, but I havn't got time to give it much consideration at the moment. The issue is that you have the same person...

  • RE: CASE Statement to count non-nulls

    Something like this?

    SELECT

    ID,

    COALESCE(Field1-Field1+1,0)+COALESCE(Field2-Field2+1,0)+COALESCE(Field3-Field3+1,0)+COALESCE(Field4-Field4+1,0)

    FROM

    (

    SELECT 'A' AS ID,1 AS Field1,2 AS Field2,3 AS Field3,4 AS Field4 UNION

    SELECT 'B' AS ID,NULL AS Field1,2 AS Field2,3 AS Field3,NULL AS Field4 UNION

    SELECT 'C' AS ID,NULL...

  • RE: Droping the user SQL Server 2000

    Pratap

    You may find that you can't drop a user if it already owns objects. But there's a good way of finding out - try it, preferably on a test...

  • RE: Droping the user SQL Server 2000

    Pratap

    Are there any objects named MyUser.ObjectName, where MyUser is the user you want to delete? If so, consider using sp_changeobjectowner.

    John

  • RE: using a table variable.

    foxjazzG (8/30/2011)


    So table variables can only be used in cursor functions.

    Not as far as I know. What are you trying to do?

    John

  • RE: Dynamically checking rows in a table for data changes in SQL

    Possibly. It works for the sample data you supplied. Please will you supply some data for which it won't work, and I'll take a look?

    John

  • RE: Char to PLU_NUM(float)

    Sushant

    What is PLU_NUM(float)? Do you just mean float? If you need to compare numbers in a character column with numbers in a numerical column, you will need to...

  • RE: SQL 2008 R2 msdb 95.66% frag

    Reindex those tables regularly, depending on how much job, backup and maintenance plan activity you have. Here is what I do:

    -- Try this on a test server before unleashing...

  • RE: Dynamically checking rows in a table for data changes in SQL

    What is the relationship between RecNum and RecInd? I've left out RecInd in the solution below because it looks redundant.

    The first thing to do is to group by RecNum...

  • RE: sp_msforeachtable

    Or use one of the INFORMATION_SCHEMA views and avoid the need to join at all:

    SELECT TABLE_SCHEMA, TABLE_NAME

    FROM INFORMATION_SCHEMA.COLUMNS

    WHERE COLUMN_NAME = 'ItemInsertedWhen'

    John

  • RE: NoLock Hint on a Read-only database

    In that case, you have the risk that tables will be updated between when your SELECT statement starts and when it finishes, possibly causing dirty reads. Using NOLOCK may...

  • RE: Derived Columns in alphabetical order

    Henk

    I don't know of any way to change the order in which the derived columns are displayed. However, I can't think of any reason why it would be important...

  • RE: Help to identify the user database that originated the Insert

    You can use CURRENT_USER to get the name of the user doing the insert, and then you can look up that user in sys.database_principals to find the default schema for...

  • RE: Moving files

    Data_God (8/25/2011)


    I got this one wrong but only after I tried using the script below on my SQL Server 2008 R2 environment.

    Could someone explain why the script below allows...

  • RE: Want a solution on cursor problem

    This problem is not related to just presentation.

    Please will you expand on that? What else is it related to?

    And i m not having knowledge about VB Macro in...

Viewing 15 posts - 5,101 through 5,115 (of 7,191 total)