Forum Replies Created

Viewing 15 posts - 46 through 60 (of 84 total)

  • RE: CURSOR speed - SQL 2000 vs. SQL 2005

    This is an example of what you are trying to do:

    DECLARE @start_num int

    DECLARE @end_num int

    SET @start_num = 1

    SET @end_num = 10000

    SET NOCOUNT ON

    INSERT INTO OrderItems

    ( OrderID

    ...

  • RE: Help on creating sql statement for selecting date within a date

    Try this:

    CREATE TABLE [dbo].[tblTest_a](

    [aID] [int] NOT NULL,

    [aServerName] [nvarchar](50) NULL,

    [aDateFrom] [smalldatetime] NULL,

    [aDateTo] [smalldatetime] NULL,

    CONSTRAINT [PK_tblTest_a] PRIMARY KEY CLUSTERED

    (

    [aID] ASC

    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY =...

  • RE: HELP --- SQL Programming

    Just to clarify the assumptions I made prior to posting my solution above:

    Your original post said,"...need a script that looks for NULL start and end dates at the bottom level...

  • RE: HELP --- SQL Programming

    This example will:

    * Take each record where the ProjStartDt is NULL,

    * Trim off the last '.' + whatever follows,

    * And, try to match that result with...

  • RE: Order By in Views

    Christian,

    I think what you may be looking for is as follows:

    In SQL Server 2000 you can create a view that includes an ORDER BY in the view's definition.

    Ex. "SELECT TOP...

  • RE: I''''m trying to find a low cost sql reporting tool

    Adding a comment to Jack Corbett's post, you can use MS Access' ADP (project) file type to connect directly to SQL Server.  You won't need to use ODBC.

  • RE: Dynamic SQL but I do not like having to Match on ID in Where Clause in some cases

    You could use CASE statements to include/exclude JOINs as in the example below:

    SELECT @sql =

    'SELECT a.[FirstName] + '' '' + a.[LastName] AS FullName,

      s.[Phone] AS Phone,

      s.[HomePhone]...

  • RE: Restoring a database from a different database backup...

    If you are using Enterprise Manager:

    > Right-click the WFSA_dev database

    > Select "Restore Database" (the Restore database dialog box will display)

    > Using the combo-box: "Show backups of database:" select WFSA

    > The...

  • RE: Insert 5 rows in one table based on row count of Another Table

    You can use a CROSS JOIN to include all rows from both tables. For example:

    Assuming the following:

    1. Model office table: tblMO with column MOnum.

    2. Condition table: tblCondition with column Condnum.

    3....

  • RE: String Manipulation Help

    This will also work:

    Declare @Path as nvarchar(1000)

    Update aTableRecordCount

    Set @Path = Replace( Path,'        \', '\'),

        @Path = Replace(@Path,'       \', '\'),

        @Path = Replace(@Path,'      \', '\'),

        @Path = Replace(@Path,'     \', '\'),

        @Path...

  • RE: Access 2003 .adp Subform problem

    Paul,

    Access .mdb's and .adp's can get bloated over time when objects are being modified.  One thing worth doing from time to time is "Decompile" the database file.  Start MS Access...

  • RE: Dynamic SQL. How to use it for all databases

    /*

    This is a simple example of dynamically building a script and dynamically executing it against multiple databases.

    Notice the square brackets [ ] around the @DBName.  This would be required for...

  • RE: Performance issue with SQL Server 2000

    Just an idea:

    If you have a large table, with a Clustered index on anything but an identity column, performance can really suffer.  This is especially true when INSERT statements are...

  • RE: Linking to tables in Informix

    Just an idea:

     

    I have to retrieve data from tables on an AS400, and use a...

  • RE: Automated "Developer" restore design

    We refresh our test databases weekly with a scheduled SQL Agent Job.

    The following is example code, similar to one of our Job steps.

    I hope this helps.

    --This solution requires you to...

Viewing 15 posts - 46 through 60 (of 84 total)