Viewing 15 posts - 31 through 45 (of 51 total)
Do you want to run multiple databases on the same instance and replicate them to another server? If so then yes, it is very possible.
January 14, 2011 at 1:45 am
This works for me on the sample data. Performance might be a problem on large datasets.
CREATE TABLE #tbl1(number INT , animal VARCHAR(10) , grade CHAR(1) )
INSERT INTO #tbl1
select 1,'cat','a'
UNION...
January 4, 2011 at 9:46 am
Second that,
Let SQL server handle the locks and do not give a hint.
Also, SQL will upgrade locks to page locks/ table locks if needed - you do not have to...
December 24, 2010 at 2:50 am
Updated records have a row in the INSERTED and the DELETED table.
Try something like this...
IF ( SELECT count(*) from INSERTED ) > 0 AND ( SELECT count(*) from DELETED...
December 24, 2010 at 2:47 am
I will answer your question by telling you what we did in our database with XML data...
When we stored and queried XML documents in the database, we found querying to...
December 24, 2010 at 2:40 am
Yes,
That's correct.
Just remember that you will still need to supply the order by clause as otherwise you cannot guarantee that the results will be ordered. To change the key just...
December 21, 2010 at 5:26 am
The clustered indes spans both columns as you said. So the table will look like this :
SELECT top 5 [ProductID] , [LocationID] FROM [Production].[ProductInventory]
ProductID LocationID
11
16
150
21
26
Everything is first sorted by the...
December 21, 2010 at 5:07 am
This is the dynamic one. I prefer not to do dynamic SQL in my projects but sometimes it is unavoidable. Maybe see if you can do something on the client...
August 1, 2008 at 3:08 am
This is how to do it if you know how many aliases you are going to have:
;WITH CTE_PIVOT
AS
(
SELECT
Applicationid,
CASE SOURCE WHEN 'AR' THEN applicationname ELSE NULL END AS applicationname,
CASE ROW_NUMBER()...
August 1, 2008 at 2:50 am
This also works for me and seems slightly faster than the convert to varchar.
select f.*
from xxxxflow f
inner join (select
MAX(mstr_ordid) as mstr_ordid,
Ord_Num ,
convert(datetime,(floor(convert(float,date)))) as d1,
convert(datetime,(ceiling(convert(float,date)))) ...
July 31, 2008 at 9:45 am
You can convert the column to an XML datatype. Then you can use Xpath etc to query the xml. You can also create indexes on XML columns so that could...
July 30, 2008 at 10:48 am
Here is my take on it. (90% confident)
Because it is a clustered index, the leaf level pages of the index is the data rows in the table. So you will...
July 30, 2008 at 6:33 am
You specify cascading when you create a table. You use the ON DELETE CASCADE clause.
In the example below, if you delete a line in the purchaseorder table, it will automatically...
July 30, 2008 at 6:27 am
The function takes a text string and converts it to an XML data type and returns the converted XML data.
It seems the input text also is not in the correct...
July 30, 2008 at 6:18 am
This works on my machine. I removed the a. in the set clause, see if it helps...
CREATE TABLE #temptable1(col1 int , col2 int, col3 int, col4 int, col5 int)
CREATE TABLE...
July 29, 2008 at 2:17 am
Viewing 15 posts - 31 through 45 (of 51 total)