Viewing 15 posts - 4,846 through 4,860 (of 10,144 total)
You don't need dynamic SQL to overcomplicate this, or a cursor to make it run slowly:
DECLARE @CurrentRowCount INT
SELECT @CurrentRowCount = COUNT(*)
FROM [DB_admin1].[dbo].[tblRenewals]
INSERT INTO rept.tblSubscribedSystems
([systemNum]
,[dtuStart]
,[dtuEnd]
,[total])
SELECT
REN.[SystemNum]
,REN.[Date] AS SubStart
,x.SubEnd
,rn = @CurrentRowCount...
April 11, 2013 at 5:59 am
mamzy.rahman (4/11/2013)
April 11, 2013 at 4:24 am
In the little query I wrote above, change #Sample to aims.
Just this query, not the sample data generator:
-- solution
SELECT COUNT(L01)
FROM #Sample s
WHERE NOT EXISTS (
SELECT 1
FROM #Sample si
WHERE...
April 11, 2013 at 4:14 am
mamzy.rahman (4/11/2013)
i cant create just query 🙁
What is the name of the table you are using?
April 11, 2013 at 4:08 am
mamzy.rahman (4/11/2013)
hi thanks for your efforts but i cannot drop the tables is there a way of doing it without altering any of the tables
-- create some sample data to...
April 11, 2013 at 4:05 am
-- create some sample data to test against
DROP TABLE #Sample
CREATE TABLE #Sample (L01 INT, a09 CHAR(1))
INSERT INTO #Sample (L01, a09)
SELECT 123, '1' UNION ALL
SELECT 123, '2' UNION ALL
SELECT 123, 'z'...
April 11, 2013 at 3:58 am
-- Here's the last change.
USE [Build1]
SELECT
td.TYPE_NAME
,i.DOC_NAME
,i.DOC
,i.SEC
,i.VER
,r.JUSTIFICATION
FROM TBL_INSTANCES i
INNER JOIN TBL_TYPE_DEF td
ON i.TYPE_ID = td.TYPE_ID
LEFT JOIN TBL_RELATIONSHIPS r
ON i.DOC = r.PARENT_DOC
AND i.SEC = r.PARENT_SEC
AND i.VER =...
April 11, 2013 at 3:28 am
Thanks to Lynn & Sean for the formatted query:
-- code rewrites are iterative in nature. You make a change or two,
-- test thoroughly, amend if necessary, then make another change.
--...
April 11, 2013 at 3:16 am
Kurtman (4/10/2013)
April 11, 2013 at 1:17 am
T.Ashish (4/10/2013)
It comes from Java Code, like ......where Site_id = :lablesiteid....
-- Query 2
SELECT
TOP 100 comp_id,
sup_code,
sup_name,
sup_ac_code,(
...
April 11, 2013 at 1:07 am
adonetok (4/10/2013)
In ServerA, there is a query like below.
select * from [ServerB].order.dbo.allorder where city='london'
Question:
Which server will process data?
1) processing...
April 10, 2013 at 9:31 am
T.Ashish (4/10/2013)
April 10, 2013 at 9:30 am
Same as any other index:
SELECT DB_NAME(database_id) AS [Database Name], OBJECT_NAME(ps.OBJECT_ID) AS [Object Name],
i.name AS [Index Name], ps.index_id, index_type_desc,
avg_fragmentation_in_percent, fragment_count, page_count
FROM sys.dm_db_index_physical_stats(DB_ID(),NULL, NULL, NULL ,N'LIMITED') AS ps
INNER JOIN sys.indexes...
April 10, 2013 at 8:20 am
Krasavita (4/10/2013)
Yes,this is just for tables,what about any changes on database?
Default trace[/url] could provide most of what you're looking for.
April 10, 2013 at 7:49 am
sqldba_newbie (4/10/2013)
ChrisM@Work (4/10/2013)
sqldba_newbie (4/9/2013)
April 10, 2013 at 6:55 am
Viewing 15 posts - 4,846 through 4,860 (of 10,144 total)