Viewing 15 posts - 6,451 through 6,465 (of 8,761 total)
Ashish Dutt (12/11/2014)
But I'm greeted with the following error on executing the query you posted.
Msg 102, Level 15, State 1, Line 13
Incorrect syntax near 'b'.
The error...
December 12, 2014 at 9:15 am
There are few ways of doing this, here is a quick window function solution for SQL Server 2012/14
π
USE tempdb;
GO
SET NOCOUNT ON;
IF OBJECT_ID('dbo.TBL_LABEL') IS NOT NULL DROP TABLE dbo.TBL_LABEL;
CREATE TABLE dbo.TBL_LABEL
(
...
December 12, 2014 at 12:57 am
Quick thought, switch from group by to window function with output de-duplication
π
use MICE
SELECT
*
into School_Perform_Data_2020
FROM
(
select
ROW_NUMBER() OVER
(
...
December 11, 2014 at 10:33 pm
SQL!$@w$0ME (12/11/2014)
We are migrating from sql2005 to sql2014. Should I go with SQL2014 RTM and wait for SP1 rather than installing RTM+CU4?Many thanks in advance.
My advice is to go for...
December 11, 2014 at 10:25 pm
Quick thought, looks like somewhere in the dataflow a column or set of columns are defined as unicode (65001), look out for DT_WSTR or DT_NTEXT in the column properties.
π
December 11, 2014 at 10:18 pm
Further on Grant't post, here's a code snip for retrieving the execution plan
π
USE tempdb;
GO
SET NOCOUNT ON;
/*
The query
*/
select
*
from sys.objects
/* get the execution plan */
;WITH XMLNAMESPACES...
December 11, 2014 at 2:35 pm
Sean Lange (12/11/2014)
Eirikur Eiriksson (12/11/2014)
Quick and simple row_number solutionπ
This looks pretty close to mine. Just before I posted my solution I saw that the OP wanted the closest date that...
December 11, 2014 at 1:08 pm
Quick and simple row_number solution
π
USE tempdb;
GO
SET NOCOUNT ON;
IF OBJECT_ID('tempdb..#TestTable') IS NOT NULL DROP TABLE #TestTable;
SELECT PK, Terminal, MarketDate = CAST(d.MarketDate AS DATETIME)
,d.Prod, d.Cost
INTO #TestTable
FROM (
SELECT 1, 1, '2014-12-01 15:04:00.000','A', 2.23...
December 11, 2014 at 12:49 pm
peter.cox (12/11/2014)
It was just a business requirement to search a free form field. Obviously with that being the case, people have the ability to put the data in...
December 11, 2014 at 7:15 am
Try this for a size
π
declare @storedprocedure_name nvarchar(30) = 'my_proc_name';
SELECT N'USE ' + DB_NAME() + NCHAR(59) + NCHAR(13) + NCHAR(10) +
N'IF EXISTS (SELECT * FROM sysobjects...
December 10, 2014 at 3:44 pm
Luis Cazares (12/10/2014)
This isn't pretty, but it might be what you need to handle one to many relationships between managers and employees.
Has the appeal of Cusano Rojo:rolleyes:,but it works
π
December 10, 2014 at 2:38 pm
Alan.B (12/10/2014)
Wouldn't this be faster?
-- the function
CREATE FUNCTION dbo.DIGITSONLYAB(@pstring varchar(8000))
RETURNS TABLE WITH SCHEMABINDING AS
RETURN SELECT ISALLDIGITS = CASE PATINDEX('%[^0-9]%',@pstring) WHEN 0 THEN 1...
December 10, 2014 at 1:39 pm
djj (12/10/2014)
December 10, 2014 at 1:37 pm
I know itΒ΄s not perfect, the dynamic is just to contain the whole thing in a single batch, took it from an old code of mine which took the table...
December 10, 2014 at 12:38 pm
Good catch, never tested the functions for a null value:pinch:, here is a revised version
π
/* Eirikur's modification of Jeff's Modification of Erikur's Function */
GO
IF OBJECT_ID('dbo.DigitsOnlyEE') IS NOT NULL DROP FUNCTION...
December 10, 2014 at 12:33 pm
Viewing 15 posts - 6,451 through 6,465 (of 8,761 total)