Forum Replies Created

Viewing 15 posts - 136 through 150 (of 7,619 total)

  • Reply To: Text column is taking More time while Querying, Need to Replace DATALENGTH

    Actually "<" is NOT a safe way to check for not space.  CR and LF are both not "<" a space.

    select case when char(10) > space(1) then 'LF ' else...

    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".

  • Reply To: Does a Query Lock to the Table_Name or Table_ID

    References in SQL are to object names.  The code will resolve based on the name.

    A rename can't happen while the table is being queried, because a schema lock is in...

    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".

  • Reply To: Arithmetic overflow error converting IDENTITY to data type bigint

    I agree.  Why the "need" to jump to such a huge number?

    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".

  • Reply To: Arithmetic overflow error converting IDENTITY to data type bigint

    Correct.  You'd have to use decimal(38, 0) or some other larger value type rather than bigint.

    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".

  • Reply To: Arithmetic overflow error converting IDENTITY to data type bigint

    So you deliberately set the value so that it would get too large for a bigint ... and that seems to be your error.

    Not sure why you felt the need...

    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".

  • Reply To: Arithmetic overflow error converting IDENTITY to data type bigint

    Theoretically @@IDENTITY value could be too large for a bigint.  Hard to imagine actually using enough values to go past 19 digits, but it's theoretically possible.

    Btw, you should get @@IDENTITY...

    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".

  • Reply To: Why am I getting a "Incorrect syntax near '@tblName' error message?

    Be sure you set and are using the correct variable.  In your original code, you use "@tblName" but you never set the value of that variable.  That's why I used...

    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".

  • Reply To: Why am I getting a "Incorrect syntax near '@tblName' error message?

    You can't use a variable in a DROP TABLE statement in SQL.

    Change it to:

    SET @dropCommand = N'DROP TABLE dbo.' + @tableName

    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".

  • Reply To: 64KB and 32KB cluster size for log drives and tempdb

    SQL data files could in theory gain from 64K cluster size, since SQL often writes data in 64K chunks.

    SQL log files are different, so 32K should be just fine 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".

  • Reply To: Index Update Reports - Scans/Seeks

    If you issued an UPDATE against an empty table, the UPDATE counter would still increment.

    Maybe that's what happened?

    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".

  • Reply To: How to calculate potential IO benefits of changes

    (1) more RAM (if you have only 300GB for SQL Server)

    (2) do you (page) compress the data?

    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".

  • Reply To: Can you pass an undeclared variable to a Stored Procedure

    The @p_iType is declared in the called proc as a parameter.

    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".

  • Reply To: Searching for the Assumed Full Backup

    Correct.  How would SQL ever know you've deleted the backup file?  It doesn't know, shouldn't know and shouldn't care.

    I don't use maintenance plans (I'm a DBA, we use scripts), but...

    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".

  • Reply To: Searching for the Assumed Full Backup

    Yes, that's it, that's all that's required.   The full could have been a month (or whatever) ago for all SQL cares.  It's up to you to keep any backups you...

    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".

  • Reply To: Searching for the Assumed Full Backup

    3.  SQL doesn't "know" you've deleted the backup file.  Otherwise you could use it as a base.  SQL will assume, reasonably enough, that if you take a full backup and...

    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 - 136 through 150 (of 7,619 total)