First  |  Prev |  Next  |  Last
Pages: 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
Sum and aggregations
Hi all I have 4 tables containing the fields Month (int) and Value (decimal (28,15)), plus various other descriptive fields, and for each month can be present multiple records. Here an example: Create table TableA (month int, decimal value (28,15)) Select * from TableA ----- 1-3.46 2-4.88 2-3,2344 3-... 21 Apr 2010 09:29
Distinct issues
We have procedures that have many DISTINCTs in them. It appears that the original programmer just decided to put DISTINCT on everything. I can't just take them off since there may be a good reason for it to be one or more the queries. Is there an easy way to check if they are needed or not? Thanks, T... 22 Apr 2010 04:07
need help with query
Dear Guru, I need help with sql query that combine two tables, and filter. I have following tables: tblInbox, tblInboxThread, tblInbox ID, UserFrom, UserTo, vSubject, vMessage, dCreateDate tblInboxThread ID, iInboxThread, ThreadUserFrom, ThreadUserTo, vThreadMessage, dCreateDate where... 21 Apr 2010 11:33
Interested in SQL Server Audit Tool
Hi, Nice to hear that you guys are developing an audit tool. I have been working as a SQL DBA for around 4 years now totaling my overall SQL Server experience to 6 years. As a DBA there is something new to learn almost every week. Recently I came across the requirement for auditing. After doing a little rese... 21 Apr 2010 00:07
Help with query
Hello, I need some help with a query that I can't quite figure out the logic for. I need to select the primary key field from table1 where there are no records in which field1 are null and in which the number of records in which field1 =1 is greater than zero. I've tried several permutations to get this query ... 21 Apr 2010 13:38
Qs re CTE
Instead of using recursive CTE you can use FOR XML PATH to concatenate the rows: SELECT DISTINCT A.[Key], C.data FROM DataTable AS A CROSS APPLY (SELECT '' + B.Data FROM DataTable AS B WHERE B.[Key] = A.[Key] ORDER BY B.[No] FOR XML PATH('')) AS C(data); ... 20 Apr 2010 13:27
Database Tuning Advisor - Cannot Initialize Tuning
Cannot either find column "msdb" or the user-defined function or aggregate "msdb.dbo.fn_DTA_unquote_dbname" Has anyone encountered this? SQL Server 2008 SP1. It was a clean isntall. Apparently some of the obkects were not created correctly or at all. I cannot find this function in msdb. ... 22 Apr 2010 09:18
Newsletter System
Hello, I am creating a newsletter system where each newsletter is composed by an image and text. Should I save the entire Newsletter markup on the table? Or should I save the elements as follows: create table dbo.Newsletters ( Id int not null, [Image] varbinary(max) filestream constraint DF_Newsletters... 20 Apr 2010 13:27
temp tables logged?
I was looking at an article that says: ******************************** A side note: Using transient permanent tables for temporary data is never a good idea. Permanent tables require writes to the transaction log, which incur a performance hit. *********************************** Don't inserts, updates and d... 19 Apr 2010 18:50
Dynamic Pivot
I'm trying to create a pivot statement, however, the columns are dynamic in the sense that one month one of the columns could be used and the next it's not... Does anyone know of any good links to handle this situation. Thanks in advance ... 19 Apr 2010 18:50
First  |  Prev |  Next  |  Last
Pages: 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62