[SQL Server 2008 issues] Large Records -- No Successfull Result |
- Large Records -- No Successfull Result
- Stored procedure executing another SP
- How to send email after job fail or complete in sql server agent
- Tcp/ip port named instance
- Installing Windows Server 2008 on Windows 7 Pro
- SSPI handshake failed with error code 0x8009030c...Someone help please
- How to format the data in column in sql server
- collation difficulties when BULK inserting CP1 data in Japanese server
- general
- Microsoft Access forms/queries to Filter SQL Tables
- Trying to access the Report Manager URL Though newly added identity for Reportmanager
- SP producing an impossible error
- Errors in SQL Server
- Conversion failed...!!!
- How to insert result from cross-tab query into a table?
- Do I need a group by to get last value ??
- Time out error.
- How to create Distribution Group in sql server 2008?
- Find records that match two criteria
- SQL 2008 64 bit, SSIS & Excel (ACE OLE DB driver)
- Need tree structure
- Rebuild index maintenance plan
- Query to search for a substring in xml
- Restoring failed
- Index Rebuild Failed - Need More Information
- How to get user position in table i.e 1st 2nd, 3rd
- Script Out Database Mail Settings?
- MDX Query
- Is this behavior is by design
- DBCC CHECKDB performance
- regarding restore problem
- Disk format as 64KB
Large Records -- No Successfull Result Posted: 24 Jun 2013 01:01 AM PDT Hi Team,I've a simple table USG_Data with below columns, but having 2.5 lac records.id, Name, Address, City, Phone.when i select count(*) from USG_Data, gettting result with count of records, butwhen i select * from USG_Data am not gettting the complete result set, after displaying some records sql server displaying that execuing query....Want to know the reason please. |
Stored procedure executing another SP Posted: 23 Jun 2013 11:31 PM PDT Hi allI have stored procedure DoTransactions that is used to create a number of transactions in a database where the front-end application would usually have done the data inserts/updates. The SP on completion (whether failure or success) then passes a identifying ID to another stored procedure SendEmail which in turn sends an e-mail to a user confirming that the process had completed with whatever results.DoTransactions must run as a specific SQL user. The transactions it creates all confirm whether this user is created in the application tables and has sufficient rights. When logged into SSMS as this user and manually executing DoTransactions, SendEmail sends e-mails without any problem. DoTransactions however has to be scheduled to run hourly and I have set up a SQL Agent job for this. The job executes as the specific user and I know that is working correctly or else all the transactions would fail. It also successfully executes stored procedure SendEmail however in SendEmail there is a check that always fails (below) although the job step completes correctly:[code="sql"]IF EXISTS ( SELECT * FROM master.dbo.sysdatabases s WHERE s.name = 'msdb' )[/code]If logged into SSMS as the specific SQL user, I can execute the above and get the expected result although from the job it seemingly doesn't. Is it possible that the user executing SendEmail differs from the one executing the job (and therefore DoTransactions)?Snippet where DoTransactions calls SendEmail:[code="sql"]EXEC SendEmail @logid[/code]Snippet where SendEmail always fails when executed from DoTransaction via SQL Agent. It always ends up at 'Database "msdb" does NOT exist':[code="sql"]IF EXISTS ( SELECT * FROM master.dbo.sysdatabases s WHERE s.name = 'msdb' ) BEGIN PRINT 'Database "msdb" does exist.' IF EXISTS ( SELECT * FROM msdb.sys.objects so JOIN msdb.sys.schemas sc ON so.schema_id = sc.schema_id WHERE so.name = 'sp_send_dbmail' AND sc.name = 'dbo' ) BEGIN IF EXISTS ( SELECT * FROM msdb.dbo.sysmail_profile ) BEGIN DECLARE @MailSubject NVARCHAR(MAX), @ProfileName NVARCHAR(128) SELECT @ProfileName = s.name FROM msdb.dbo.sysmail_profile s IF NOT EXISTS ( SELECT * FROM msdb.dbo.sysmail_principalprofile p WHERE p.principal_sid = 0x00 ) BEGIN EXECUTE msdb.dbo.sysmail_add_principalprofile_sp @principal_name = 'public', @profile_name = @ProfileName, @is_default = 1 ; END EXEC MSDB.dbo.sp_send_dbmail @profile_name = @ProfileName, @recipients = 'test@test.test', @subject = 'Automated Notification: DoTransactions', @body = @MailOutBody, @body_format = 'TEXT', @importance = 'NORMAL' END END ELSE BEGIN PRINT 'Procedure "dbo.sp_send_dbmail" does NOT exist.' END ENDELSE BEGIN PRINT 'Database "msdb" does NOT exist.' END[/code]I appreciate that I could remove most of the checks above so that it simply sends the e-mail or even copy the above into DoTransactions so that I know the correct user is running this piece of SQL but I would like to understand better why this is happening in SQL Agent and not SSMS. |
How to send email after job fail or complete in sql server agent Posted: 24 Jun 2013 05:37 PM PDT I am created a job for run .dts and after job is completed or failed I want to send mail to another person . How can I do.!! I'am sorry for my English language . I'am Thai. I live in BangkokThank you very much |
Posted: 24 Jun 2013 07:25 AM PDT Hi -I have setup a clustered server, I used named instance for both active/passive. The tcp port is set to dynamic sdince it is a named instance, I know if you use default the port is set to 1433. What happens if you have an application using default port number 1433 hard coded? Should I change the port to a static 1433 or leave the settings as is? Thanks,Lava |
Installing Windows Server 2008 on Windows 7 Pro Posted: 24 Jun 2013 03:45 AM PDT HiI have installed Windows 7 pro installed on my pc on 'C' partition. Have two other spare partitions D and E drives. I download Windows Server 2008 with genuine key. I have tried to install Windows Server 2008 R2 through setup.exe file. I created bootable dvd which does not boot. Each time I run setup file I get error:"Microsoft .NET Framework 3.5 installation has failed.SQL Server 2008 Setup requires .NET Framework to be installed."I came across this website while searching for answers:{So, if it can't find it, it won't install it. According to the developer team at Microsoft, the error code means the setup can't determine the version of .NET contained on the media for your architecture. Therefore, ensure your media contains the following paths and .NET EXE packages: ia64\redist\DotNetFrameworks\dotNetFx35setup.exex86\redist\DotNetFrameworks\dotNetFx35setup.exex64\redist\DotNetFrameworks\dotNetFx35setup.exeIf you find the dotNetFx35setup.exe among the installation files, you can create these paths, and rerun setup again. This particular fix has gotten me past the .NET v.3.5 failed error.}My question is where do I create the above path is it on my pc which has Windows 7 Pro installed or do I create above path in the installation files I have on dvd or copied files of server 2008 on my D drive?Please can someone advise me, I cannot seem to get pass this error:Microsoft .NET Framework 3.5 SP1 installation has failed.SQL Server 2008 Setup requires .NET Framework 3.5 SP1 to be installed.I have checked my Windows 7 Pro installed on C drive, .NET 3.5 and 4.0 versions are installed.Not sure how to get past this error?Please can someone help?Raghbir |
SSPI handshake failed with error code 0x8009030c...Someone help please Posted: 12 Mar 2012 10:11 PM PDT a new instance of SQL Server 2008 was installed and it would only allow you enter with Windows authentication. When you try sa logon it fails. Please what's the issue? I saw this error in the Event viewer log, thought it might be connected:SSPI handshake failed with error code 0x8009030c, state 14 while establishing a connection with integrated security; the connection has been closed. Reason: AcceptSecurityContext failed. The Windows error code indicates the cause of failure. [CLIENT: 192.168.43.69]. Any solutions?Charles. |
How to format the data in column in sql server Posted: 12 Jun 2013 12:38 PM PDT Hi, Please help me, In my table have a one date column. It contains data in different formats .I want to set all these different formats into a single format. Like... Date 10.12.2012 ---in this '10' is Day and 12 is Month and then Year. 12-10-2012 10.12.2012 2012/10/12 |
collation difficulties when BULK inserting CP1 data in Japanese server Posted: 24 Jun 2013 10:26 AM PDT I'm experiencing confusing behavior when bulk inserting data in SQL_Latin1_General_CP1_CI_AS, on a Japanese server. Extended characters like é are being converted to question marks when selected. This makes me think it's being converted to Unicode somewhere, but I'm not really sure where to look or where the conversion could occur... as part of the BULK load? During the insert? Maybe during the select?Here are the different components:1. Unzip text file and load it with:MERGE INTO [table] AS [alias] USING (SELECT [columns] FROM OPENROWSET (BULK [datafile], FORMATFILE=[formatfile] ...2. The format file specifies the columns like:2 SQLCHAR 0 0 "\"|" 1 MYCOL1 SQL_Latin1_General_CP1_CI_AS3. The table columns are VARCHAR and have SQL_Latin1_General_CP1_CI_AS collation. However, the database itself could be something else (? - it's not my database so I don't have all the details yet). It might be Japanese or Unicode or Latin1_General_CI_AS.4. When I select in SQL Server Management Studio:SELECT mycol FROM mytable WHERE active='yes';I get cells like:Associ?Unfortunately, I can't reproduce this on my own laptop/server which is a US configuration. I've fiddled around to change settings to Japanese but I always get the correct answer:AssociéeRight now I'm not even sure where to look. Maybe the issue is with the command, maybe with the table, maybe even with how I'm using SQL Server Management Studio? Can anybody provide a suggestion for narrowing down the problem further? |
Posted: 23 Jun 2013 11:39 PM PDT i have table with name orders and field as order_number,order_amt,order_date,order_customer,order_salepersoni want to write a query that selects all orders save those with zeroes or NULLs in the order_amt field.how can i do this? |
Microsoft Access forms/queries to Filter SQL Tables Posted: 24 Jun 2013 03:29 AM PDT Question/Problem: I am using Microsoft Access forms/queries to filter on a SQL table as in the following:SELECT dbo_Premier.CustName, dbo_Premier.Address, dbo_Premier.City, dbo_Premier.State, dbo_Premier.[Zip Code]FROM dbo_PremierWHERE (((dbo_Premier.Address) Like [Forms]![frmRosterSearch]![FindAdd] & "*"));This filter returns incorrect results. The results seem to have no logical pattern that I can see what my error is. It appears the correct records are returned, but with lots of incorrect results also.When I do the exact same filter on a local table in Microsoft Access with the same information in it, the results are returned correctly. At first I thought that somehow maybe the information wasn't being cleared out of the SQL table correctly because weekly I clear and repopulate this table, however, when I tried to build a brand new table in SQL from the local table, the filter was still incorrect. Using:SQLServer 2008 StandardAccess 2007 |
Trying to access the Report Manager URL Though newly added identity for Reportmanager Posted: 24 Jun 2013 08:54 AM PDT Hi ,Hi All,I've installed the SQl Server 2012 Reporting services and configured it to the default URL i.e (http://localhost:80/Reports) but when I hit advanced and try to add an other URL like (http://devreports.company.com:80/Reports) Iam able to add but not able to see any thing when i use the new URL that i just added. I first get prompted to log on, and then after several attempts I end up at a blank screen.We made the DNS name (devreports.company.com) resolve to servers IP address .Please through some light .Thanks, |
SP producing an impossible error Posted: 24 Jun 2013 08:08 AM PDT ISSUE: Application is throwing UNIQUE KEY insert errors in PROD that [i]should[/i] be logically impossible from the stored procedure that is generating them. The error would be expected with the previous version of the proc, but proc is confirmed (via definiton in sys.sql_modules) as new code that should not produce this error.The proc is a fairly standard IF NOT EXISTS INSERT ELSE SELECT Existing matching row. Multiple people have reviewed that there should be no way to reach the INSERT if the record is a duplicate. FWIW, this proc was recently upgraded to this pattern from a basic INSERT statement with no checking for uniquenessThis morning the same test case would reliably cause the same error in DEV. I execute the SQL code as an ad-hoc query with identical parameters in DEV through SSMS (instead of the application) Oddly, this ran without out error, and [i]the failing test case suddenly started working in DEV, and has never failed since[/i].I attempted running the code ad hoc in Production. It did run, but did not cause the test case to start working.We've recompiled the SP, rebuilt all relevant Indexes and Statistics, with no success.We've confirmed that both procs are identical in definition in both environments. Application code is identical in both environments.I've got a request started to do a profiler trace in PROD to see exactly what is being run and exactly what the arguments are. However, it will take some time before it will be run due to the red-tape associated with production apps.Any suggestion on what might be causing a stored proc to execute as a previous version of itself rather than it's modern version? If so, how can I force the PROD version to refresh its cached version? Any likely alternate causes (other than it might be executing its previous version)? |
Posted: 24 Jun 2013 02:52 AM PDT Other than the SQL Server Logs, SQL Server Agent Logs, and Event Viewer; is there another place to view error information regarding SQL Server? My SR. DBA, is stating there is and wants me to figure it out on my own. Which I have been trying to.I have been Googling to see if there are system tables that contain error information (I am not finding any), searching for DMV's that may contain this information (not finding any), found the sp_readerrorlog/xp_readerrorlog but they tell me the same thing that I see when viewing the log via SSMS and googled RAISERROR to see how it works and where it writes to, etc....We are using a RAISERROR function to log errors, is there a certain log file that these are written to?Any and All help will be greatly appreciated...Thank You |
Posted: 24 Jun 2013 07:45 AM PDT create table #temp(id int,strg varchar (5),[index] tinyint)insert into #tempvalues (1, 'abc', 1)declare @strg varchar (5)select @strg = case when ID = 1 and [INDEX] = 1 then strg else 0 endfrom #tempselect @strg Msg 245, Level 16, State 1, Line 12Conversion failed when converting the varchar value 'abc' to data type int.what is wrong here??Thanks.. |
How to insert result from cross-tab query into a table? Posted: 24 Jun 2013 06:44 AM PDT I used code below to create a cross-tab query. It works fine.How to insert result from cross-tab query into a table?SELECT *FROM ( SELECT year(invoiceDate) as [year],left(datename(month,invoicedate),3)as [month], InvoiceAmount as Amount FROM Invoice) as sPIVOT( SUM(Amount) FOR [month] IN (jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec))AS pivot |
Do I need a group by to get last value ?? Posted: 24 Jun 2013 05:35 AM PDT HiI will butcher this question...I am selecting data where I assign a value to a field where the first character is a value for its position and the second the valueexample a is first and b is second, so field is 1A OR 2B call it BOXsome records have more than one value on the same day but I want the one if the first positionso I order by name, date, BOX descI want just the last value for the name and the dateI am try to put this in a matrix SSRS report so my end results would look sort of like. Date Date ....name A Aname2 B A .. etcThanksJoe |
Posted: 24 Jun 2013 01:43 AM PDT Hi, When a user tries to edit a table, he is getting a timeout error.Here is a brief details about the error."Executed SQL Stmnts: "the stmnts" from dbo.tablename,Error source: .Net SqlClient Data ProviderError Message: Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding."Also, when he tries to do a select query, it prompts him to login the server\instance again, eventhough he is already logged in.Please share your knowledge, if you know about this error.Thanks,SueTons. |
How to create Distribution Group in sql server 2008? Posted: 24 Jun 2013 03:15 AM PDT I need to create a Distribution Group in sql server 2008, i have 100 SQL Users who wants readonly Access on SOme Databases :w00t:, now i dont want to create individual logins for them.. so how to do this easily??Please provide detailed information ;-) |
Find records that match two criteria Posted: 24 Jun 2013 02:59 AM PDT In the table Diagnosis I am trying to pull only those records that have left(Code,3)='491' AND Code of '305.1'Any thoughts?[code="sql"]create table Diagnosis(IDXMRN varchar(10),Problem varchar(100),Code varchar(6))insert into Diagnosis(IDXMRN, Problem, Code) values('00001768','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00003060','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00003172','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00003239','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00003239','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00003239','COPD exacerbation','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00004700','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00006190','Chronic bronchitis with emphysema','491.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00006190','Chronic bronchitis with emphysema','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00006578','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00006578','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00008365','Obstructive chronic bronchitis','491.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00008671','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00008671','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00008821','COPD with acute bronchitis','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00008821','COPD with acute bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00009274','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00009274','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00009274','COPD exacerbation','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00010684','Chronic Bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00010777','COPD (unspecified)','491.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00013245','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00014171','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00014171','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00014171','COPD exacerbation','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00015281','Obstructive Chronic Bronchitis With Acute Exacerbation','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00015281','Obstructive Chronic Bronchitis With Acute Exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00016275','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00016275','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00019049','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00019049','COPD with acute bronchitis','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00019049','COPD with acute bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00019492','Obstructive Chronic Bronchitis With Acute Exacerbation','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00023687','Diffuse Obstructive Chronic Bronchitis','491.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00027188','COPD with acute bronchitis','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00027188','COPD with acute bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00029298','Chronic Bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00031647','Chronic Bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00031647','Chronic Bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00031647','Chronic Bronchitis','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00033274','Obstructive Chronic Bronchitis With Acute Exacerbation','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00033274','Obstructive Chronic Bronchitis With Acute Exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00038404','COPD with acute bronchitis','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00040058','Obstructive chronic bronchitis','491.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00040058','Obstructive chronic bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00040737','COPD (unspecified)','491.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00041056','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00043090','COPD with acute bronchitis','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00043090','COPD with acute bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00043090','COPD with acute bronchitis','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00045601','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00047657','Chronic Bronchitis With Acute Exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00048938','Obstructive chronic bronchitis','491.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00048938','Obstructive chronic bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00048938','Obstructive chronic bronchitis','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00049077','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00050611','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00050611','Chronic bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00051378','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00051378','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00052112','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00052112','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00052676','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00052676','Chronic bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00053093','Chronic Bronchitis With Acute Exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00053661','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00053661','COPD with acute bronchitis','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00053661','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00055080','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00056369','COPD (unspecified)','491.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00056595','COPD with acute bronchitis','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00056595','COPD with acute bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00056595','COPD with acute bronchitis','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00059502','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00061302','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00063289','COPD (unspecified)','491.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00063289','Obstructive Chronic Bronchitis With Acute Exacerbation','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00063289','COPD (unspecified)','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00063289','Obstructive Chronic Bronchitis With Acute Exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00063289','COPD (unspecified)','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00063453','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00063453','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00064343','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00064343','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00064343','COPD exacerbation','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00068729','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00069423','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00071895','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00071895','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00071895','COPD exacerbation','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00072552','Chronic Bronchitis With Acute Exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('077171','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('077171','Chronic bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00079358','Chronic Bronchitis With Acute Exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00079705','Chronic Bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00079705','Chronic Bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00079752','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00081150','COPD with acute bronchitis','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00081150','COPD with acute bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00081150','COPD with acute bronchitis','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00085093','Chronic Bronchitis With Acute Exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00085093','Diffuse Obstructive Chronic Bronchitis','491.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00085093','Chronic Bronchitis With Acute Exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00085093','Diffuse Obstructive Chronic Bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00086068','Obstructive Chronic Bronchitis With Acute Exacerbation','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00090144','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00092788','COPD with acute bronchitis','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00092788','COPD with acute bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00092798','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00092798','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00095573','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00095573','Chronic bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00101205','Obstructive Chronic Bronchitis With Acute Exacerbation','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00101205','Obstructive Chronic Bronchitis With Acute Exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00103728','Chronic Bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00103744','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00104403','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00104403','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00104403','COPD exacerbation','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00105083','Obstructive chronic bronchitis','491.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00105083','Obstructive chronic bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00105868','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00107160','Chronic Bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00110001','Chronic bronchitis with emphysema','491.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00110001','Chronic bronchitis with emphysema','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00110001','Chronic bronchitis with emphysema','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00111896','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00113969','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00113969','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00114392','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00114392','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00114776','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00115426','Chronic Bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00115426','Chronic Bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00116270','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00117604','COPD with acute bronchitis','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00118102','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00118102','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00118335','COPD with acute bronchitis','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00118335','COPD with acute bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00119326','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00119363','COPD with acute bronchitis','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00119363','COPD with acute bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00119701','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('00119701','COPD with acute bronchitis','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00121040','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00121040','Chronic bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00122601','COPD with acute bronchitis','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00500487','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00504921','COPD with acute bronchitis','491.22')insert into Diagnosis(IDXMRN, Problem, Code) values('00504921','COPD with acute bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00504921','COPD with acute bronchitis','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00529796','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00529796','Chronic bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00562184','Obstructive chronic bronchitis','491.2')insert into Diagnosis(IDXMRN, Problem, Code) values('00562184','Obstructive chronic bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00593674','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('00593674','Chronic bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('00593674','Chronic bronchitis','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('724341','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('724341','COPD exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('724341','Chronic bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('724341','COPD exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('736385','Chronic bronchitis','491.9')insert into Diagnosis(IDXMRN, Problem, Code) values('788882','Chronic Bronchitis With Acute Exacerbation','491.21')insert into Diagnosis(IDXMRN, Problem, Code) values('788882','Diffuse Obstructive Chronic Bronchitis','491.2')insert into Diagnosis(IDXMRN, Problem, Code) values('788882','Chronic Bronchitis With Acute Exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('788882','Diffuse Obstructive Chronic Bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('788882','Chronic Bronchitis With Acute Exacerbation','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('788882','Diffuse Obstructive Chronic Bronchitis','493.2')insert into Diagnosis(IDXMRN, Problem, Code) values('724399','Chronic bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('736399','Chronic bronchitis','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('788899','Chronic Bronchitis With Acute Exacerbation','305.1')insert into Diagnosis(IDXMRN, Problem, Code) values('788999','Diffuse Obstructive Chronic Bronchitis','305.1')[/code] |
SQL 2008 64 bit, SSIS & Excel (ACE OLE DB driver) Posted: 02 Jun 2010 10:17 AM PDT Specs:[b]Windows Server 2003 R2 x64 SP2SQL Server 2008 10.0.2531 (64 bit)Visual Studio 2008 v9.0.30729.1 SP.NET Framework v 3.5 SP1[/b]I noticed that Microsoft finally came out with a 64 bit version of their ACE OLE DB driver for connection to Excel. I downloaded it from Microsoft downloads (Microsoft Access Database Engine 2010 Redistributable). I have several SSIS packages that need to output SQL data to Excel files (.xls & .xlsx). This works just fine in 32 bit mode using the 32 bit version of the download, but fails in 64 bit mode with the following error:[i]Error: 2010-06-02 19:12:44.11 Code: 0xC00F9304 Source: ExcelTest Connection manager "Excel 2007 Connection Manager" Description: SSIS Error Code DTS_E_OLEDB_EXCEL_NOT_SUPPORTED: The Excel Connection Manager is not supported in the 64-bit version of SSIS, as no OLE DB provider is available. End Error Error: 2010-06-02 19:12:44.11 Code: 0xC020801C Source: Data Flow Task 2007 Excel 2007 Destination 1 [19] Description: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel 2007 Connection Manager" failed with error code 0xC00F9304. There may be error messages posted before this with more information on why the AcquireConnection method call failed. End Error Error: 2010-06-02 19:12:44.11 Code: 0xC0047017 Source: Data Flow Task 2007 SSIS.Pipeline Description: component "Excel 2007 Destination 1" (19) failed validation and returned error code 0xC020801C. End Error[/i]So, essentially, it doesn't recognize the 64 bit drivers as being installed. What's also maddening is that you can't install the 32 bit and 64 bit drivers side-by-side, so any troubleshooting in BIDS is completely useless. Had anyone else run into this? |
Posted: 23 Jun 2013 10:52 PM PDT Hi,Please find the following script.Basically I want the tree structure to find the parent templates.It should be 'N'number of output.But current i can get only two set of output.Before cursor one set of parent templates, after cursor second set of parent templates..Actual work for the below script: giving input, it finds all parent template(before cursor) and am sending the result to cursor-its giving another set of parent list.But again after cursor, what ever templates is displaying it can call from other templates.So the tree structure keep on goes. Please help me how can i do it dynamically or any other way to get the 'N'number of parent templates.I can't go another cursor, its really bad way.it should like 'tony>test1>test3>datatest>1>2>3>5>..................>>> .. keep on goes.IF OBJECT_ID('helper_template') IS NOT NULLBEGIN DROP PROC kbmhelper_templateENDGOCREATE PROCEDURE helper_template ( @input VARCHAR(100) ) AS BEGINSET NOCOUNT ONdeclare @table_name varchar(35)declare @field_name varchar(35)IF OBJECT_ID('tempdb..#Search_results') IS NOT NULLBEGIN DROP TABLE #Search_resultsENDcreate table #Search_results ( called_from varchar(35), template_display_name Varchar(200) default '', field VARCHAR(300), field_name VARCHAR(200), field_value VARCHAR(200), template_type varchar(200) default '' , con_template_field varchar(2000) default '' )CREATE NONCLUSTERED INDEX IX_NON_RESULTON #search_results(called_from) insert into #Search_results (called_from, field, field_name,field_value) select distinct template_name, tr.field, '' ,@input from test tr WITH(NOLOCK) inner join templates t WITH(NOLOCK) on tr.template_id = t.template_id where tr.action in ('launch template', 'template pop-up') and tr.parm1 = @input and tr.parm1 not like ('{%') and tr.parm1 not like ('@%') UNION ALL select distinct t.template_name,tr.field, xr.field_name,xr.field_value from test tr WITH(NOLOCK) inner join test_1 xr WITH(NOLOCK) on tr.parm2 = cast(xr.trig_id as varchar(50)) inner join templates t WITH(NOLOCK) on tr.template_id = t.template_id and tr.action = 'assign field value' and '{'+xr.field_name+'}' in ( select parm1 from test where action in ('launch template', 'template pop-up') and parm1 like '{%' and template_id = xr.template_id ) and xr.field_value = '"'+@input+'"' and xr.field_value not like '{%' and xr.field_value <> '""' UNION ALL select distinct t.template_name,tr.field,xr.field_name,xr.field_value from test tr WITH(NOLOCK) inner join test_1 xr WITH(NOLOCK) on tr.parm2 = cast(xr.trig_id as varchar(50)) inner join templates t WITH(NOLOCK) on tr.template_id = t.template_id and tr.action = 'assign field value' and xr.field_name in ( select parm1 from test WITH(NOLOCK) where action in ('launch template', 'template pop-up') and parm1 like '@%' and template_id = xr.template_id ) and xr.field_value = '"'+@input+'"' and xr.field_value not like '{%' and xr.field_value <> '""' UNION ALL select distinct table_name,'',tf.field_name,@input from template_fields tf WITH(NOLOCK) where table_name not like '%[_]' and table_name <> '' and default_value <> '' and default_value not like 'summary%' and default_value not like '%Sheet%' and field_type <> 'spgrd' and default_value <> 'Family Unit' and field_type <> 'relation' and table_name not in ('date', 'data', 'data_in') and field_name = @input UNION ALL select distinct t.template_name,tr.field,tm.field_name,tm.field_value from test_1 tm join test tr WITH(NOLOCK) on tm.template_id = tr.template_id join templates t on tr.template_id = t.template_id where tr.action in ('launch template','template pop-up') and tm.field_name = Replace(REPLACE(tr.parm1,'{',''),'}','') and REPLACE(tm.field_value,'"','') = @input UPDATE st set st.template_type = t.template_type, st.template_display_name = t.template_display_nameFROM #Search_results STJOIN templates t on st.called_from = t.template_name UPDATE sr set con_template_field = @input +' > '+ called_from +' (Field: '+sr.field+') (Template Type: '+sr.template_type+')'FROM #Search_results sr --select distinct called_from,template_display_name,field, field_name,field_value,template_type ,con_template_field--from #Search_results WITH(NOLOCK) --order by called_from IF OBJECT_ID('tempdb..#final_results') IS NOT NULLBEGIN DROP TABLE #final_resultsENDCREATE TABLE #Final_results ( parent_name Varchar(100), parent_field Varchar(300), parent_type VARCHAR(100), child_name VARCHAR(100), child_field VARCHAR(200), child_flow VARCHAR(500), parent_flow VARCHAR(500) ) CREATE NONCLUSTERED INDEX IX_NON_FINALON #final_results(parent_name) DECLARE @template_name VARCHAR(100)DECLARE @child_field VARCHAR(200)DECLARE Cur_results CURSOR FORSELECT called_from, fieldFROM #Search_results ORDER BY called_fromOPEN Cur_resultsFETCH NEXT FROM Cur_results INTO @template_name, @child_fieldWHILE @@FETCH_STATUS = 0BEGIN insert into #Final_results (parent_name) select distinct template_name from test tr WITH(NOLOCK) inner join templates t on tr.template_id = t.template_id where tr.action in ('launch template', 'template pop-up') and tr.parm1 = @template_name and tr.parm1 not like ('{%') and tr.parm1 not like ('@%') UNION ALL select distinct t.template_name from test tr WITH(NOLOCK) inner join test_1 xr WITH(NOLOCK) on tr.parm2 = cast(xr.trig_id as varchar(50)) inner join templates t WITH(NOLOCK) on tr.template_id = t.template_id and tr.action = 'assign field value' and '{'+xr.field_name+'}' in ( select parm1 from test where action in ('launch template', 'template pop-up') --and parm1 like '{%' AND PATINDEX('{%',parm1)>0 and template_id = xr.template_id ) and xr.field_value = '"'+@template_name+'"' and xr.field_value not like '{%' and xr.field_value <> '""' UNION ALL select distinct t.template_name from test tr WITH(NOLOCK) inner join test_1 xr WITH(NOLOCK) on tr.parm2 = cast(xr.trig_id as varchar(50)) inner join templates t WITH(NOLOCK) on tr.template_id = t.template_id and tr.action = 'assign field value' and xr.field_name in ( select parm1 from test WITH(NOLOCK) where action in ('launch template', 'template pop-up') --and parm1 like '@%' and PATINDEX('@%',parm1)>0 and template_id = xr.template_id ) and xr.field_value = '"'+@template_name+'"' and xr.field_value not like '{%' and xr.field_value <> '""' UNION ALL select distinct table_name from template_fields tf WITH(NOLOCK) where table_name not like '%[_]' and table_name <> '' and default_value <> '' and default_value not like 'summary%' and default_value not like '%Sheet%' and field_type <> 'spgrd' and default_value <> 'Family Unit' and field_type <> 'relation' and table_name not in ('person', 'patient', 'person_encounter') and field_name = @template_name UNION ALL select distinct t.template_name--,tr.field,tm.field_name,tm.field_value from test_1 tm WITH(NOLOCK) join test tr WITH(NOLOCK) on tm.template_id = tr.template_id join templates t on tr.template_id = t.template_id where tr.action in ('launch template','template pop-up') and tm.field_name = Replace(REPLACE(tr.parm1,'{',''),'}','') and REPLACE(field_value,'"','') = @template_name UPDATE FS SET FS.parent_field = TR.field, FS.parent_type = T.template_type, FS.child_name = @template_name from #Final_results FS join templates t on FS.parent_name = t.template_name join test tr on t.template_id = tr.template_id where tr.parm1 = @template_name FETCH NEXT FROM Cur_results INTO @template_name, @child_fieldENDCLOSE Cur_resultsDEALLOCATE Cur_resultsSELECT DISTINCT parent_name, parent_field, parent_type, t.template_display_name as 'Parent_display_name', child_name FROM #Final_results fr WITH(NOLOCK)JOIN templates t on fr.parent_name = t.template_nameWHERE parent_field is not nullAND parent_name not in (select distinct called_From from #Search_results WITH(NOLOCK))--@input +' > '+ called_from +' (Field: '+sr.field+') (Field Value: '+sr.field_value+') (Template Type: '+sr.template_type+')'select distinct Case when sr.called_from = fr.child_name then sr.con_template_field +' > '+ fr.parent_name +' (Field: '+fr.parent_field+') (Template Type: '+fr.parent_type+')' else sr.con_template_field end AS 'Template Workflow'from #Search_results srleft join #Final_results fron sr.called_from = fr.child_nameorder by Case when sr.called_from = fr.child_name then sr.con_template_field +' > '+ fr.parent_name +' (Field: '+fr.parent_field+') (Template Type: '+fr.parent_type+')' else sr.con_template_field endSET NOCOUNT OFFendThanks,Tony |
Rebuild index maintenance plan Posted: 23 Jun 2013 10:42 PM PDT A bit of a under the hood question as it where.When using the maintenance task to rebuild indexes and specifying ALL does the process ignore indexes if the fragmentation is low, below 10% for example or if the pages are < 1000?Many thanks |
Query to search for a substring in xml Posted: 24 Jun 2013 12:29 AM PDT I use below query to search for a substring in whole xml(including node name and node value)[code="sql"]SELECT * FROM tablename WHERE ( Charindex('abc',CAST([xmlcolumn] AS VARCHAR(MAX)))>0 ) [/code]I want an alternative query which has good performance than this. So please suggest some. |
Posted: 23 Jun 2013 08:19 PM PDT Hi all, When i am trying to restore a database with the backup i am getting this error06/24/2013 14:30:54,spid59,Unknown,The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\IPE_OCT_120_log'.06/24/2013 14:30:54,spid59,Unknown,Error: 3634<c/> Severity: 16<c/> State: 1.i am unable to figure it out. |
Index Rebuild Failed - Need More Information Posted: 24 Jun 2013 12:24 AM PDT I have an Index Rebuild that has been failing. It fails on the same table/index everytime. Looking at this history of the index job, I see entries like this, "Rebuild - [PK_CCX] [SQLSTATE 01000] (Message 0)" and then the very last entry is, "Rebuild - [PK_CCW_TOX] [SQLSTAT... The step failed." I am needing to find more information on this failure. I have checked the SQL Agent Error Logs and there is not a whole lot there, as in maybe 25 entries total. I then try the SQL Server Error Logs and search for the index and nothing comes back.I have queried the table to see if there is some data out of place for these two columns that make up the PK and everything seems correct. To add to this, the table is not very big (almost makes me wonder why it needs to be rebuild, but I can worry about that once I get this corrected).Can anyone point me in the right direction on where I can look to get more information on why this Index Rebuild is failing?Any and all advice on this subject will be greatly appreciated...Thank You. |
How to get user position in table i.e 1st 2nd, 3rd Posted: 19 Jun 2013 07:09 PM PDT hello,Im having a bit of trouble trying to return the current users position, iv been looking at this for the past 3 days browsed many forums tried many situations but with still no luck.I have a table called prospectlead which has a column called ReviewedBy this gets populated when the user checks a record etcthe desired output would be 1st John2nd Me3rd Sarah This will obviously change throughout the day depending on how the individuals get on, so mid morning i could go from 2nd position down to 10th but i need to return my position plus the person above me and the person below me, the way im getting the amount of records checked is by using a COUNT, the parameter passed in to the stored procedure is the ShortAbbr which would be 'D13' (again thats hard coded to get it working, it would actaully be @ShortAbbr passed in from the front end)Can any one help me on this please?[code="sql"]Select ROW_NUMBER() over(order by u.UserID) as RowNumber, count(p.ID) as TotalCount, u.Firstname + ' ' + u.Surname as DataCheckerfrom ProspectLead p join UserAccount u on p.reviewedby = u.ShortAbbrwhere p.ReviewedBy is not null and convert(date, p.ReviewedDate) = convert(date, SYSDATETIME())and u.Responsibility = 16and u.ShortAbbr = 'D13'group by u.Firstname, u.Surname, u.UserID order by TotalCount desc[/code] |
Script Out Database Mail Settings? Posted: 08 Sep 2010 06:30 AM PDT Anyone bother to have created a script to Reverse Engineer / Script out your EXISTING database mail settings?I set up a profile to use gMail, and it seems logical for me to export out the settings to a script, then run the script on my laptop, other servers, etc.There's no built in option, so I figured i'd ping the forum before i do it myself.by the way, my google-fu [i]is strong[/i], and there are example scripts where you fill in the blanks, examples how to set up dbmail, but i did not find anything that scripts out existing settings.[img]http://www.stormrage.com/SQLStuff/mail_gmail.gif[/img] |
Posted: 23 Jun 2013 10:27 PM PDT Hi all,does anyone know who to solve this with MDX? I'm trying to get the average sale form each Saturday in year 2005 and in the end the average from ALL Saturdays in 2005.This is how it's supposed to look likeOrderDate AverageSale01.01.2005 1857,1208.01.2005 1754,2510.01.2005 1539,86... ...... ...17.12.2005 1754,5724.12.2005 2076,1630.12.2005 1829,79ALL 1947,64This is a try with some lacking expressions in comments in my logic :WITHMEMBER MEARSURES.AverageSales AS/*function for: average of (MEASURES.ProductPrice * MEASURES.OrderQuantity) */SELECT {OrderDate, MEASURES.AverageSales}ON COLUMNSDESCENDANTS(TimeByDay.Calendar.[2005],TimeByDay.Calendar.TDay[/*all Dates of Saturdays in 2005*/] SELF)ON ROWSFROM SalesCubeThanks for any advice!!anna |
Posted: 23 Jun 2013 07:42 PM PDT while in transaction I am creating a global temporary table and then Insert some data into itlater in the transaction i am using a xp_cmdshell to bcp out the table I am getting a lock dbcc inputbuffer : set fmtonly on select * from mytable set fmtonly offI tried to bcp out the table using a query and I got a lock also I resolved the problem by using a regular table .why this happend ? |
Posted: 03 Sep 2012 04:47 PM PDT I have a server and two instance SQL SERVER 2008 R2 SP2and SQL SERVER 2012 and firstly ı try DBCC CHECKDB in SQL SERVER2008 R2 2 times and it takes 5 hours and 30 minutes after I deattched db and ı atched db to SQL SERVER 2012 and ı try DBCC CHECKDB in SQL SERVER 2012 and it takes 2 hours and 28 minutes what is the new feature of SQL SERVER 2012 |
Posted: 20 Jun 2013 02:38 AM PDT hie frnds,i had a database let me called 'job' and having 5 tables that database is in production server.now when i took backup and restored in development server 'job' database had only four tables .so what should i do now?please help me... |
Posted: 23 Jun 2013 09:16 PM PDT I had format the disk to 64KB and perform a test case using CrystalDiskMark. The result is under expectation. Why i cant get the 20% performance improvement if compare to the default disk format 4096 bytes? |
You are subscribed to email updates from SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No comments:
Post a Comment