Forum Replies Created

Viewing 15 posts - 5,851 through 5,865 (of 7,613 total)

  • RE: Mass removal ofF permissions

    Something like this should get you going pretty quickly. You can add the "documentation" part by adding a SELECT and/or PRINT to output a message about what is about...

    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: Mass removal ofF permissions

    MickyD (8/19/2014)


    ScottPletcher (8/19/2014)


    You should be able to get the spreadsheet into a table by right-clicking on the database to load it into, selecting "Tasks", then "Import Data...", and go thru...

    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: Mass removal ofF permissions

    You should be able to get the spreadsheet into a table by right-clicking on the database to load it into, selecting "Tasks", then "Import Data...", and go thru the wizard...

    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: More Efficient Way For this T-SQL Query

    My preference would be this (the "extra" parentheses are important to properly match the requirements):

    SELECT *

    FROM YourTable

    WHERE (SnapshotDate > @from AND SnapshotDate < @to)

    OR (SnapshotDate = @from...

    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: Merging two large tables (>100m Rows)

    How many rows will be added / changed between uploads / syncs?

    I suggest considering Change Tracking or some other automated method of determining changes rather than trying to do 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: Script Generator in table designer?

    The DBA's quite right, you need "WITH CHECK" explicitly specified (or allowed to default). I don't see an option in scripting to explicitly specify this (at least through 2008...

    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: Decrease query execution time to retrieve records from huge table

    Grant Fritchey (8/16/2014)


    ScottPletcher (8/15/2014)


    What is(are) the clustering column(s) on the table? You need to read each 1/4 of the table at a time using the appropriate clustering key range.

    What...

    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: Prevent RENAME of a database

    Shouldn't the event you want to intercept be "ALTER_DATABASE", not "RENAME"?

    You'll need to interrogate the event data to identity a MODIFY NAME = vs other types of alter database commands.

    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: Decrease query execution time to retrieve records from huge table

    What is(are) the clustering column(s) on the table? You need to read each 1/4 of the table at a time using the appropriate clustering key range.

    What are there nonclustering...

    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: Preventing Duplicate Rows On An Insert

    AZ Pete (8/15/2014)

    A unique constraint cannot be implemented since the combination of LocationId and ExternalId must be unique only for the cases when ExernalId is not null. There can be...

    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: Prevent RENAME of a database

    You should be able to create a DDL trigger to prevent database renames, at least through ALTER DATABASE. I hope sp_renamedb would get caught as well, but I haven't...

    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: passing parameters to stored procedure through OPENQUERY

    Alex R (8/15/2014)

    this is the latest syntax error:

    EXEC sde_Stage.dbo._aaa @table_name = ''GLOBAL'',@date = ''OBJECTIDLIST'',@reduce = 0.0025,@oid =''3476,6673''

    SELECT * FROM OPENQUERY ([10.100.1.40], 'EXEC sde_Stage.dbo._aaa @table_name = ''GLOBAL'',@date = ''OBJECTIDLIST'',@reduce = 0.0025,@oid...

    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: passing parameters to stored procedure through OPENQUERY

    I don't believe you can use varchar(max) across linked servers; try varchar(8000).

    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: Query that returns SUM of column based on other data in other column

    Something like this:

    SELECT ServerName

    ,SUM(CASE WHEN FileType <> 'LOG' THEN FreeSpace ELSE 0 END) AS 'Available Data Space'

    ,SUM(CASE WHEN FileType = 'LOG' THEN FreeSpace ELSE 0 END) AS 'Available...

    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: passing parameters to stored procedure through OPENQUERY

    You don't want quotes around the variable names, just the values, if they are not numeric:

    SELECT * FROM OPENQUERY ([10.100.1.1], 'exec mydb.dbo.mysp @p1=''mytable'', @p2=0.0025,@p3 =''3476,6673,3321''')

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