Forum Replies Created

Viewing 15 posts - 121 through 135 (of 149 total)

  • RE: insert into table with foreign key constraint

    You may be able to leverage an 'instead of' trigger on the parent table. This canintercept the update of the key before it is changed. You can than...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: CONVERT DATETIME to TIME and remove seconds and milliseconds

    If all you are interested in comparing is the time, you can easily compare the sysjobschedules.active_start_time with sysjobhistory.run_time. They are in the same format (integer) so a simple equality...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Having issues inserting into a linked server (mysql table)

    I expect you'll have better end results trying to resolve your issues with SSIS/MySQL than using a linked server to bulk insert.

    If you really must use the linked server for...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Having issues inserting into a linked server (mysql table)

    Your table variable does not exist in the @test-2 variable. To use the the table variable in @test-2, your variable declaration must also be included in the set statement...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Generate Create View statements for database tables.

    Here is the definition of the Employee table from the AdventureWorks db. The output is formatted as displayed.

    Create View [dbo].[Employee]

    AS

    ( SELECT [EmpID]

    ...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Stop job as failure

    Assuming no better option, I'm considering adding another step to the job that checks the results of the first step load, which would be incomplete if killed. If the...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: EXCEL-SQLServer - Is is possible to force isolation level read uncommited for specific logins ?

    If you do create views, I'd recommend putting them in another schema so you can manage permissions at the schema level rather than on individual objects. Schemas can make...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Stop job as failure

    We are using a multi-platform enterprise job monitoring application that we use for call-out support. The SQL Agent job is for a scheduled load from a critical internal application....

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Need Query for Problem

    SELECT * ,

    MaxUnits = CONVERT(INT, 1000 / CONVERT(DECIMAL(5), Price))

    FROM #sample

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: EXCEL-SQLServer - Is is possible to force isolation level read uncommited for specific logins ?

    Is removing direct table access an option? You could create views with nolock hint to replace their select access on the tables.

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Primary Key Violation

    Double check your data before applying the primary key

    SELECT COUNT(*), AbcID

    FROM StagingTable

    GROUP BY AbcID

    HAVING COUNT(*) > 1

    Verify there are no nulls also. Primary Key cannot be null.

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Problem with Powershell and SQL Agent Job token

    Found it!!!

    I needed to include -DisableVariables in the Invoke-SQLCmd statement. Now it runs without erroring on the SQL Token.

    Invoke-SQLCmd -Query:$query -Database:'MSDB' -ServerInstance:$TargetSSISServerName -DisableVariables| Out-File $logfile -Append

    Wes

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Problem with Powershell and SQL Agent Job token

    I'm scripting the jobs out using SMO into a string variable using SMO and the .Script() method. One of the jobs uses the SQL Token I mentioned above. ...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Use a SELECT to ALTER properties of all databases of certain type...

    Put the dynamic sql into a variable and Execute the variable.

    DECLARE @sql varchar(max) = '';

    SELECT @sql = @sql + '

    ALTER DATABASE ' + name + ' SET RECOVERY SIMPLE WITH...

    Wes
    (A solid design is always preferable to a creative workaround)

  • RE: Quick view of User database and server roles

    Great feedback.

    I hadn't run into the collation issues.

    I haven't run into any truncation issues, but I know that our database names and usernames are limited in length. Your sysname...

    Wes
    (A solid design is always preferable to a creative workaround)

Viewing 15 posts - 121 through 135 (of 149 total)