Forum Replies Created

Viewing 15 posts - 76 through 90 (of 314 total)

  • RE: dynamic sql

    I think the reason is #temp table. Temp tables are created in tempdb not in the user db(with a long Name ..eg :#temp_______________6788) and when ur query tried to look for...

  • RE: What is wrong with my sql_executesql statement

    1. Your parameters that u are using does not match what's being passed (Eg:@unit  and @xUnit).

    2. There is No Select in yout SQL.

    SELECT @sql ='o.[Full Name] ,o.Unit,o.[Unit Desc]...

  • RE: SQL Statement to get rid of duplicates????

     

    If all the Columns are Dupe, then u can do this.

    SELECT Surname, Forename, NameOrderIndicator, MiddleNames,DateOfBirth,

    Gender,FormerSurname, PreferredForname,

    Ethnicity, DateSent, COUNT (*) as Cts

    into #tmp

    FROM  dbo.Import_Changes_FULL

    WHERE DateSent = '2006-09-29 00:00:00.000'

    GROUP BY Surname,...

  • RE: DTS Export Headaches Again

    why are u trying to do a truncate on a table that has references? How about delete (that is after deleting the data in the Child table) and then reload...

  • RE: select query problem

    Create a view using this code and u can do select on the view.

    Select  Table1.Session_ID,Table1.Session_Name,Table1.LogUserType_ID,Table1.SystemUserID,Table2.[User_Name],

     Table1.Buyer_ID,Table3.BuyerName,

     Table1.Supplier_ID,Table4.Supplier_Name,

     Table1.IPAddress

    from Table1  LEFT OUTER JOIN Table2 ON Table1.SystemUserID = Table2.SystemUser_ID

      LEFT OUTER JOIN Table3 ON Table1.Buyer_ID =...

  • RE: Cannot Open User default database

    Looks like ur login doesnot have access to the default database associated with your account.

    Try this

    sp_grantdbaccess @loginame ='DomainName\UserName',@name_in_db ='UserName'

  • RE: Count if condition

    I didn't realise that ) was repalced with smily face. These should be plain text box without emiticons.

  • RE: UPDATE comparing to tables and get error

    Why would u update a column thats used in the JOIN?  

    UPDATE DB1.dbo.t1 SET col1=temp.col1, ....

    INNER JOIN

    DB1.dbo.T1 perm

    ON temp.col1 = perm.col1

    Like Sergiy said "Understand some basic educational things about relational databases".Please...

  • RE: is it possible to query a job?

    In future the way to avoid this would be use "Distribution List" so that all the DL's can be maintained on the mail server and you don't have to modify...

  • RE: msg 4104

    Are you trying to update option table or Provinces table. Cos ur statement is trying to update a column in "Provision" table while ur update statement says "Update Option" table.

     

  • RE: Count if condition

    Mita,

    I hope this is what u wanted. Please let me know if this is not right.

    Select  Providerdate,Region,DHB,DHBName,PHO,PHOName,Practice,Practicename,

     PracticeAddress,Practice_Startdate,Practice_Enddate,Practice_Test.Practitioner,

     PractitionerName,Practice_Test.Practitioner_Startdate,Practitioner_Enddate

     ,YCount,NCount

    from Practice_Test INNER JOIN

     (

      Select  Practitioner,  sum(Case when Upper(Locum) ='YES' Then 1 Else 0 End)...

  • RE: Union ORDER BY with expression

    Try This:

    Select tableName.Col1,tableName.Col2,tableName.Col3,... from (

     SELECT convert(varchar, datepart(dd, s.dtDate)) 'vDay' ....,datepart(dd, s.dtDate) as Dy FROM Schedule as S

     UNION

     SELECT convert(varchar, datepart(dd, h.dtDate)) 'vDay' ....,datepart(dd, H.dtDate) as Dy FROM Holidays as H) tableName

    Order...

  • RE: trigger

    Can u give us specific examples cos that would convey what u want done.

    Thanks

    Sreejith

  • RE: Date Calculation Excluding Weekend & Holiday

    why can't u use the post by NPeeters. Thats how u should be doing."Holidays" vary by divsion by company by location. So...

  • RE: copying the database from development box to production box

    The reason is when u copied the Databases over the logins that have rights on the databases got copied over. But the "sid" for the logins that were created on...

Viewing 15 posts - 76 through 90 (of 314 total)