Viewing 15 posts - 3,376 through 3,390 (of 5,588 total)
loki1049 (9/2/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 12:55 pm
mfowler12 (9/2/2010)
There are over 6800 records in the database, will this code cause any problems with the other records?
This code will:
1. update any records in the main table that match...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 12:44 pm
The money datatype is essentially numeric(19,4). To add a fifth decimal place, you'll have to change this to numeric(20,5).
For example:
if object_id('tempdb..#temp') IS NOT NULL DROP TABLE #temp;
CREATE TABLE #temp (MoneyField...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 12:36 pm
If you have SSRS available, I'd set up a report that is based off of the login, and have each user schedule to run it.
If you want to do this...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 12:17 pm
SELECT st.name, sip.rows
FROM sys.system_internals_partitions sip
JOIN sys.tables st ON st.object_id = sip.object_id
ORDER BY st.name
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 12:11 pm
CirquedeSQLeil (9/2/2010)
Ok. What if you need to do this after it rolls to production?
Just drop the tables, add them, add the data, add the FKs. 😛 😉 :w00t:
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 12:02 pm
Steve Jones - Editor (9/2/2010)
Noooooooo, not partial posts. There can be enough nonsense in this thread already.
Steve Jones - Editor (9/2/2010)
Wh t bo t t s as a p...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 11:58 am
Alvin Ramard (9/2/2010)
Make that 25.3/day
DECLARE @PostCount AS INT
SET @PostCount = 18052
SELECT CONVERT(NUMERIC(5,1), (20000.0 - @PostCount)/ DATEDIFF(DAY, GETDATE(), '2010-11-18'))
Looks like we made today's quote, just figuring out how to do that...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 11:56 am
No.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 11:48 am
loki1049 (9/2/2010)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 11:46 am
I don't think you're doing anything wrong. However, it sounds like the last table has a 1>Many relationship, and there are multiple records matching for the join condition.
You either need...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 11:41 am
This should handle your insert. Make sure you test it in a transaction first, take appropriate backups, etc.
-- update the existing entries based on the ID column.
UPDATE survey
...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 11:30 am
mfowler12 (9/2/2010)
WayneS (9/2/2010)
mfowler12 (9/2/2010)
So, how do I link the tables so that the data...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 10:49 am
Jim-720070 (9/2/2010)
Thanks for your help!
Dan, The problem is that for each ID I want every day of the month (or selected time period). So because there are three ID's...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 10:41 am
mfowler12 (9/2/2010)
So, how do I link the tables so that the data can be...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
September 2, 2010 at 10:17 am
Viewing 15 posts - 3,376 through 3,390 (of 5,588 total)