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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. slaver

    Pass a variable to DATEPART as part of DATEDIFF

    Thats Brilliant, it works Many thanks to all declare @datepart char(5) SELECT @datepart = 'm' EXEC ('select (datediff(' + @datepart + ',getdate()-1, getdate()))')
  2. slaver

    Pass a variable to DATEPART as part of DATEDIFF

    thanks, but i am still getting the same error message. i am trying to write a stored procedure for SQL server 2000 : DECLARE @x varchar(5) set @x = 'dd' SELECT DATEDIFF(@x, getdate()-1, getdate()) AS no_of_days but i still get this error message: "Invalid parameter 1 specified for...
  3. slaver

    Pass a variable to DATEPART as part of DATEDIFF

    Hi, i need to find the differance between 2 dates, but need the difference output as days or weeks or months etc depending on a set of criteria. getting the difference is easy, BUT DO YOU KNOW HOW TO PASS THE 'DATEPART' PART OF THE FUNCTION AS A VARIABLE ?? If i try this i get the following...
  4. slaver

    How to verify that a user has entered only alphanumeric characters

    HI, IS IT POSSIBLE TO verify that a user has entered only alphanumeric characters IN SQL SERVER. I KNOW THE VARIOUS METHODS ON THE CLIENT SIDE, BUT I NEED TO DO THIS IN SQL SERVER THROUGH A STORED PROCEDURE OR TRIGGER OR RULE OR CONSTRAINT. THE BEST I CAN COME UP WITH SO FAR IS: CREATE...
  5. slaver

    Modify a PRIMARY KEY constraint

    Is there an easy way to modify a PRIMARY KEY constraint with query analyzer, for ALL the PRIMARY KEYS in ALL the tables in a SQL 2000 database. Basically I need to run a script that will 'turn off' all the IDENTITY SEEDS of all the PRIMARY KEYS, and then one to turn them all back on. I need...

Part and Inventory Search

Back
Top