Forum Replies Created

Viewing 15 posts - 1,276 through 1,290 (of 13,460 total)

  • RE: Text search without FULLTEXT....

    I have this old snippet form a post from years ago.

    both this and your example are non-sargable, meaning it's going to table scan for the values, which is what full...

    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: SQL Users and Password Policies

    I've used the answer below to get the Active Directory password policy via powershell:

    https://blogs.technet.microsoft.com/heyscriptingguy/2014/01/09/use-powershell-to-get-account-lockout-and-password-policy/

    import-module ActiveDirectory

    Get-ADDefaultDomainPasswordPolicy

    PS H:\> Get-ADDefaultDomainPasswordPolicy

    ComplexityEnabled : True

    DistinguishedName ...

    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 change the name of a table within Access so I can use foreach loop to import data to SQL Server table

    also, does the table inside follow some sort of naming convention, but is dynamic?

    for example a table named [Invoices_2016-02_14] from yesterday, but it's [Invoices_2016-02_15] from today?

    if you can determine...

    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 do we get the definition of tables via sql

    mw112009 (2/12/2016)


    Lowell:

    The one I picked ( I did a quick search ) uses the following objects.

    You mentioned stuff from INFORMATION_SCHEMA is lacking some info.

    Can you mention a few ?

    INFORMATION_SCHEMA.TABLES

    INFORMATION_SCHEMA.COLUMNS

    INFORMATION_SCHEMA.COLUMNS

    sys.identity_columns

    sys.columns

    information_schema.table_constraints

    sys.indexes

    it's in...

    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 do we get the definition of tables via sql

    I went deep, deep down this rabbit hole, and built a procedure that i can call from tsql .

    tin the long run, you have to use the sys. schemas 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: Function in database disappears

    not suspicious; it sounds like a missing GO statement between drop create procedure and drop/create function in someones script.

    it happens to us all at some point

    IF OBJECT_ID('[dbo].[sp_Bad]') IS NOT NULL...

    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: Function in database disappears

    if not too much time has passed, the default trace would have the DROP FUNCTION event, complete with whodunnit information; you might have an automated process, or someone may just...

    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 help with a scalar function.

    easy fix.

    if the function has no parameters, you still need the parenthesis for the parameter list.

    alter FUNCTION [dbo].[fnPressGaneyDownload] ()

    your function could easily be converted to an inline table value function,...

    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: Best practice dropping or disabling

    I'm on the SQL cruise with limited internet, but i'll put together an article;

    I tend to shy away from articles, hate getting criticism.

    At my job, we just joined two AD...

    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: Best practice dropping or disabling

    in my case, I remove the users and logins from SQL Servers, but they stay forever in Active Directory.

    I've got a nifty powershell i wrote that imports Active directory data...

    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 import newly created GUID into multiple tables in same SSIS package

    there is a neat opportunity here to use the OUTPUT clause;

    it allows you to capture things like new guids or identities into a table, and then consume it on a...

    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: Can't ALTER COLUMN to NOT NULL and ADD PRIMARY KEY in the same SQL Batch?

    hlrx (1/25/2016)


    GilaMonster (1/23/2016)


    hlrx (1/22/2016)


    For example, this compiles and runs fine in one batch:

    [font="Courier New"]CREATE TABLE test1 (col1 INT NOT NULL)

    ALTER TABLE test1 ALTER COLUMN col1 INT NULL

    INSERT test1 VALUES (NULL)

    GO[/font]

    Yes...

    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: Database mail issue

    vsamantha35 (1/25/2016)


    Hi All,

    Today came across an issue. Database mail alerts on job failures was not been sent. Checked the dbo.sysmail_faileditems and found that it was failing with authentication error.

    Basically,...

    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: converting the nvarchar value 'MSalreadyhavegeneration' ?

    if you added a table named Customer_Invoice, you would get the error

    Conversion failed when converting the nvarchar value 'Invoice' to data type int.

    Luis hit the nail on the head: 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: Trying to find the percentage of on time shipments

    untested, but this might give you an idea.

    percentage is # ontime / Total,typically limited by a period of time (a month?)

    due to integer division in SQL, you need to convert...

    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 - 1,276 through 1,290 (of 13,460 total)