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 SkipVought 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. dbtech

    Can't e-mail in SQL 7

    Is the SQL Mail started? you can check this under support services when u expand the server list using MMC. To send emails with SQL Server check the links below. http://support.microsoft.com/default.aspx?scid=kb;EN-US;q263556 http://www.mssqlserver.com/articles/sqlmail_p1.asp Nice...
  2. dbtech

    Retrieving Values from SP

    Try this --Declare @Start and @end select @start=start,@end=end from month did this work? dbtech
  3. dbtech

    Creating rows for each of current month

    I'm not clear abt your question! do u want to populate a table with all the months starting from 1 to 12? if so this is one way to do it. Create Table #TEMP (month1 tinyint) Declare @i int set nocount on SET @i=1 while @i<=12 begin insert into #temp (month1) values(@i) set @i=@i+1 end set...
  4. dbtech

    Data would be truncated error

    Can you post the code? do you still want to insert values into the fields, knowing that the value inserted exceeds the field length? if you are using VB, then it has be set at the Connection level example cn.excute(&quot;SET ANSI_WARNINGS OFF&quot;) Example create table #temp(Yourname...
  5. dbtech

    Conditional select - dependent on results returned by other select

    Check BOL for @@ROWCOUNT The changes you need to make wil be IF @@ROWCOUNT=0 BEGIN If (left(@dateTo,11) = left(@currentDate,11)) /* If2: dateTo is the currentDate */ BEGIN Insert into #myTempTable SELECT statment from linked server database END END @@ROWCOUNT Returns the number of rows...
  6. dbtech

    if...then

    U can make use of CASE Statements. Please post your full query. Anway this is how its done SELECT Amount FROM tablename WHERE Amount=(CASE WHEN Amount ='' THEN 0 END) dbtech
  7. dbtech

    Restricting values for a column

    U can use CHECK constraints in SQL Server to limit the values entered into a column, note that when the violation of constraint occurs SQL Server will issue a warning message The message will not be in user-friendly format, Which u will need to trap in your access front end and display a proper...
  8. dbtech

    Server timeout/not responsive when running St. Proc.

    Are you calling the SP from Visual Basic code? if yes then you can try to set the CommandTimeout property of connection/command object to 0, CommandTimeout=0 if you are running from Query Analyser Go to Query Analyzer-> Menu Tools-> Options, Tab &quot;Connections&quot;-->specify timeout value...
  9. dbtech

    user connection timeout

    'remote conn timeout': Will not kill inactive process. Use SQL Profile to monitor the open/close connections. check this link, U need to register to access the script...
  10. dbtech

    iSQL output file - getting rid of [end of job] comment

    Try this SET NOCOUNT ON, Put this line before you process the sql statement. Ex SET NOCOUNTON SELECT * FROM tablename dbtech
  11. dbtech

    Storing an Image

    Try this http://www.sqlmag.com/Articles/Index.cfm?ArticleID=20460 scroll down below and you can download the code for the article above. Issues related to crystal reports for displaying iamges from database http://support.crystaldecisions.com/library/kbase/articles/c2007340.asp Did this work...
  12. dbtech

    Calculate a Date based on another field...

    you are right. thanks for correcting my post. dbtech
  13. dbtech

    query help

    do you mean Duplicate rows in a Table?
  14. dbtech

    table locks

    To change the lock you need to use locking hints, search BOL for locking hints and SET TRANSACTION ISOLATION LEVEL Example to force No locks while reading data from authors table in Pubs database SELECT au_lname FROM authors WITH (NOLOCK) dbtech
  15. dbtech

    Copy Database Wizard

    This should help http://support.microsoft.com/default.aspx?scid=kb;EN-US;q274463
  16. dbtech

    Calculate a Date based on another field...

    Try this Declare @Alloted int SET @Alloted=10 SELECT * FROM tblCase WHERE dateadd(dd,@Alloted,CaseDate) = getdate() If you want to eliminate the time part from the date field then you should use the query below. SELECT * FROM tblCase WHERE...
  17. dbtech

    text datatype

    Check this links Image http://www.sqlmag.com/Files/09/20461/Figure_01.gif Answer to ur question abt pointer http://www.sqlmag.com/Articles/Index.cfm?ArticleID=20461 Try this example http://www.sqlmag.com/Articles/Index.cfm?ArticleID=20460 dbtech
  18. dbtech

    How To Return Results from SQL Stored Procedure in VB6

    Are u able to get the result for your SP when u run inside SQL query analyzer? Here is the modified version of your sp, i prefer to use this method. With cmd .ActiveConnection = DBS .CommandType = adCmdStoredProc .CommandText = &quot;CompareBom&quot; .Parameters.Append...
  19. dbtech

    Updating Default Field Value

    oops there is a mistake in the code i posted above, i forgot to include the commit please ignore the above code and use this one. /*Create table with default value for column test1 to 0 */ BEGIN TRANSACTION go CREATE TABLE dbo.Table4 ( test1 int NULL ) ON [PRIMARY] go ALTER TABLE...
  20. dbtech

    Updating Default Field Value

    The SQL command to use is ALTER TABLE ADD|DROP CONSTRAINT , once you have created a table with Enterprise Manager u need to know the default constraint name, u can make use of sp_helpconstraint SP to get the constraint name, Correct me if i'm wrong there is no way you can change the default...

Part and Inventory Search

Back
Top