Viewing 15 posts - 1,576 through 1,590 (of 2,007 total)
SQLRNNR (8/23/2011)
K - new post will be available @ 6:30am PDT on 8/23
Finally able to read it, been waiting all day 😀
I've used your code to add the formatting to...
August 23, 2011 at 7:53 am
tahirayoub (8/23/2011)
in expression it is [dates] but how to splitt it which function of date/time to use and how...
August 23, 2011 at 6:36 am
Not on it's own, no.
IF OBJECT_ID('tempdb..#example') IS NOT NULL
BEGIN
DROP TABLE #example
END
CREATE TABLE #example (id INT PRIMARY KEY IDENTITY(1,1), name VARCHAR(MAX))
CREATE NONCLUSTERED INDEX IDX_NC_temp_example_name ON #example(name)
But you could use it...
August 23, 2011 at 3:41 am
As has been said to you repeatedly, storing dates as anything other than DATE or DATETIME is a recipe for disaster later on.
I've not tested this code, so please test...
August 23, 2011 at 3:36 am
Slightly easier: -
DECLARE @sql AS VARCHAR(MAX)
SELECT @sql = 'SELECT SUM(rn) FROM (' +
ISNULL(STUFF((SELECT ' UNION ALL SELECT COUNT(*) AS rn FROM ' + table_catalog+'.'+table_schema+'.'+table_name
FROM INFORMATION_SCHEMA.TABLES
WHERE table_catalog=db_name() FOR XML PATH('')),1,10,''),'SELECT...
August 19, 2011 at 8:27 am
It sounds like what you're looking for is datediff.
If that doesn't help, please read this post[/url] and supply sample data along with expected output/result.
August 19, 2011 at 2:43 am
forsqlserver (8/19/2011)
Here HRMS persons are not giving rights on there table they only provides data...and the forefront database save the date columns in format of varchar.
Can it possible the date...
August 19, 2011 at 2:36 am
SQLRNNR (8/18/2011)
Cadavre (8/18/2011)
SQLRNNR (8/18/2011)
Well, that is about 12 times faster on my machine. Where did you pick up that trick?I need to delve a bit more into it now.
Not...
August 18, 2011 at 9:41 am
SQLRNNR (8/18/2011)
Well, that is about 12 times faster on my machine. Where did you pick up that trick?I need to delve a bit more into it now.
Not really mine,...
August 18, 2011 at 9:33 am
Nice! Does this improve the performance a little: -
DECLARE @SudokuGivens VARCHAR(100)
SET @SudokuGivens = '53 7 6 195 ...
August 18, 2011 at 8:02 am
Eugene Elutin (8/16/2011)
Just a small problem with using @@rowcount here...It will not return what was required (total number of records before pagiong) but the number of records in the page.
Ah,...
August 16, 2011 at 7:25 am
Vlad-207446 (8/15/2011)
August 16, 2011 at 7:15 am
Is there any problem with just using @@ROWCOUNT ?
DECLARE @RowStart INT
DECLARE @RowEnd INT
SET @RowStart = 1
SET @RowEnd = 100
;WITH CTE AS
(
SELECT *, ROW_NUMBER() OVER(ORDER BY (SELECT NULL))...
August 16, 2011 at 2:39 am
Umm, couldn't you replicate with something like this?
USE databasename
GO
DECLARE @srows INT, @erows INT
SELECT @srows = SUM(a.rows) FROM (SELECT object_name(object_id) AS TableName, rows FROM sys.partitions WHERE index_id IN (0,1)) a
EXEC sp_MSForEachTable...
August 15, 2011 at 10:15 am
Viewing 15 posts - 1,576 through 1,590 (of 2,007 total)