Forum Replies Created

Viewing 15 posts - 976 through 990 (of 13,460 total)

  • RE: Ola Hallengren Index Scripts

    here's something i recently built to move specific clustered indexes to a new filegroup, and also enable page compression on some specific tables;

    you'll see some commented artifacts referencing a table...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Query to view who can see definitions

    sure; there's a system view named sys.database_permissions.

    this will give you users and groups that have the permission you are looking for...but you might need to expand group members if you...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Video File Duration

    DouglasH (5/25/2016)


    You'll have to access the Extended File Properties of the file but I don't think you can do it with TSQL. The Extended Properties vary according to the...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Errors while trying to copy files to UNC path using Powershell

    In my case, i was bitten by the 2./3.0 when i wax using Export-Csv i think, which added -Appen parameter.

    I ended up using a command line call to the...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Errors while trying to copy files to UNC path using Powershell

    can you run $PSVersionTable?

    i'm thinking the script is for Powershell 3.0, but it's running under 2.0 context?

    the third error i would think can occur if the string $DestinationFile has...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: aggregate for previous year specific date

    in that case, your count, as you currently have it, would always be one, since the WHERE statement is limiting data to the same day the person died.

    you have to...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Alter table alter column running long and filling log

    i would think do the following

    add a new column, ie

    update it to the equiv orig value, maybe in small batches

    rename orig column

    rename new column

    drop orig column

    ALTER TABLE myTable...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: aggregate for previous year specific date

    boehnc (5/24/2016)


    thanks so much for your response Lowell. If, for example, a person who dies on Jan 1, 2015, I would need a count of visits from Jan 1, 2014...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: aggregate for previous year specific date

    assuming DCDate is the Deceased Date, and you can only die once(except in the movies)

    here's my best guess:

    SELECT

    a.PatientNumber,

    MAX(a.DCDate) As DCDate,

    Count(a.PatientNumber) as PatientVisits

    FROM [PatientData] a

    where a.DCDispCode = '20'

    and...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Which Stored Procedure changed

    here's the script with all columns in T.* exploded out to their full name.

    you can remove what you don't need easier than i can.

    object_name(object_id) has an additional optional parameter, db_id,...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: EXcel Connection string error

    isn't error 0x80004005 file permissions, ie cannot access \\servername\sharename\filename.xls?

    this is probably after you publish /delopy the package(so it runs under a different user on the server), but works fine...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Monitor/Alert deadlock events

    well here's how i do it:

    deadlocks are already in the extended events. nothing extra needs to be done with that.

    i have a stored procedure that pulls the "latest" deadlock from...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Bulk fix hard coded server references

    i did this once, but it's been a while, and it actually worked.

    same issue, hardcoded code to three part naming conventions.

    it's been a while, but i obviously made sure i...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: I need to copy records from a table, back into the same table changing the value of on field only.

    it's just syntax.

    you want to select modified data, and insert is still just an insert. i saw what you were tryingto do, though.

    below is a better example

    Insert INTO (

    [ScenarioID]

    ,[CostCenterID]

    ,[CostCenterName]

    ,[FunctionID]

    ,[FunctionName])

    SELECT 'Budget2013'...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: how to determine the excessive runs of SPs?

    My prod system s busy, but not 500 queries per second busy.

    I've run that particular query quite a few times on production, during prod hours, since it's hitting the DMV's,...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 15 posts - 976 through 990 (of 13,460 total)