Forum Replies Created

Viewing 15 posts - 4,846 through 4,860 (of 7,613 total)

  • RE: Help Needed in Performance Tuning

    The most critical element for performance is the best clustered index on every table. That is rarely an identity column.

    Therefore, the first thing you need to do is review...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: T-SQL MDF & LDF size for spreadsheet

    Jeff Moden (8/28/2015)


    ScottPletcher (8/28/2015)


    Jeff Moden (8/28/2015)


    Why not just do a [font="Courier New"]SELECT SizeMB = Size/128.0, * FROM sys.Master_Files [/font]and call it a day?

    I thought sys.master_files was not always kept current,...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: T-SQL MDF & LDF size for spreadsheet

    Jeff Moden (8/28/2015)


    Why not just do a [font="Courier New"]SELECT SizeMB = Size/128.0, * FROM sys.Master_Files [/font]and call it a day?

    I thought sys.master_files was not always kept current, particularly for tempdb.

    As...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: General question concerning Users and allowing SQL queries on a database

    Jeff Moden (8/28/2015)


    ScottPletcher (8/28/2015)


    The point is to run a business, not have a perfect environment for the db itself.

    Yes, much care needs to be taken before allowing anyone to run...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: T-SQL MDF & LDF size for spreadsheet

    IF OBJECT_ID('tempdb.dbo.#db_sizes') IS NOT NULL

    DROP TABLE #db_sizes

    CREATE TABLE #db_sizes (

    db_name varchar(100) NOT NULL,

    data_size_kb bigint NULL,

    ...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Cursor function and drop user/logon

    DECLARE @sqlVersion smallint;

    DECLARE @UserName nvarchar(100);

    SELECT @sqlVersion = LEFT(ProductVersion, CHARINDEX('.', ProductVersion) - 1)

    FROM (

    SELECT CAST(SERVERPROPERTY('ProductVersion') AS varchar(30)) AS ProductVersion

    ) AS system_value

    --get all user/login names that need removed...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Update statement: use the in clause or run simple update 500 times

    Look at the query plan, and see if it is scanning the clustered index or doing keyed lookups by joining to a table of constants. If it's a scan,...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Granting Explicit View Definition Permissions on Stored Procedure to dbo

    Maybe you could create a dummy user in the db, have the main user EXECUTE AS that user to give him/herself permission, then REVERT back to their own id for...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: General question concerning Users and allowing SQL queries on a database

    Ed Wagner (8/28/2015)


    Scott, I agree with you that the point is to run a business. You raise a good point about perspective. It may be that cutting off...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: General question concerning Users and allowing SQL queries on a database

    The point is to run a business, not have a perfect environment for the db itself.

    Yes, much care needs to be taken before allowing anyone to run ad-hoc queries. ...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Execute procedure in procedure?

    Lowell (8/28/2015)


    my example i provided made sure the valuewas converted to date type. As Luis pointed out, converting the date to a string in this format:2015-04-01 is now ten characters,...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Execute procedure in procedure?

    aleksandra 81219 (8/28/2015)


    Ok, know what was wrong with executing but data is also not proper :doze:

    I put some PRINT commands, look at this

    WeeksOnStart

    20150406,20150401

    val_in_cursor

    2015-04-06

    Warning: Null value is eliminated by...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Syntax Errors when Re-Creating Procedure

    Yes, if I had done the synonym names in the correct order :-D. I think I got them backwards in the script:

    Edit: That is, after you run this code:

    CREATE...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Syntax Errors when Re-Creating Procedure

    Nah, I was thinking of something like this to generate the commands to run. If you want, you could even actually run the code instead of just generating it.

    DECLARE...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: How can I group near duplicate records under a new common field?

    To me it seems fairly easy to match single rows. Maybe you can just output those matches to a table and then consolidate the like ids using that result.

    SELECT...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 15 posts - 4,846 through 4,860 (of 7,613 total)