Forum Replies Created

Viewing 15 posts - 3,421 through 3,435 (of 4,820 total)

  • RE: Update with CTE

    lsalih (7/16/2015)


    Greetings -

    I have a query as following:

    ** Query***

    With CTE1 (col1, col2, col3)

    AS

    (SELECT COL1, COL2, COL3

    FROM TBL1 JOIN TBL2)

    SELECT A.A, A.B, B.COL1, B.COL2

    FROM TBL4 A JOIN CTE1 B ON...

  • RE: Server-side vs App-side

    GilaMonster (7/16/2015)


    Put it in the database. Putting it in your app won't help when other apps, spreadsheets, MS Access, etc are connected to the DB, when the app is changed...

  • RE: Improving Performance of Logging Tables (Inserts only)

    Bharatvip (7/15/2015)


    We are building a new environment and have got a Sql Server with 32 GB memory, 32 core 2.00 GHZ CPU, a Sql 2012 installation. We have about 6...

  • RE: Assistance needed for emailing the results

    jonathanm 4432 (7/15/2015)


    Brandie,

    Thank you for that. I will have to try to set up DBmail first. I don't believe we have that set yet. A lot of reports and just...

  • RE: Using EXEC functions and temp tables

    rourrourlogan (7/15/2015)


    I don't have a problem necessarily I just want to clean up my code so I don't have these massive querys setting up temp tables at the beginning of...

  • RE: SQL Join

    sql_novice_2007 (7/15/2015)


    I am sorry following is the right query.

    SELECT * FROM tblNew a LEFT JOIN tblOld b

    ON a.empId=b.empId WHERE a.deptId<>b.deptId

    OR b.deptId is null

    We have no way to know what your...

  • RE: User Notification Query

    demeritrious (7/15/2015)


    No I am not using bits because the user access level per department can rise from 1-3 actually. And also the user can be members of multiple departments. The...

  • RE: Converting T-SQL query to XML result

    redmittens7 (7/15/2015)


    Hello Forum,

    I'm brand new to XML and I'm struggling to modify the T-SQL query below to return the results as XML.

    SELECT ProductModelID, Name

    FROM Production.ProductModel

    WHERE ProductModelID IN...

  • RE: TSQL Fastest way to strip non-numeric characters from a string

    WayneS (7/15/2015)


    I didn't notice it before, but that's not quite the code that I posted, which is (after modifying to varchar(30) as Steve suggested):

    CREATE FUNCTION dbo._tTVFN_tEEst2 (@countryNr INT, @telNr NCHAR(30))

    RETURNS...

  • RE: SQL Joins Basic example

    dhanekulakalyan (7/15/2015)


    Any thoughts on this ?

    Try this:

    Declare @a table (

    id int,

    data varchar(10)

    );

    insert into @a values(1,'data1')

    insert into @a values(2,'data2')

    insert into @a values(3,'data3')

    insert into @a values(4,'data4');

    Declare @b-2 table (

    id int,

    data varchar(10)

    );

    insert into...

  • RE: TSQL Fastest way to strip non-numeric characters from a string

    Raymond van Laake (7/15/2015)


    For the loop it should be the same:

    DECLARE @a CHAR(30)

    DECLARE @b VARCHAR(30)

    SET @a = 'hello'

    SET @b = 'hello'

    SELECT LEN(@a), LEN(@b)

    results in 5 on both variables

    That's not where...

  • RE: TSQL Fastest way to strip non-numeric characters from a string

    Wayne,

    Why NCHAR(30) instead of VARCHAR(30) ? For a phone number, it makes no sense to waste the extra byte per digit when you only need to account for...

  • RE: Get help for Select

    farax_x (7/15/2015)


    thank you very much Eirikur but it wont work for this :

    declare @tt table

    ( TagId int, TagType int, ReportId int)

    INSERT...

  • RE: concatenating many rows into one

    jbalbo (7/14/2015)


    Ok so I think I found something in the forum and adapted it to work

    SELECT

    ParentObject,

    STUFF((SELECT ', ' + [View As] FROM dbo.Signatures t2 WHERE t2.ParentObject = t1.ParentObject FOR XML...

  • RE: Using EXEC functions and temp tables

    rourrourlogan (7/14/2015)


    Hello,

    here's an example of what I am trying to do.

    --Exec Database.Employees

    --Use Database

    --Go

    --Create PROCEDURE AEM.TempTable

    --AS

    --BEGIN

    --Select * into #emptemp From Database.Employees

    --End

    --Select * From #emptemp

    Is something like this possible? I can get...

Viewing 15 posts - 3,421 through 3,435 (of 4,820 total)