Viewing 15 posts - 511 through 525 (of 2,171 total)
Another test
-- Prepare sample data
CREATE TABLECharlesZ
(
i INT IDENTITY(1, 1) PRIMARY KEY CLUSTERED,
ss VARCHAR(MAX) NOT NULL
)
-- Display index page information
DBCC IND(Test, CharlesZ, 1)
-- Insert short string
INSERTCharlesZ
SELECT'Peter Larsson'
-- Display table data
SELECTi,
ss,
DATALENGTH(ss) AS...
February 4, 2009 at 6:28 am
An example...
-- Prepare sample data
CREATE TABLECharlesZ
(
i INT IDENTITY(1, 1) PRIMARY KEY CLUSTERED,
ss VARCHAR(MAX) NOT NULL
)
-- Insert short string
INSERTCharlesZ
SELECT'Peter Larsson'
-- Insert long string
DECLARE@ls VARCHAR(MAX)
SET@ls = REPLICATE('Z', 8000)
February 4, 2009 at 6:23 am
charlesz (2/3/2009)
As I said in previous post, for a column mostly stores very short strings, the overhead of Varchar(MAX) is significant.
There is no overhead when the "string size" is less...
February 4, 2009 at 6:12 am
Normally the SQL Server thinks 32 is the limit and stops execution with an error.
See Books Online for Nested Triggers and Recursive Triggers.
February 2, 2009 at 9:50 am
The trigger is updating the same base table on where the trigger is resided.
So when the trigger updates the two columns, the same trigger is fired again!
And again.. And again...
February 2, 2009 at 8:28 am
No need to check for UPDATE, DELETE or INSERT.
Trigger is designed for UPDATE.
Also, the trigger is nesting itself by updating the table for which the trigger ís triggering on...
Use this
CREATE...
February 2, 2009 at 8:03 am
VARCHAR(MAX) uses the normal datapages until the content actually fills 8k of data.
When overflow happens, data is stored as old TEXT, IMAGE and a pointer is replacing the old content.
February 2, 2009 at 7:56 am
Maybe someone fluent in Spanish shoulf ask him to post the dts-file here so that we can investigate the package for him?
January 28, 2009 at 2:35 pm
Jeff Moden (1/28/2009)
Increase performance of queries that use deterministic computed columns.
Persisted computed columns can also be indexed 🙂
http://msdn.microsoft.com/en-us/library/ms189292(SQL.90).aspx
January 28, 2009 at 11:34 am
Another aspect of using table variables is that there are no statistics available for them.
Thus Query Optimizer always assumes there is one and only one record in the table variable.
This...
January 28, 2009 at 5:57 am
With SQL Server 2008
CREATE NONCLUSTERED INDEX IX_MyBitField ON MyTable (MyBitField)
WHERE MyBitField = 1
January 22, 2009 at 11:25 pm
This?
DECLARE@View1 TABLE
(
vw1id INT,
vw1date DATETIME
)
INSERT@View1
SELECT2, '2009-02-01' UNION ALL
SELECT3, '2009-03-01'
DECLARE@View2 TABLE
(
vw2id INT,
vw2date DATETIME
)
INSERT@View2
SELECT4, '2009-03-01' UNION ALL
SELECT6, '2009-05-01'
DECLARE@View3 TABLE
(
vw3id INT,
vw3date DATETIME
)
INSERT@View3
SELECT2, '2009-02-01' UNION ALL
SELECT7, '2009-03-01' UNION ALL
SELECT6, '2009-05-01'
SELECTvw1.vw1id,
vw1.vw1date,
vw2.vw2id,
vw2.vw2date,
vw3.vw3id,
vw3.vw3date
FROM(
SELECTvw1id,
vw1date,
ROW_NUMBER() OVER (ORDER BY vw1date) AS...
January 16, 2009 at 9:09 am
Add a ROW_NUMBER() for each view, and then do a FULL JOIN when combining the three views on the ROW_NUMBER() column.
January 15, 2009 at 1:39 pm
Make sure you include the primary key for each and one table involved in view.
January 15, 2009 at 7:55 am
Viewing 15 posts - 511 through 525 (of 2,171 total)