Viewing 15 posts - 286 through 300 (of 444 total)
MaggieW (12/10/2014)
Dear all:I created an application that will upload a csv file and insert it to a SQL table.
Can you share apllication code? Is it T-Sql, c#, ... ?
December 11, 2014 at 1:17 am
Jeff, thank you for pointing perfomance issue out. I would also note that it would be so simple for MS to add parent reference to the sp_dirtree output thus eliminating...
December 11, 2014 at 12:37 am
Nulls may be of different types. So nulls in some columns may be a problem. HASHBYTES raises an error on 'untyped' null. Compare
select HASHBYTES('MD5', ''+null);
select HASHBYTES('MD5', cast(null as char(1)));
select...
December 10, 2014 at 2:01 am
Try to specify COLLATE for every char column in ORDER BY.
...
ORDER BY container COLLATE Persian_100_CI_AS, isfile, subdirectory COLLATE Persian_100_CI_AS;
Also note the difference between case sensitive and case insensitive collations...
December 10, 2014 at 1:46 am
Try
...
Group by OrderID,PackageID, CustomerName, Colors
BTW, i see no Child2ID in your Child2.
And I'd better normalize Child1 and Child2 to simplify queries. It can also really help with...
December 9, 2014 at 1:05 am
You may also try FISRT_VALUE(), LAST_VALUE() instead of firstApply, secondApply.
December 8, 2014 at 5:45 am
Specify proper collation for the column in ORDER BY
See http://msdn.microsoft.com/ru-ru/library/ms184391.aspx
Not sure which one is for Persian.
December 8, 2014 at 5:40 am
This batch will show all objects (directories, files) and their full paths
--parameter
declare @myPath nvarchar(4000) = 'E:\ElectronicArchieve';
IF OBJECT_ID('tempdb..#DirectoryTree') IS NOT NULL
DROP TABLE #DirectoryTree;
CREATE TABLE #DirectoryTree (
id int IDENTITY(1,1)
,subdirectory nvarchar(512)
,depth int
,isfile...
December 8, 2014 at 4:55 am
I'm a bit confused.
If you already have loaded dir structure into archive as it was discussed here http://www.sqlservercentral.com/Forums/Topic1640110-391-1.aspx then you can just run the last query in the...
December 8, 2014 at 3:30 am
OK, then LAG() is the best choice as it was proposed by colleages.
with [AAA_Mytable] as(
select *
from (
values
(12, N'2011', 18314, N'HBPP112', NULL)
,(13, N'2012', 18314, N'BACS315',...
December 8, 2014 at 1:58 am
Shadab Shah (12/5/2014)
Koen Verbeeck (12/5/2014)
What is your business logic? Why would you select (X,Y,60) and not (Y,X,60)?
Well, there is no business logic. It can be anything, i was trying out...
December 5, 2014 at 3:47 am
kevin_nikolai (12/5/2014)
Based on [dbo].[AAA_Mytable], you get the following:
TermCalendarIDRegYearStudentUID Qual Rollover
2 2011 ...
December 5, 2014 at 3:26 am
Last portion of @dsql, why not just
DECLARE @dsql varchar(1000) = N'
WITH searchtext(searchtext) AS (SELECT REPLACE(@searchtext,''*'',''%''))
SELECT ParamValue = @ParamValue, ParamCaption = @ParamCaption
FROM '+ /* Your clean string...
December 5, 2014 at 2:53 am
There are many ways to do that. For example
select c1 = case when City2 > City1 then City1 else City2 end
, c2 = case when City2 > City1 then City2...
December 5, 2014 at 2:29 am
Hi Kevin.
Your second table definition greatly differs from the first one. While
the first one allows something like (don't know if it makes any sense)
TermCalendarIDRegYearStudentUIDQualYear1QualYear2QualYear3QualYear4QualYear5Rollover
220118314HBPP112NULLNULLNULLNULLNULL
320128314NULLBACS315NULLNULLNULLNULL
420138314NULLBACS315NULLNULLNULLNULL
520148314NULLNULLBACS315NULLNULLNULL
620158314NULLNULLNULLBACS315NULLNULL
, the second one has...
December 5, 2014 at 1:30 am
Viewing 15 posts - 286 through 300 (of 444 total)