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 strongm 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. DBCustard

    Parameterized Stored Proc question

    Or select * from table where (@vdate is null or mydate > @vdate) This might be slightly eachier if you have lots of arguments of this flavour.
  2. DBCustard

    Query Status Code

    Well, if the insert /update fails because of a constraint, you'll get notified at runtime - this notification will depend on the environment you are using, alternatively, if you want to see how many rows an update /insert /select affects, you could use the @@rowcount variable eg: select * from...
  3. DBCustard

    SProcs, Crystal Reports and whole bunch of Pain.

    I have recently had a similar problem, I solved it by initially binding the Crystal report to an ADO active data datasource (pointing a some psudo-temporary table, with the same structure as the output from the stored procedure). Then at runtime, create a recordset from the results, passing in...
  4. DBCustard

    Build this query guys(Its a tough one)

    I agree, I think the only way to solve it would be to come up with an expression to relate col2 to col1, if you plot them against eachother it seems to be a relatively smooth curve, so this might be possible, then you could rely on a cartesian product ... select * from tblTest col1, tblTest...
  5. DBCustard

    Generation of auto number

    You can maintain a seperate table to hold the last value of the key for all other tables: NextIdentifier: TableName varchar(255) NextIdentifier int Everytime you need to write row to a table you have to read this table, then . The big problems with this are: You always incur another read and...
  6. DBCustard

    Logging update queries

    Remember, you are probably using an Anonomous connection to IIS, otherwise external people will not be able to connect to you website. This means that the connection credentials used by IIS to connect to SQL server will be it's own, and not the user of the web page.
  7. DBCustard

    Transferring data to new server

    Consider detaching the database, copying the device files and reattatching them on the 2000 server. This is certainly the simplest method. ... sp_detach_db mydatabase (copy files to new server) Do this on both servers ... sp_attach_db mydatabase, 'datafilename', 'logfilename'
  8. DBCustard

    MSSQL SERVER datetime datatype

    My recommendation is to format all dates as dd/mmm/yyyy before sending them to SQL server: e.g. 10/mar/2001 SQL will automatically cast these nomatter what date format is set
  9. DBCustard

    MSSQL SERVER datetime datatype

    Try: select convert(varchar, getdate(), 103)
  10. DBCustard

    Simple Search String Stored Procedure?

    To be honest this is not easy, the main problem is that an SP cannot take an undetermined number of arguments, if you settle for passing to the SP a comma seperated list you could use the following stored procedure: Note, you'll have to modify the select statement, I've created it, to look at...
  11. DBCustard

    Need help with this query

    I'm not exactually sure what you mean, but you can join two tables in an update statement: update a set id = newid, customername = newcustomername, updateDate = newupdateDate from a, b where b.id = a.id
  12. DBCustard

    How do I resize the results from a stored procedure?

    You can view the source of all the system stored procedures, they are just like any other procedure except they reside in the master database, so to look at sp_spaceused: master..sp_helptext sp_spaceused You'll probably be suprised by the complexity of these procedures, but I think you want to...

Part and Inventory Search

Back
Top