Viewing 15 posts - 2,476 through 2,490 (of 5,393 total)
kumarreddy72 (10/12/2011)
I resolved my issue by recreating the Index.
However the above query which you have written is not working. it is not returning...
-- Gianluca Sartori
October 12, 2011 at 4:21 am
DECLARE @sql varchar(max)
SET @sql = (
SELECT 'SELECT ' + QUOTENAME(QUOTENAME(TABLE_SCHEMA) + + '.' + QUOTENAME(table_name),'''') +
', * FROM ' + QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(table_name) + ' WHERE CompanyId...
-- Gianluca Sartori
October 12, 2011 at 4:07 am
Sound ok.
You're not using the instance in a production environment, so it should be ok.
-- Gianluca Sartori
October 12, 2011 at 3:34 am
This extracts the indexes that depend on the column.
SELECT A.name
FROM sys.indexes AS A
INNER JOIN sys.index_columns AS B
ON A.object_id = B.object_id
AND A.index_id = B.index_id
INNER JOIN sys.tables AS T
ON T.object_id =...
-- Gianluca Sartori
October 12, 2011 at 3:27 am
You're welcome.
Glad I could help
-- Gianluca Sartori
October 12, 2011 at 3:19 am
In order to change the collation (or any other property) of a column, all dependant objects must be detached.
This means indexes, defaults and the like must be dropped and recreated.
Hope...
-- Gianluca Sartori
October 12, 2011 at 2:48 am
Use a CASE expression in the ORDER BY clause.
DECLARE @Locations TABLE (
LocationName varchar(10)
)
INSERT INTO @Locations VALUES('Africa')
INSERT INTO @Locations VALUES('ASIA')
INSERT INTO @Locations VALUES('America')
INSERT INTO @Locations VALUES('Europa')
SELECT *
FROM @Locations
ORDER BY CASE LocationName...
-- Gianluca Sartori
October 12, 2011 at 2:46 am
Yes, you can.
-- Gianluca Sartori
October 12, 2011 at 2:40 am
If you can't log in, you can't run commands, even from SQLCMD.
You could use the DAC (see here for details) to connect as sysadmin and then change the default DB...
-- Gianluca Sartori
October 12, 2011 at 2:37 am
You could issue
SELECT text
FROM sys.dm_exec_requests
CROSS APPLY sys.dm_exec_sql_text(sql_handle)
WHERE session_id = [SPID causing trouble]
to find out what command the session is running.
Or, even better, you could download and run sp_WhoIsActive by Adam...
-- Gianluca Sartori
October 12, 2011 at 2:34 am
October 12, 2011 at 2:26 am
You didn't give much detail of your issue, but I guess this should do the trick.
DECLARE @A TABLE (
id int,
modifier char(1)
)
INSERT INTO @A VALUES (1, 'a')
INSERT INTO @A VALUES...
-- Gianluca Sartori
October 12, 2011 at 2:25 am
You're welcome.
Glad I could help.
-- Gianluca Sartori
October 12, 2011 at 2:07 am
As I said in my previous post, I don't see a batch file as a the right tool for this job.
However, you could redirect the output of SQLCMD to an...
-- Gianluca Sartori
October 12, 2011 at 2:06 am
You could capture network related wait stats for a single query using extended events.
Paul Randal has a very nice example here: http://sqlskills.com/BLOGS/PAUL/post/Capturing-wait-stats-for-a-single-operation.aspx
Hope this helps
Gianluca
-- Gianluca Sartori
October 11, 2011 at 9:22 am
Viewing 15 posts - 2,476 through 2,490 (of 5,393 total)