I'm trying to access some files on a file server in CLR code and I have to impersonate the windows login to get permission. I am using the classic example of SqlContext and i can see that after calling the impersonate method it changes. I always get false from the System.IO Direcotry and File functions to see if there are any files or even if the directory exists. The permissions are correct on the file share and the batch submission is using the correct login.
Hi i have a sorted procedure that create a @temp table that return strNomObjet,strNomDescripteur,strReponse,Percentage
I need to calculate the Percentage for strReponse for each strNomDescripteur. strReponse can be = to A,B,C, or D To calculate the Percentage i have no problem my is that something it possible that a certain strNomDescripteur that will have only A,B and D and there no C i need to put 0%.
INSERT INTO @Temp Select te.stdlastn,te.stdfirstn,COALESCE(NULLIF(REPLACE(tr.T3,'*',''),' '),REPLACE(tr.T2,'*','')),tob.Nom,tob.Affichage,td.Nom,td.Affichage fromBulletin.dbo.tblEleves as te INNER JOIN Bulletin.dbo.tblBulletin as tb ON te.stdnumber=tb.NoEtud INNER JOIN Bulletin.dbo.tblNomBull as tnb ON tb.NoBull=tnb.ID INNER JOIN Bulletin.dbo.tblSection as ts ON ts.ID_Bull = tnb.ID INNER JOIN Bulletin.dbo.tblObjetas tob ON tob.ID_Sec = ts.ID INNER JOIN Bulletin.dbo.tblDescripteur as td ON td.ID_Obj = tob.ID INNER JOIN Bulletin.dbo.tblReponse as tr ON tr.ID = tb.ID whereintActif = 1 and tb.NoBull not like '%EdPhy%' and tnb.Nom not like '%EdPhy%' and tnb.Date = '2006-2007' and te.STDGRADeID = 3 and te.schoolid = '1202' and ts.Nom = 'MATHÉMATIQUES' and tr.[Desc] = td.ID and tr.T2 <> 'NULL' and tr.T3 <> 'NULL' and (tr.T2 <> '' OR tr.T3 <> '') ORDER BY tob.Affichage,td.Affichage
SELECT t1.strNomObjet,t1.strNomDescripteur,t1.strReponse, t1.ReponseCount * 100.0/t2.PersonCount AS Percentage FROM ( SELECT strNomObjet,strNomDescripteur,strReponse,count(*) AS ReponseCount FROM @Temp GROUP BY strNomObjet,strNomDescripteur,strReponse)t1 INNER JOIN (SELECT strNomObjet,strNomDescripteur,count(*) AS PersonCount FROM @Temp GROUP BY strNomObjet,strNomDescripteur)t2 ON t2.strNomObjet=t1.strNomObjet AND t2.strNomDescripteur=t1.strNomDescripteur
This will give this result : As you can see it always A,B,C,D A,B,C,D
Except for "FORMES utilise les transformations géométriques pour" it only A,B,C there no D. So is there a way that i could insert D = 0 So if i don't find any A,B,C or D for certain strNomDescripteur put that letter = 0
Thanks for your help in advance!!
FORMES utilise la mesure pour résoudre des problèmesA 47.222222222222 FORMES utilise la mesure pour résoudre des problèmesB 38.888888888888 FORMES utilise la mesure pour résoudre des problèmesC 8.333333333333 FORMES utilise la mesure pour résoudre des problèmesD 5.555555555555 FORMES utilise les figures géométriques pour résoudre A 61.111111111111 FORMES utilise les figures géométriques pour résoudre B 25.000000000000 FORMES utilise les figures géométriques pour résoudre C 11.111111111111 FORMES utilise les figures géométriques pour résoudre D 2.777777777777 FORMES utilise les transformations géométriques pour A 62.857142857142 FORMES utilise les transformations géométriques pour B 28.571428571428 FORMES ET ESPACE (géométrie)utilise les transformatC 8.571428571428 NOMBRE ET OPÉRATIONSdémontre une compréhension A 69.444444444444 NOMBRE ET OPÉRATIONSdémontre une compréhension B 16.666666666666 NOMBRE ET OPÉRATIONSdémontre une compréhension C 5.555555555555 NOMBRE ET OPÉRATIONSdémontre une compréhension D 8.333333333333
Hello all,I hope someone can help me; if got a value in a cell (040 1234567),when I run a queryin the Analyser I got as respons only 40 1234567, so missing the zero(0) not the whole number is displayed. When I run a query on a cellwith value 1234567 I received the number 1234567 and that's oke. TheData Type of the Column is Char.Thanks,Marko
When I log in to Windows (XP Pro SP2), I get the following message displayed in the Application Event Viewer.
"The ASP.NET DLL (Path: C:WINDOWSMicrosoft.NETFrameworkv2.0.40607aspnet_isapi.dll) (Version:2.0.40607.0) is missing"
The message is quite correct in its assertion that the file is not where it says it is. There is a copy of the noted DLL however, in C:WINDOWSMicrosoft.NETFrameworkv2.0.50727 and in C:WINDOWSMicrosoft.NETFrameworkv1.1.4322
Why is the Report Server looking for that particular version? Why can't it point at the later version?
When I sign on to my computer I get this message, MSVCR70.dll can not be found try to reinstall it this may fix the problem, BUT CAN'T find the dll that is missing to reinstall it, HOW DO I FIX THIS please HELPPPPPPPPP!!!!!!
I have a normal nvarchar(50) field in a table that has a single comma in it but when i read it using OleDbDataReader the comma gets removed. any ideas what i am doing wrong ?
Hi guys need some help, someone has given me some code to help me filter a gridview by the surname field by the selected letter of a dropdown list. My code is below, however if i select a letter from the dropdown and click the button i get an error, can someone take a look please. <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %>
<script runat="server"> Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim dset As New Data.DataSet Dim dview As New Data.DataView dview.Table = dset.Tables("modelRegistration1") dview.RowFilter = "surname LIKE" + surnameFilter.SelectedValue.ToString() + " % " GridView1.DataSource = dview GridView1.DataBind() End Sub </script>
error message is Server Error in '/KayKay' Application.
Syntax error: Missing operand after 'LIKEC' operator. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SyntaxErrorException: Syntax error: Missing operand after 'LIKEC' operator.Source Error:
Line 6: Dim dview As New Data.DataView Line 7: dview.Table = dset.Tables("modelRegistration1") Line 8: dview.RowFilter = "surname LIKE" + surnameFilter.SelectedValue.ToString() + " % " Line 9: GridView1.DataSource = dview Line 10: GridView1.DataBind()Source File: E:InetpubwwwrootKayKayAdminupdateModels.aspx Line: 8 Stack Trace:
In the console, when right clicking on a table name...then selecting 'open table', the toolbar at the top of the page is not displaying. This is the graphical bar with the 'SQL' button that lets you filter the results.
Recently I installed MSDE and then Analysis services and also applied SP3's for both...
However I have noticed that the FoodMart Database which was automatically installed previously with Analysis services is not installed. Is there any way to get that?
I need to build a results grid that reports totals or zero for an attribute
SELECT ClaimType, VendorNumber, COUNT (ClaimNumber) AS ClaimCount FROM ClaimHeader GROUP BY VendorNumber, ClaimType ORDER BY VendorNumber ASC;
THe underlying data has two claim types (UB, and HCFA). Some vendor numbers have only UB claims or only HCFA claims. I want my totals to show a zero for those vendor numbers. Example
My current group by doesn't give me the 3rd row in my example. How do I change my query to add those rows that have no claims as a zero. Put another way, every vendorNumber has to report a HCFA total and a UB total, even if they're zero.
I have encountered an issue with one of my log files which has me somewhat puzzled. I receieved notification at 00:02:16:36 that the Log file was full: The log file for database 'TDS' is full. Back up the transaction log for the database to free up some log space.. A large number of these same messages have followed.
Prior to these messages starting the log file was backed up successfully at 00:00:01:10 Shortly after this there is a message - and this is the bit that confuses me - at 00:02:16:35 that says: d:mssqldata ds_log.ldf: Operating system error 112(error not found) encountered.
So from what I can tell the log file was backed up successfully. Then approx 1 minute later the system can't find the log file??? Then I keep getting these log file full messages - until the next log backup (60 min later)...then everything is fine. HUH?
When looking at the log file for SQL it is sitting there, and isn't new, as it's created date is back when I setup the database initially.
Can anyone shed any light on what this message might mean and whether there is specifically something that I can do to circumvent it in the future.
Oh yeah we have nothing tricky in terms of replication or log shipping or anything like that.....
Hi all, I would greatly appreciate a boost with this problem. I'm trying to 'script' the mundane task of adding descriptions to my tables (I know this can be done from Enterprise manager via Diagrams, but I have a huge (did I mention huge?) amount of tables and I really don't want to have to go to the properties of each and every table.
Now, if I read BOL right I can use sp_addextendedproperty (and here is their example):
sp_addextendedproperty 'Caption', 'Caption Test Table', 'user', dbo, 'table', TestExProp <--- Does this not add a description to the the table?
Well, I tried it and No Joy ! When I look at the table properties from the Diagram (w/in Enterprise Manager) I have a nice big EMPTY Description Box. I tried changing it from 'Caption' to 'Description' thinking that would work but alas, I sit here and wonder where I went wrong ....
What have I missed?
Any input would put me out of my misery and make me a productive individual (at least for today !)
I installed SQL server 2005 on a win2003 server box.
When I open the Connect to Server dialog box, I choose server type: Database Engine. There is no Servername listed, so I put in the name of the PC.
I get a long error message when I try to connect:
Cannot connect to PCName.... ...error: 40 - Could not open a connection to SQL Server)...
When I try to go into the Surface area Configuration, I get this message: "No sql server 2005 components were found on the specified computer. Either no components are installed, or you are not an administrator on this computer. (SQLSAC)"
I am logged in as Administrator in the PC, so did I do something seriously wrong with the installation?
In the services window, I can not fine MSSQLserver (not sure if this is relevant).
i have to check first the missign dates between dates 1/1/1999 till current date how many dates are missing and for those dates i have set - update quantity=0 for all those missing dates. docdate is datecolumn in saleshsitory and quantity is in salestable. can anybody help me to solve this problem. thanks a lot!
Recently my server harddisk crashed and I Lost a one of the secondary data files of sqlserver database. I have the main file intact and the recent data was also in that file only, but I was unable to attach the database as it required the other data files also.
Is there any way to create the database again from the existing data file( unfortunately there is no backup also which we can use to recreate the missing data file)
Hello. We have a smaller system on one of our servers where a couple of users where beta-testing. This system used a SQLExpress 2005 database (databaseName_data.mdf).
But yesterday we saw that we couldn't use the system anymore, we got errors about the connection to the database. We open SQL Management Studio and connected to the SQL Server and we saw the name of the database in the list, but it was completly empty. Nothing. Not the "folder" for Tables, Programmability, Security... nothing.
We then browsed to the folder where the MDF file used to be, and there we only found the LDF file. The MDF file was gone.
We "know" that no one here have been shutting down the SQL Service and then deleted the DB, so we are trying to figure out what has happen.
It's not a major issue, because it's just a beta-test, but we don't want this to happen later on again...
Does anyone have a clue of what might be going on?
We are using three instances of SQL Express on this test machine btw... One for the public system (wich used this db), one for development and one for some random tests...
The public server and develop server used databases with the same name, but of course, different files on the hdd (and different instances of SQL Express).
//J
Edit: I might add that we hadn't backed this db up yet... Is there some way to use the LDF-file to restore some of the data?
In EM that is, in QA if I use:use masterselect * from sysdatabasesI get:(6 row(s) affected)Server: Msg 220, Level 16, State 1, Line 1Arithmetic overflow error for data type smallint, value = 42840.
Hisql server 2005. Is there any way to restore from a backup if the originaldb has been deleted? I have created a blank db and have tried to restoreinto it but it says the db is not the same.ThanksRegards
We have a series of stored procedures that utilize some of the masterextended SPs such as xp_cmdshell. We migrated to SQL 2000 in April andeverything has worked great for over 3 months. However, this week wediscovered that the xp_cmdshell SP was missing from the masterdatabase. Here is the error we received:Server: Msg 2812, Level 16, State 62, Line 1Could not find stored procedure 'master..xp_cmdshell'.We reinstalled the SP from a previous instance so we are back up andrunning. What would cause the SP to all of a sudden vanish? I believewe have the SQL SP 3a patch installed. Although we have scanned theserver for worms and viruses, should we be looking in a particular logfor something malicious on the server? If it is not an attack of sometype, would there be another explanation for this? One other thingworth noting - a few weeks ago we could not utilize our systemadministrator account on SQL. In order to use the account again we hadto reset the password. Could these events be related and what could bea likely cause? For obvious reasons we are concerned and wouldappreciate any information anyone might have.Thanks!Jim
I have a report parameter with Allow null value checked (and also Allow blank value). The report works as expected when viewed in Visual Studio, i.e. if I don't supply a value for the parameter, the report still renders. However, when I try to view this report through the web ReportViewer I get the error message "The X parameter is missing a value". It works fine when a value is supplied but I want that parameter to be optional.
There are 4 object ids in my sys.database_permissions view that do not exist in my sys.all_objects view in my master database. Anyone have any ideas where else I can look to identify these objects?
Please help: when I want to create new data source from Data > Add New Data Source > Database > New Connection > Choose data sourse: MS Sql Server > Continue > Server name ----------> here in server name field i can see a lot of server names but not mine... so I'd like you to help me to find my server name...
I created a report model with a single "data source view." The datasource view has three tables "Business, XRef, Employee" and a named query "PeopleCount" based on these tables. The smdl [design] view shows "Business, XRef,Employee" as "entities" and does not show the named query from the "data source view" (I don't know if that is normal). I published this report model to the reporting server (its showed "success").
I then used Report Builder to open the report model as a "chart", and it shows there is only one entity for me to play with, its called "XRef." Why do the other tables ("Business" and "Employee") not show up in the Report Builder's list of entities?
My own guess is that "XRef" is the only "actionable" table for making a chart. Indeed, I notice that among its "fields" is one called "Business Title" (which apparently comes from the Business table). But I also notice it does not have an "Employee Name." Why have the former and not the latter? Again, my own guess is that the type of the Employee.Name field, a nvarchar(MAX), might be considered unusable for reporting, since it is a "max" size. Thoughts?
I am using SQL Server 2005 RTM, which is running on Win 2K3 Server SP1.
We are seeing a problem with the users of our application. If the user closes our application from running programs (as best as we can tell as we cannot repro in dev) and SQL Mobile is in the middle of an async sync, sometimes when the application restarts it fails to load the properties for replication from the database. We are using code that is nearly identical to the samples provided by MS for performing replication async. Basically, the database still exists on the device and the application can use it just fine, but when a sync starts, the database is already there, so it tries to load the properties at which point we get a message stating that there is no subscription in the database.
Any ideas?
The second question would be if it doesn't exist and the database already contains data, can I create the subscription and have it not loose the users changes? Will it sync correctly after that?