Forum Replies Created

Viewing 15 posts - 166 through 180 (of 206 total)

  • RE: multiple params for where condition ??

    So without doing any SQL yet, let me make sure I got this correct.

    1) You have an application that allows users to enter an indeterminate amout of characters into...

  • RE: multiple params for where condition ??

    You can change you select query above to this:

    select * from #table

    where

    ([Description] like '%Speed%' AND [Description] like '%Fuel Efficient%')

    OR ([description] LIKE '%Sports Utility%')

    This will get rid of the error....

  • RE: Issues with OSQL

    Try moving the -Q to before the query you are executing. I had the same behavior when I ran this with the -Q on the end.

    osql.exe -S MyServer -d...

  • RE: Query Help?

    I am not sure this satisfies your requirements but it does get you one row per ID. The names would be in a comma separated list. I couldn't...

  • RE: SQL Statement (Grouping)

    I couldn't figure it out without using a function but here is what I did.

    IF (SELECT OBJECT_ID('tempTable')) IS NOT NULL

    DROP TABLE tempTable

    CREATE TABLE tempTable (class VARCHAR(10), [date] DATETIME, NAME VARCHAR(10))

    INSERT...

  • RE: Query Help?

    create table #temp1

    (

    name varchar(10),

    ID int

    )

    insert into #temp1

    select 'John',1 union

    select 'Jane',1 union

    select 'Fred',2 union

    select 'Adam',3 union

    select 'Paul',4 union

    select...

  • RE: sp_spaceused columns/attributes

    You can view the code for the sp_spaceused procedure in the master database. You can't change it but you could write you own procedure for just that data you...

  • RE: Transposing rows into columns based on primary key

    This is hard to do without the table definition and sample data but you could try something with the row_number() function.

    SELECT data1, data2, data3, row_number() OVER (PARTITION BY data1, data2...

  • RE: Need help locating my problem

    SELECT *, (3959 * acos( cos(radians

    ((SELECT lng FROM zipCodeLookup WHERE zipcode = '15205')))

    * cos(radians(lat))

    * cos(radians(lng) - radians

    ((SELECT lat FROM zipCodeLookup WHERE zipcode = '15205')))

    + sin (radians

    ((SELECT lng FROM zipCodeLookup WHERE...

  • RE: Increment ItemNo based on condtion

    This is probably the long way around but you can try something like this:

    CREATE TABLE #temp(

    [test] [int] NOT NULL,

    [ID] [int] NOT NULL IDENTITY(1,1),

    ) ON [PRIMARY]

    INSERT INTO #temp

    SELECT clientorder_id

    FROM table2 a

    ORDER...

  • RE: Increment ItemNo based on condtion

    If the only thing you are concerned about it the output you could use this:

    SELECT clientorder_id, ROW_NUMBER () OVER (PARTITION BY clientorder_id order BY clientorder_id)

    FROM table2

    However, if you have...

  • RE: Ran the script but no databases restored

    --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    -- Run print @restoredb first to view the databases to be restored

    -- When ready, run exec (@restoredb)

    -- EXEC (@restoredb)

    Try uncommenting the EXEC line

  • RE: SQLCMD Problem

    This worked for me

    FOR /F "tokens=1" %%a in (SERVERLIST.txt) DO SQLCMD -S %%a -E -i test.sql -o results.txt

    the file name shouldn't be quoted.

    Let me know if that works

  • RE: Copy File from Server machine to Client

    While it is best practice to have it disabled you could use the xp_cmdshell command. Syntax would be: xp_cmdshell 'copy c:\temp\whatever.txt \\ipaddress\share\whatever.txt'

  • RE: Securing Stored Procedures from being seen

    Sorry, I don't have a SQL 2000 to test with. It is harder to do in 2000 but schemas would be the owner. You have objects (tables, views,...

Viewing 15 posts - 166 through 180 (of 206 total)