Forum Replies Created

Viewing 15 posts - 5,236 through 5,250 (of 7,619 total)

  • RE: Where IN () Clause

    Just to be sure to get the best lookup, insert the individual values in the IN list into a table uniquely clustered on the value. Then, again just to...

    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: Database restore leaves the database with no dbo

    Sorry, I'm a DBA, so I'm highly technical on those terms ;-).

    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: Database restore leaves the database with no dbo

    real.forte 18467 (4/3/2015)


    Thank you very much for the information. Here is what I ended up doing:

    1. I fetched the SID of the dbo on the original server

    2. Provided I...

    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: Stored prosedur Set Value Column

    CREATE PROCEDURE DvzkuruCek

    @T1 DATETIME = '20150202' --'YYYYMMDD' is always interpreted correctly

    AS

    SET NOCOUNT ON;

    DECLARE

    @KUR INT;

    SELECT TOP (1) @KUR = RATES1

    FROM dbo.L_DAILYEXCHANGES

    WHERE EDATE= @T1 AND CRTYPE...

    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: Database restore leaves the database with no dbo

    real.forte 18467 (4/2/2015)


    So, what you are saying is that, when I restore a database having an SID that does not match any account in the server I restore it to,...

    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: Database restore leaves the database with no dbo

    real.forte 18467 (4/2/2015)


    Well,

    The account I perform my restore from is dbcreator and the restore operation itself works well. It is just that it leaves the database with no dbo,...

    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: Database restore leaves the database with no dbo

    You don't have to be a full sysadmin, necessarily, but you do need the proper authority/permissions.

    The dbcreator role should handle the restore.

    You'd need to be db_owner to issue...

    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: Database restore leaves the database with no dbo

    Immediately after every restore of that db, run this command:

    EXEC sp_change_users_login 'UPDATE_ONE', 'nSpekUser', 'nSpekUser'

    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: Converting getdate

    djj (4/2/2015)

    If you have a VARCHAR I would suggest converting to a date format of some sort before compare.

    A bad idea. Not necessary and could potentially force...

    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: Problem with creating a Index on a temp table

    GilaMonster (4/2/2015)


    ScottPletcher (4/2/2015)


    You can't name the indexes yourself unless you insure they're unique. It's a pain, but using dynamic SQL you can do it.

    That's the case for constraints, not...

    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: Problem with creating a Index on a temp table

    dwilliscp (4/1/2015)


    I have not run across a problem.. yet.. but does this problem also cover indexes on temp tables? Thus is there any issue with me doing the following?

    CREATE 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: Converting getdate

    Use 'YYYYMMDD', since that format always works correctly in SQL Server; YYYY-MM-DD doesn't work correctly if the local settings are for dmy instead of mdy.

    WHERE table_column = CONVERT(varchar(8), GETDATE(), 112)

    Never...

    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: Index alignment in partitioning

    What's critical is to get the best clustering. If, to do that, you need to change the PK to match the clustering key, then you really need to do...

    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: Deadlock involving query against sys.tables

    Sioban Krzywicki (4/1/2015)


    ScottPletcher (4/1/2015)


    You can try to get SQL to make the ALTER the task that SQL kills if a deadlock occurs, but I've found it's not 100% effective.

    SET DEADLOCK_PRIORITY...

    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: Index alignment in partitioning

    Matthew Darwin (4/1/2015)


    ScottPletcher (4/1/2015)


    All excellent points.

    Keep in mind though:

    1) You can leave the PK solely on the SmsID column and still cluster the table by ( date, id...

    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,236 through 5,250 (of 7,619 total)