Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by AgentM

  1. AgentM

    using Declare in Stored Procedure

    Never mind got it. The error was a space in the var name in the Declare. Thank you
  2. AgentM

    using Declare in Stored Procedure

    the FROM was a typo. I am getting a syntax error on line above the "SET NOCOUNT ON" line
  3. AgentM

    using Declare in Stored Procedure

    Hi, I am new to T-SQL and I am trying to use "declare" in a stored procedure. I am getting a syntax error not sure why, any help appreciated. Here's the code :- ALTER PROCEDURE [dbo].[TOTALCOUNT] @StartDate DateTime, @EndDate DateTime AS BEGIN SET NOCOUNT ON; DEclare @TOTALPEOPLE int...
  4. AgentM

    Simple count * issue

    '[' was a typo. pls ignore. Query: SELECT COUNT(D1.*) AS [Col1] FROM Database1 AS D1 INNER JOIN Database2 AS D2 ON D1.CoL1 = D2.CoL1 Same error. thank you.
  5. AgentM

    Simple count * issue

    Here's the modified query minus the '[' bracket Query: SELECT COUNT(D1.*) AS [Col1] FROM Database1 AS D1 INNER JOIN Database2 AS D2 ON D1.CoL1 = D2.CoL1
  6. AgentM

    Simple count * issue

    Hi, I am trying to do the following query and I get a Syntax error Query: SELECT COUNT[D1.*) AS [Col1] FROM Database1 AS D1 INNER JOIN Database2 AS D2 ON D1.CoL1 = D2.CoL1 Error: incorrect syntax near '*' What am I missing. Thank you.
  7. AgentM

    Using IF in SELECT

    Thank you. So IF cannot be used at all in SELECT ?h
  8. AgentM

    Using IF in SELECT

    Can I use "IF" in a Select stmt e.g. SELECT Db1.Value1, IF (Db1.Value2 != 'good','bad','ok') FROM Database1 as Db1 I am getting a syntax error on IF any help appreciated.
  9. AgentM

    Moving SQL server 2005 Db

    Hi, I need to move a SQL server 2005 database nearly 9 GB to another machine on a different domain. What is the best way to do this ? I tried taking a backup then do a restore on the new machine and it failed with an "Access denied error". thanks for your help.
  10. AgentM

    Return a value with space

    I am new to t-SQL and was looking for some help. Is there a way to display a "space" or Null value in a column when no data is returned for a query. E.g. If I run the query below SELECT EMPNAME, EMPMIDDLE Where EMPName='bob' When I run this query and if there is no Empname as 'bob' then at...
  11. AgentM

    Nebie question- writing attribute value

    Can anybody tell me what is the best way to change the attribute value on a particualar node in a axml file ? Thank you. <Vehicle> <Cars> <Hybirds id='Toyota' cost='2500'>Available</Hybrids> <Hybrids id='Honda' cost='3500'>Available</Hybrids> </Cars> I want to change the value for cost where...
  12. AgentM

    Using temp tables, syntax error

    thanks, Brings me to another question, I want to display count of people passed and failed as two columns in a single table. Can you help?
  13. AgentM

    Using temp tables, syntax error

    Hi, I am new to TSQL and have a problem with temp tables CREATE TABLE #TCOUNT( PASSED INT, FAILED INT ) INSERT INTO #TCOUNT(PASSED,FAILED) VALUES (SELECT count(ID) FROM ExamResults er WHERE (er.[lastresult] = @mark1) AND ( er.[curresult] = @mark3 or er.curresult= @mark4 or er.[curresult]...
  14. AgentM

    C# and registering for events

    Has anybody used C# to register for Windows device events? I am trying to capture "CMP_WaitNoPendingInstallEvents" is there a way to do this in in C#. Any help appreciated.
  15. AgentM

    returning an interger

    I have a similar problem I am trying to return an integer <CODE> ALTER PROC [dbo].[sp_CheckIDExists] ( @id varchar(30), @RETURNVALUE int OUTPUT ) AS If (@id) Is NULL return 1 If EXISTS(SELECT ID FROM dbo.v_CI_DRIVERINFO WHERE ID= @id) @RETURNVALUE = 0 Else @RETURNVALUE = 1 return...

Part and Inventory Search

Back
Top