Viewing 15 posts - 76 through 90 (of 167 total)
You can also "see" the non-grouped columns within a given group if you can specifically select for them with a known column value within an aggregate operator. So, if each...
January 15, 2008 at 9:28 am
And yet again using Select ... Into ...
if object_Id('tempdb.dbo.#t1') is not null drop table dbo.#t1
if object_Id('tempdb.dbo.#t2') is not null drop table dbo.#t2
select 'Smith'[LName],'Randy'[FName] into dbo.#t1
union all select 'Smith','John'
union all select...
January 11, 2008 at 11:42 am
Ya, I agree, the order of the data is important. It generally works for my jobs as the natural order of the data is correct for this process. However, you...
January 11, 2008 at 10:35 am
Nobody mentioned that you could use UPDATE. Add in integer column and try this:
Declare @PrevGroupingColumn VarChar(256),@i Int
Select @PrevGroupingColumn='' -- Any value that would not occur in the grouping column.
Update dbo.YourTable...
January 11, 2008 at 9:13 am
... and sometimes its just better to SELECT ... INTO ... the stuff you want to keep and then rebuild indices and other stuff afterwards on that smaller dataset. Just...
December 6, 2007 at 8:14 am
Try this...
Select * from dbo.YourTable
where SomeCol like '%[^ -~]%' collate Latin1_General_BIN
the key here is to specify a binary collation type so that the like-mask works as you would expect.
the like...
August 3, 2007 at 8:26 am
Have we learned nothing from the dark ages of "religious" intolerance...
July 25, 2007 at 9:29 am
You need to specify a collation that distinguishes between upper and lower case, such as...
declare @Pattern varchar(250)
set @Pattern = '%['+char(190)+'-'+char(192)+']%'
SELECT PATINDEX (@Pattern collate Latin1_General_BIN,'abcdefghijk')
July 25, 2007 at 9:15 am
You could select each query into a temp table or temp variable saving each @@RowCount then if both row counts are not zero select both tables with Union All...
July 24, 2007 at 8:08 am
I would sort the data locally at the app. That way the user could change his mind after the initial fetch of the data and could have it re-sorted WITHOUT...
July 20, 2007 at 9:37 am
In light of the unanswered "edge" conditions how about this?
Use TempDB
If Object_Id('dbo.test') is not Null Drop table dbo.Test
Select '123'[CharNum] into dbo.Test
Union All Select '0123'
Union All Select '000123'
Union All Select '000'
Union...
July 20, 2007 at 9:32 am
Try this:
Declare @i Int,@Domain VarChar(256)
Select
@i=CharIndex('\',suser_sname()),
@i=Case @i when 0 then 0 else @i-1 End,
@Domain=Left(suser_sname(),@i)
Print @Domain
July 16, 2007 at 9:49 am
Hmmm, forgot to adjust the code for the variables...
*If* you could add an Identity column to your data when you import it (ordered properly), you could:
Declare @Lo Int,@Hi Int
Select...
June 19, 2007 at 8:25 am
*If* you could add an Identity column to your data when you import it (ordered properly), you could:
Declare @Lo Int,@Hi Int
Select @Lo=Ident_Current('dbo.Data')*0.10,@Hi=Ident_Current('dbo.Data')-@Lo
Select * from dbo.Data where Ident between Ident_Current('dbo.Data')*0.10...
June 19, 2007 at 8:24 am
If your shop permits controlled use of xp_CmdShell I would use WinZIPs (v9 or greater) command-line module. With it you can compress (multiple levels) and encrypt (multiple techniques) your backup files simultaneously....
June 14, 2007 at 8:15 am
Viewing 15 posts - 76 through 90 (of 167 total)