Viewing 15 posts - 1,066 through 1,080 (of 2,171 total)
UPDATE Table1
SET Quarter = 'Q' + DATENAME(QUARTER, Date) + '/' + DATENAME(YEAR, Date)
February 12, 2008 at 3:52 pm
More items to your toolbox found here.
At least how to format the concatenated string
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254#344547
February 12, 2008 at 1:30 am
More interesting thing on how to format the concatenated string
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254#344547
February 12, 2008 at 1:28 am
-- Prepare sample data
CREATE TABLEtbl_Small
(
SmallID INT IDENTITY(1, 1),
SmallDesc NVARCHAR(50) COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS
)
INSERTtbl_Small
(
SmallDesc
)
SELECT'Desc1' UNION ALL
SELECT'Desc2' UNION ALL
SELECT'Desc3'
CREATE TABLEtbl_Big
(
BigID INT IDENTITY(1, 1),
BigCol1 NVARCHAR(50) COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS,
BigCol2 NVARCHAR(50) COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS,
BigCol3 NVARCHAR(50) COLLATE SQL_LATIN1_GENERAL_CP1_CI_AS,
SmallID INT
)
INSERTtbl_Big
(
BigCol1,
BigCol2,
BigCol3
)
SELECT'asd', 'fgh',...
February 11, 2008 at 9:29 am
WHILE @@Fetch_Status = 0
BEGIN
UPDATEb
SETb.SmallID = CAST((SELECT s.SmallID FROM tbl_Small AS s WHERE s.SmallDesc = @SmallString) AS VARCHAR)
FROMtbl_Big AS b
WHEREb.SmallID = @SmallString
FETCH NEXT FROM smallCursor INTO @smallString
END
February 11, 2008 at 9:27 am
Without knowing the layout (DDL) of your tables, all I can say is
Use a CTE approach.
There are examples in Books Online how to use recursive cte.
February 11, 2008 at 4:42 am
http://www.datamodel.org/NormalizationRules.html
One table Countries
CountryID CountryName
1 USA
2 Sweden
...
Another table
CountryLinks
CountryID LinkType
1 1
1 2
2 1
3 1
3 2
3 3
Where LinkType denotes which type of link that is relevant (much like your bit approach), meaning passport,...
February 7, 2008 at 7:48 am
Here is a few examples how to use OUTPUT
http://weblogs.sqlteam.com/peterl/archive/2007/10/03/New-OUTPUT-operator.aspx
February 7, 2008 at 7:06 am
Read about @@ROWCOUNT in Books Online.
February 7, 2008 at 6:52 am
If you only want positive prices remove the comment markers "--" and make "AND MAX(Price) >= 0" part of the query.
If you leave as is, you could potentially get a...
February 6, 2008 at 9:00 am
Susantha Bathige (2/6/2008)
There is no matter about the IDENTITY property or not.
If you want to update the view with SSMS there is.
It is not a matter if you want to...
February 6, 2008 at 7:37 am
Yes, but the phone table has both TYPE and PHONE columns, which makes me think the table is normalized liek this
TYPE PHONE
HOME 555-5687
CELL 444-45524
And then coalesce...
February 6, 2008 at 3:43 am
Don't be shy Jeff.
Why float is inprecise is discussed here and also explained why.
http://www.sqlservercentral.com/Forums/Topic356756-8-1.aspx
The basic reason is that it is not possible with binary representation to get exactly all possible...
February 6, 2008 at 1:20 am
Viewing 15 posts - 1,066 through 1,080 (of 2,171 total)