Viewing 15 posts - 166 through 180 (of 206 total)
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...
July 29, 2009 at 12:28 pm
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....
July 29, 2009 at 9:02 am
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...
July 29, 2009 at 7:59 am
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...
July 29, 2009 at 6:49 am
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...
July 28, 2009 at 2:27 pm
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...
July 28, 2009 at 12:49 pm
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...
July 28, 2009 at 11:07 am
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...
July 28, 2009 at 11:01 am
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...
July 28, 2009 at 8:41 am
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...
July 27, 2009 at 12:35 pm
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...
July 27, 2009 at 12:02 pm
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-- Run print @restoredb first to view the databases to be restored
-- When ready, run exec (@restoredb)
-- EXEC (@restoredb)
Try uncommenting the EXEC line
July 27, 2009 at 8:35 am
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
July 27, 2009 at 6:54 am
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'
July 27, 2009 at 6:42 am
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,...
July 24, 2009 at 11:24 am
Viewing 15 posts - 166 through 180 (of 206 total)