Forum Replies Created

Viewing 15 posts - 2,866 through 2,880 (of 13,460 total)

  • RE: How can I solve Null value is eliminated by an aggregate or other SET operation?

    hunchback (11/26/2013)


    There is no harm by having both expressions but having "LastDate <> '19000101'" is enough to cover both cases "is not NULL and is diff from '19000101'".

    WHERE ...

    ...

    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: Extract string

    ok, a kewl sneaky way taking advantage of parsename

    Declare @TableName varchar(128) ='ABCD_kkk_DDD'

    SELECT PARSENAME(REPLACE(@TableName,'_','.'),2)

    and the long drawn out way:

    Declare @TableName varchar(128) ='ABCD_kkk_DDD'

    SELECT SUBSTRING(@TableName,0,CHARINDEX('_',@TableName)) As Pt1,

    REPLACE(@TableName,SUBSTRING(@TableName,0,CHARINDEX('_',@TableName))+'_','') As Inprogress,

    SUBSTRING(REPLACE(@TableName,SUBSTRING(@TableName,0,CHARINDEX('_',@TableName))+'_',''),0,CHARINDEX('_',REPLACE(@TableName,SUBSTRING(@TableName,0,CHARINDEX('_',@TableName))+'_','')))

    As Part2

    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 can I solve Null value is eliminated by an aggregate or other SET operation?

    there's nothing wrong with receiving that warning; some of the data you are looking at is null, and that's normal; some data has never been updated, only origianlly inserted is...

    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: Running chkdsk, should SQL be stopped?

    as far as i know, if you try to run chkdsk on a disk that is active in any way, it will tell you it cannot do it.

    if it was...

    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: need help to send mail only if records exist

    test for the data with an exists:

    IF EXISTS( SELECT 1 from test1 WHERE sl_code=@cd AND DATEDIFF(DAY,doc_dt,GETDATE())=0) )

    BEGIN

    DECLARE @htmlbody VARCHAR(4000)

    SET @htmlbody = 'This is a Simple Email...

    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 set some restriction on table names while creating?

    vignesh.ms (11/26/2013)


    Hi There,

    I need to ensure some naming standards to users while creating tables.

    All table name should be in same pattern

    (ie., ) TeamName_EmpId_tablename

    I need a way to restrict...

    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: Please help ... Attaching all files in a folder to an e-mail

    sorry, no loop required;

    you need to create a semicolon delimited list of the files, including the full path.

    this worked for me:

    CREATE TABLE #files(File_Name varchar(200), depth int, fil int)

    INSERT #files

    EXEC master.dbo.xp_dirtree...

    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: ssrs 2008 r2 number of columns displayed

    i see how to show/hide columns based on wether they are exported or not here:

    https://www.simple-talk.com/sql/reporting-services/ten-common-sql-server-reporting-services-challenges-and-solutions/#hr8

    but i don't see how to filter based on the export type yet.

    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: Please help ... Attaching all files in a folder to an e-mail

    Skypass (11/25/2013)


    Hi,

    How do I attach all files in a network folder to an e-mail (without zipping) using sp_send_dbmail.

    The names and number of files in the folder will keep changing. ...

    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: Question for DBAs - Manage SQL Jobs

    this link will probably help enourmously, and keep you from granting sysadmin rights when it's not required:

    Microsoft.com:Configure a User to Create and Manage SQL Server Agent Jobs

    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: Collect tables have most row changed during specfic period

    ScottPletcher (11/25/2013)


    Use view "sys.dm_db_index_operational_stats".

    Capture the values at the start time, then recapture them at any subsequent time, subtract the two values, and voila, you have the mods that occurred during...

    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: Collect tables have most row changed during specfic period

    john.chiu (11/25/2013)


    I was tasked to collect row count information in a system with approx. 500+ tables. They want a way to easily identify which top 20 tables insert the most...

    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 write a simple IF statement in SQL 2012 query

    hoolash (11/25/2013)


    Hi all,

    I have a JOIN query that selects data from 3 specific tables, using a common field called "ReservationID". The column I am pulling from one of the tables...

    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: Linked server error

    yes it is on the Oracle side; because of the _TS (_TIMESTAMP?) i think that it's the timestamp datatype issue.

    pretty sure you can also resolve this by convertint the value...

    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: Linked server error

    Aatish Patel (11/25/2013)


    I create a linked server to Oracle in SQL 2008. tested the connection and it tests successfully.

    When I try to query

    SELECT top 10 * 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!

Viewing 15 posts - 2,866 through 2,880 (of 13,460 total)