Viewing 15 posts - 166 through 180 (of 1,048 total)
Also, be careful while giving alias to a column.
You have put alias to a column as '# of C's' which is also not correct.
It should be like this '# of...
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 13, 2013 at 12:53 am
R u getting any error?
the code you have posted in not corrrect. It should be like this:
Select *
from
(
select [MS], sum ([Vis]) as 'TV',
sum(Round([VIS]*[GR],1)) as '# of C''s'
from [dbo].[Table1]
group by...
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 13, 2013 at 12:45 am
Use SSIS for this... It will be easy 🙂
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 13, 2013 at 12:37 am
When I use only this-
EXE sp_executesql @sql
it works 🙂
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 13, 2013 at 12:02 am
mick burden (9/12/2013)
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 12, 2013 at 6:21 am
Its not a good idea to include all fields in a primary key as it will affect the performance....
Did you try DISTINCT to see how many records you are getting...
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 12, 2013 at 6:19 am
Dave62 (1/28/2010)
When first declared and unset a NULL will be returned.
Only a...
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 12, 2013 at 5:28 am
Recently before attempting the question I read in TSQL fncdamental book that when query filters like WHERE, Having etc used then IN,BETWEEN, LIKE specified as Predicates....
I got correct answer and...
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 12, 2013 at 4:45 am
I don't think its a good idea to reset Identity column every month..rather then that you can truncate the table every month so that Identity gets reseed atuomatically....
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 12, 2013 at 3:37 am
ChrisM@Work (9/12/2013)
The CTE is nothing more than a macro, it will be substituted into the query and result in LEFT() in the join. There's no gain.
Okay..
Thanks for the suggestion Chris...
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 12, 2013 at 2:23 am
What difference will the CTE make, Kapil?
The query should be
SELECT *
FROM Table A
INNER JOIN Table B
ON LEFT(A.UserName, 7) = B.ID
I was jjust trying to eliminate the LEFT from...
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 12, 2013 at 2:09 am
Good basic question and discussion 🙂
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 12, 2013 at 12:04 am
AS Sean said DISTINCT doesn't means that if you get distinct values in some columns then it will be distinct for the rows...
can you please provide a sample result set...
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 11, 2013 at 11:36 pm
Please provide the DDL scripts for the table creation, ddl script to insert some dummy data and desired output...
Please follow the link in my signature and you will find answers...
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 11, 2013 at 11:32 pm
Can you please provide the whole actual code of that fucntion...
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 11, 2013 at 11:29 pm
Viewing 15 posts - 166 through 180 (of 1,048 total)