Viewing 15 posts - 6,556 through 6,570 (of 8,731 total)
gbritton1 (4/24/2014)
http://www.brentozar.com/archive/2012/07/identifying-correcting-sql-server-implicit-conversion/
I stopped relying on implicit conversion years ago. In fact, in all languages I write I try to adhere to the "Explicit...
April 24, 2014 at 9:38 am
Sean Lange (4/24/2014)
Or you could use an identity column and use ASCIIEncoding to convert the value to a...
April 24, 2014 at 9:22 am
gbritton1 (4/24/2014)
Luis Cazares (4/24/2014)
You don't need explicit conversion. The insert will handle it implicitly.
Sure, but Explicit is better than Implicit. SQL Server sometimes does not give you the implicit...
April 24, 2014 at 9:04 am
Stop working to get something you could easily get by using Identity or SEQUENCE as stated by twin.devil.
You should use a PK (or unique) constraint as well to ensure uniqueness....
April 24, 2014 at 9:00 am
David Burrows (4/23/2014)
;WITH cte (ProductId,Pos) AS (
SELECT ProductId,
RANK() OVER(PARTITION BY SaleYear,SaleWeek ORDER BY Quantity DESC)
FROM SalesData)
SELECT ProductId,SUM(1-SIGN(Pos-1))
FROM cte
GROUP BY ProductId
This is clever: SUM(1-SIGN(Pos-1))...
April 24, 2014 at 8:53 am
This might be simpler.
WITH Clm2Values AS(
SELECT Clm1,
CASE Clm1 WHEN 'Trauma' THEN 1
...
April 24, 2014 at 8:44 am
You don't need explicit conversion. The insert will handle it implicitly.
CREATE TABLE #Testchar(
myvarchar nvarchar(10)
)
CREATE TABLE #Testfloat(
myfloat float
)
INSERT #Testchar VALUES('3.14159E0')
SELECT *...
April 24, 2014 at 8:35 am
Have you read about the Delimited8kSplitter?
Check it on this article: http://www.sqlservercentral.com/articles/Tally+Table/72993/
It will show you how it works and how to use it.;-)
April 23, 2014 at 3:15 pm
I would create an additional table to include the item's codes conversion. That way you can add it to your joins to keep an equality.
April 23, 2014 at 1:44 pm
Can you explain why is this not correct?
SET DATEFIRST 1;
WITH SampleData (PERSON, [DATE], [HOURS], [DOW]) AS
(
SELECT...
April 23, 2014 at 12:59 pm
I can understand the need to prevent the use in production code, but not in ad-hoc queries when developing and testing (I often use it to evaluate a table structure).
You...
April 23, 2014 at 10:24 am
MMartin1 (4/22/2014)
April 22, 2014 at 1:30 pm
allaspects (4/9/2014)
Lynn is obviously trolling. Sad that on a resource such as this website, someone is out to troll and not help.That's why the world can't have nice things.
That's a...
April 9, 2014 at 2:28 pm
Maybe you could do some networking if there's a local PASS chapter near you.
http://www.sqlpass.org/PASSChapters/LocalChapters.aspx
That way you'll be able to speak with SQL Server professionals and prove that you might be...
April 9, 2014 at 1:41 pm
Viewing 15 posts - 6,556 through 6,570 (of 8,731 total)