Forum Replies Created

Viewing 15 posts - 5,746 through 5,760 (of 7,613 total)

  • RE: Openquery running very slow

    SQL will have to pull back all rows, then apply the WHERE conditions.

    You need to add the relevant WHERE conditions:

    WHERE oq.calldate > getdate() -1

    AND oq.duration > ''00:00:20'''

    to the remote query...

    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: tempdb log 75GB

    Oldest active transaction:

    SPID (server process ID): 149

    UID (user ID) : -1

    Name : user_transaction

    LSN : (3978:123016:460)

    Start time : Sep 29 2014 11:37:23:380AM

    To be sure of the...

    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: Why is my query wrong?

    If it's varchar, best would be to test it as varchar, thus not converting the column ... but that is only safe if all values are consistently left-padded with zero(s).

    Either...

    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: having trouble changing varchar to datetime

    Format 'YYYYMMDD hh:mm' is always accurately translated in SQL Server.

    Therefore, you need just two STUFFs:

    SELECT

    varchar_data AS original_string,

    CAST(STUFF(STUFF(varchar_data, 9, 0, ' '),...

    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: Auto incrementing alphanumeric

    True, if they actually are using SQL 2012. Sometimes you can't be sure :-D.

    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: Remove non alpha chars from a column

    The original version I wrote of this was in 2006 for Experts Exchange, and it was to strip nonnumeric chars (although of course the basic idea is the same):

    http://www.experts-exchange.com/Database/MS-SQL-Server/Q_21957163.html

    Of course...

    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: Help avoiding temp table with string of IDs passed into stored procedure

    Can we assume the large tables have indexes keyed on the IDs that are being passed in?

    If so, and the IDs are in a (fairly) tight range, you could also...

    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: Auto incrementing alphanumeric

    --Probably easiest would be to put the control values into a separate table, and if necessary use exclusive locks on that table when seeding that table.

    CREATE TABLE dbo.control_table (

    ...

    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: Is Alter database minimally logged in bulk recovery mode?

    No, changing the column size requires full logging for whatever logging it needs.

    But note that increasing a varchar(nnnn) column should only change catalog data, not the data pages, so it...

    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: Is their a way to get metadata info about views

    No, because non-materialized views don't occupy data space in the db. Only the view definition is stored; the data is generated from the underlying tables when the view is...

    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: Row Size Limitation

    FWIW, my code for computing max possible row length returns a length of 11870 for that table.

    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: Row Size Limitation

    Yes. Honestly, it's because that's just the way SQL works.

    If a row doesn't fit, SQL will look for any (MAX) columns that are currently being stored in the row....

    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: Restore Transaction Log after RESTORE DATABASE [Cadence] WITH RECOVERY

    ross.mason 49698 (9/29/2014)


    The only way the vendor will send us our data is a full back up in the morning with logs every hour. I have resigned myself to restoring...

    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: Restore Transaction Log after RESTORE DATABASE [Cadence] WITH RECOVERY

    Another possibility might be to use a differential backup to do the forward recovery rather than applying logs, particularly if the log process is slow.

    Take a differential backup on the...

    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: Row Size Limitation

    While this will slow down processing of the value(s) somewhat, change the datatype of one (or more) of the longest columns -- [UserName_vc], [OfficeEmailAddress_vc], [HomeEmailAddress_vc] -- from nvarchar(320) to nvarchar(max)....

    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 - 5,746 through 5,760 (of 7,613 total)