Viewing 15 posts - 2,131 through 2,145 (of 2,169 total)
Or you could utilize the OPENROWSET function. Example for XLS file below. Read in BOL about CSV file.
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 5.0;HDR=No;IMEX=0;Database=\\someserver\somepath\somefile.xls', 'select * from [Sheet1$b35:q50]')
where f1 in (''a',...
June 7, 2006 at 10:46 pm
Maybe like this?
CREATE PROCEDURE dbo.sp_trouble_codes
AS
select table1.store_id,
count(table2.trouble_code)as 'Total',
sum(case when table2.trouble_code='101258' then 1 else 0 end) 'code_theft',
sum(case when table2.trouble_code='101259' then 1 else 0 end)'code_fire'
sum(case when table2.trouble_code='102103' then 1 else 0 end)...
June 7, 2006 at 9:39 am
I don't think I can make this simpler...
-- Populate test data
declare @t table (row int, path varchar(50))
insert @t
select 92, 'ww.test.com/a' union all
select 91, 'ww.test.com/b' union all
select 87, 'ww.another.com/a' union...
June 7, 2006 at 7:03 am
Most probably you have done a restore. The user is there but not mapped to the current database.
In Users for current database, delete the user in mind. In Security, delete...
June 7, 2006 at 4:56 am
Hrmm...
SELECT GETDATE() AS 'This is current date and time'
SELECT GETDATE() AS [This is current date and time]
In QA, select Query menu and then any of "Results in Text", "Results in...
June 7, 2006 at 4:54 am
Search the forum for a "list split" function. Preferably a function that returns a resultset with all parameters numbered.
June 6, 2006 at 5:37 am
declare @t table (prog varchar(8), cost int)
insert @t
select 'Prog-A', 15000 union all
select 'Prog-B' ,16000 union all
select 'Prog-C', 21000 union all
select 'Prog-D', 17000
select prog 'Program Name',
cost 'Cost',
convert(varchar, (select count(*) from @t...
June 6, 2006 at 4:47 am
I am not sure what you want.
DECLARE @Year SMALLINT
SELECT @Year = 2006
SELECT 1 'Month', 31 'Days' UNION
SELECT 2, CASE WHEN ISDATE(CONVERT(CHAR(4), @Year) +...
June 2, 2006 at 4:54 am
You can make a tremendous improvement for this query! As it is right now, you are selecting the cartesian product (all possible combinations) for the 18 tables you have. That would...
June 2, 2006 at 1:13 am
I just couldn't let this one slip away
Perhaps Ryan can take a look at this approach, even it is not completely setbased. it's...
May 31, 2006 at 4:38 pm
Thank you.
There are some ways to further optimize this solution. If you know you never will have more than 256 "params", and every param has maxlength of 50, shorten the...
May 30, 2006 at 2:44 am
You can have your cake and eat it too. Here is a solution that does not need a function for sorting your strings. I don't know if there...
May 29, 2006 at 5:23 pm
UPDATE TestTbl
SET Task = REPLACE(Task, '&', '&')
That should do the trick.
May 25, 2006 at 9:50 am
And the WHERE clause could be somewhat easier to optimize with
SELECT DISTINCT dbo.cs_ArticleTracking.id,
dbo.cs_ArticleTracking.taskProblem,
dbo.cs_ArticleTracking.dateCreated,
cs_users-firstname + ' ' + cs_users.lastname AS fullname
FROM dbo.cs_ArticleCategories
INNER JOIN dbo.cs_ArticleTracking ON dbo.cs_ArticleCategories.parent = dbo.cs_ArticleTracking.parentcategory AND dbo.cs_ArticleCategories.child = dbo.cs_ArticleTracking.childcategory AND...
May 25, 2006 at 9:46 am
Viewing 15 posts - 2,131 through 2,145 (of 2,169 total)