How do i Export a Table from Microsoft SQL Server 2008 R2 to an excel sheet, thanks
I have a table like: ID NAME VAL ———————- 1 a1*a1 90052 2 a1*a2 236 3 a1*a3 56 4 a1*a4 6072 5 a1*a5 1004 6 a2*a2 4576 7 a2*a3 724 8 a2*a4 230 9 a2*a5 679 10 a3*a3 5 11 a3*a4 644 12 a3*a5 23423 13 a4*a4 42354 14 a4*a5 10199 15 a5*a5 10279 Given […]
I created indexed view (clustered unique index on Table1_ID) view with such T-SQL: Select Table1_ID, Count_BIG(*) as Table2TotalCount from Table2 inner join Table1 inner join… where Table2_DeletedMark=0 AND … Group BY Table1_ID Also after creating the view, we set clustered unique index on column Table1_ID. So View consists of two columns: Table1_ID Table2TotalCount T-Sql for […]
I can get information about a linked server using the sp_linked_servers stored procedure. What the SP does not give me, however, is login info entered via sp_addlinkedsrvlogin. How can I tell which login is being used to connect to the linked server?
I have a small problem with an update trigger under SQL Server 2008 R2. I have installed a trigger to log the changes into a log table. This is working fine for me but not when I update multiple rows. CREATE TRIGGER [dbo].[TR_CompaniesUpdated] ON [dbo].[Companies] AFTER UPDATE AS BEGIN SET NOCOUNT ON; DECLARE @Return NVARCHAR(MAX), […]
I’m installing BizTalk 2010 in a clustered environment. There will be a BizTalk cluster in addition to a separate SQL Server cluster. According to my research, with SQL Server 2008 clustering the MSDTC is no longer a requirement for installing the SQL instance. Is it required for BizTalk 2010 to cluster the MSDTC on the […]
What Server Role(s) and/or Database Role(s) must a SQL Login have to do the following: Read Data (including Temp tables) Write Data (including Temp tables) Execute any SP within a database which they are granted access We are migrating from SQL 2000 to 2008 and I’m going through all the Logins and have noticed they […]
It’s like a context space for ants!
I’m having some problems consistently connecting to my database via a connection string from Visual Studio 2010, and in SSMS. The connection string worked reliably for weeks… when I worked with the database in SSMS, the connection string stopped working. “Login failed” error. In my efforts to apply the solutions given to other people with […]
I’ve written this SQL Script: DECLARE @location geography DECLARE @radius int SET @location = (SELECT Location FROM Hydrants WHERE HydrantId = 2) SET @radius = (SELECT Radius FROM Hydrants WHERE HydrantId = 2) SELECT * FROM Sites WHERE @location.STDistance(location) < @radius ORDER BY SiteId ASC I did this to refactor it SELECT * FROM Sites, […]