Viewing 15 posts - 16 through 30 (of 89 total)
You cannot just change the type in syscolumns. Even though you may only store integer data in a varchar column, the data is not stored the same way in the...
July 13, 2007 at 8:55 am
You can use PATINDEX to find the location of the pipe and then use that in the substring function.
July 9, 2007 at 2:02 pm
You are doing the query for multiple encounters, so won't you have multiple records in the #Sps table? Do you just want the first record? Min/Max?
You will need to set the...
July 9, 2007 at 12:30 pm
If I read your code correctly, you only insert into the #Log table if the #Sps table is empty. If so, you don't have any values in the FirstEncDt or...
July 9, 2007 at 12:19 pm
Look at the code for sp_spaceused to get the exact. But here is a quick, and fairly accurate way.
SELECT so.Name, SUM(dpages)*8/1024. pagesMB, SUM(Reserved)*8/1024. reservedMB
FROM sysobjects so, sysindexes si
where so.type='u'
and so.id=si.id
group...
June 22, 2007 at 2:47 pm
Are the dev and prod databases similar in size and data? Did your prod query have an order by clause that you didn't include on the dev query?
Brian
May 30, 2007 at 10:47 am
I would also suggest using the column list to guarantee the data is inserted properly. Otherwise you can have problems if the columns are not in the same order, or...
May 25, 2007 at 2:56 pm
If you use Windows Authentication for the database connections, you will use your login when you run it manually. However, when you schedule it to run, it will use the...
May 21, 2007 at 10:58 am
So you want to set the RegionID value to the maximum empid for a given city?
UPDATE e
SET RegionID=t.EmpID
FROM table_Employees e, (SELECT CityID, MAX(EmpID) EmpID FROM table_Employees GROUP BY CityID) t
WHERE...
May 17, 2007 at 7:21 am
ROWCOUNT limits the number of rows a query will use. ROWCOUNT n - n is the number of rows you want to return. 0 is unlimited.
SET ROWCOUNT 1
SELECT *...
May 16, 2007 at 8:30 am
What is the DDL for table_employees and your procedure? I would tend to think that EmpID would be unique for each record in table_Employees. If so, why would you need...
May 15, 2007 at 10:13 am
You only escape out the character if you are using LIKE.
='%'
Brian
May 11, 2007 at 3:54 pm
May 10, 2007 at 3:27 pm
I stand corrected. Thanks Greg and Steve. I should have my coffee before I start typing.
May 7, 2007 at 8:52 am
Viewing 15 posts - 16 through 30 (of 89 total)