Viewing 15 posts - 6,466 through 6,480 (of 8,761 total)
Quick solution using a calculated column
😎
USE tempdb;
GO
SET NOCOUNT ON;
IF OBJECT_ID('dbo.TBL_ROWNUM') IS NOT NULL DROP TABLE dbo.TBL_ROWNUM;
IF OBJECT_ID('dbo.UDF_COUNT_ROWS') IS NOT NULL DROP FUNCTION dbo.UDF_COUNT_ROWS;
DECLARE @COUNT_FUNC NVARCHAR(MAX) = N'
CREATE FUNCTION dbo.UDF_COUNT_ROWS
(
...
December 10, 2014 at 11:04 am
Quick cross-tab solution (hard coded)
😎
USE tempdb;
GO
SET NOCOUNT ON;
IF OBJECT_ID('tempdb..#BATCH') IS NOT NULL DROP TABLE #BATCH;
CREATE TABLE #BATCH
(
batch_Id VARCHAR(36)...
December 10, 2014 at 2:00 am
Quick thought, while the SSH will work it is not a perfect solution, relatively slow, increased attack surface etc.. Why not use ODBC connection from the UX? Or schedule a...
December 9, 2014 at 6:33 pm
Quick solution using the nodes method
😎
USE tempdb;
GO
SET NOCOUNT ON;
DECLARE @MyXML XML
SET @MyXML = '<RS>
<R id="6330">
<WF id="71445">
<WFS id="12790"> <fname>John12790</fname> </WFS>
<WFS id="12791"> <fname>Eric12791</fname> </WFS>
</WF>
</R>
<R id="6331">
<WF id="71446">
<WFS id="12793"> <fname>John12793</fname> </WFS>
<WFS id="12794"> <fname>Eric12794</fname> </WFS>
</WF>
</R>
</RS>';
SELECT...
December 9, 2014 at 8:12 am
Quick joke, 36524 is the number of versions Jeff needs to upgrade on his old test box 😀
😎
December 8, 2014 at 2:06 pm
Koen Verbeeck (12/8/2014)
http://www.sqlservercentral.com/Forums/Topic1636920-391-1.aspx#bm1642200
They enter a reply with the first reply of the thread copied into it (in this case, my reply) and then add a URL.
More annoying...
December 8, 2014 at 1:58 pm
Good points Steve and thank you for this editorial, brought back some nice memories! Back in the "old" days I used to make a living mountaineering and climbing, first rule...
December 8, 2014 at 1:37 pm
DonlSimpson (12/8/2014)
Are you required to store the number with the formatting? It can be easier to apply the formatting when retrieving the phone number.
Quick thought, if there are formatting...
December 8, 2014 at 1:12 pm
DonlSimpson (12/8/2014)
It seems like you might want to consider doing this with a reporting tool rather straight out of sql server.
+1
😎
December 8, 2014 at 1:06 pm
Window function version of Alvin's code
😎
SELECT
State
,ZipCode
,Count(Account) OVER
(
PARTITION...
December 8, 2014 at 8:37 am
Quick solution, counts the spaces after "cleaning" to determin whether there is a format present
😎
USE tempdb;
GO
SET NOCOUNT ON;
;WITH BASE_CLEANING AS
(
SELECT
...
December 8, 2014 at 3:41 am
Quick thought, on a 32 bit version of SQL Server there are severe restrictions not applicable to the 64bit version, even more true with 2012/2014 where the AWE support has...
December 7, 2014 at 2:21 pm
Siva Ramasamy (12/6/2014)
Thanks for your interest in my question.
I have recently inherited the administration responsibilities of a production database (SQL 2012) (around 350GB).
It only had one...
December 7, 2014 at 2:18 pm
The first thought on this problem is not the addition of a column but the design itself, which prompts questions on the role of the table, the practice of adding...
December 7, 2014 at 2:13 pm
BTW the 2014 cardinality estimator goes on a hike on this one, with only handful of rows in the set it estimates 16.4317 rows for both queries, in fact the...
December 7, 2014 at 2:00 pm
Viewing 15 posts - 6,466 through 6,480 (of 8,761 total)