I have a File System task and I want to delete a file that I have specified with fully qualified UNC path in a variable. The problem is that the SQL Agent account nor my user account have rights to delete files in that directory. So in BIDS it is a problem (because of my user account), and on the server it will be a problem because of the lack of rights of the SQL Agent account.
I might not have time to get these accounts added, so is there a way to pass the rights of an local account on the network share machine that has rights to delete? Basically, to pass logon information to that UNC path at runtime?
Hi, I am trying to write a desktop application using C# and .NET that can edit an SQL Server Mobile database stored on a device. The problem is no matter how I specify the data source, I get an error the path was not found. Heres the bit of the code:
SqlCeConnection connDB = new SqlCeConnection(strConn);
connDB.Open();
And the error i get is..
The path is not valid. Check the directory for the database. [ Path = Mobile DeviceMy DocumentsNutricom.sdf ]
Everytime it thorws an error saying the path is invalid and to check the locaiton of the database. Ive tried it without the "Mobile Device" bit of the string and still nothing. The database is definately in this location.
When trying to install Business Contact Manager (BCM) for Outlook 2007, the setup failed and I was refered to a log file in my Local Settings/Temp folder. The log actually says that Business Contact Manager was installed sucessfully! BCM is supposed to install SQL Express 2005 as an instance or as instance if SQL Express is already installed. There is an MSSMLBIZ instance in Services..
Who can I send the Log File to for analysis and the fix feedback?
When I first went into Computer Management and clicked on Services and Applications in the left panel, the error message appeared "Snap-in failed to intialize. Name: SQL Server Configuration Manager CLSID:{CA9F8727-31DF-41D2-975C-887D84903967} This message diappeared when I clicked on Services and Applications again. Under Services, there are 3 SQL services - one is an application that was uninstalled 3-4 weeks ago and I disabled this service. The other 2 are: SQL Server (MSSMLBIZ) and the other one is SQL Server (SQLEXPRESS) When I tried to start either of the last 2, the message appeared: Services "Could not start the SQL Server (MSSMLBIZ) service on Local Computer. Error 3: The system cannot find the path specified. Under Program Files/Microsoft SQL Server/MSSGL.1 folder is mostly empty. So, it seems like the Path in the Registry is not valid and that nothing is being installed in the MSSQL.1 folder. If so, how do I fix this?
How do I get the BCM SQL instance to install and run properly? what do the messages in Services mean and how do I resolve these.
After updating TempDB path to a wrong path (without file name only folder name) the service is not starting. How can i sovle this and start the service
I am having a Data flow task in For each loop which will gets 100 sourcetable names and 100 target table names...
am having a simpleData flow task which trasferes from OLEDBSource to OLEDBDestination. I am repeating the Dataflow task which transfers from sourcetablename extracted from for loop to a destination table var.
The problem am gettting is for the first table it is able to transfer correcly because I did mapping for those tables at design time...but for the next coming sourcetable-desttable (which r having different no of cols,datatypes) its giving Validation failed...and...needs to refresh metadata....
is there any way to refresh the metadata of Data flow task (I set the property of OLEDBSource validate external meta to false then also same error is coming)
Which calls for me to import: Microsoft.SqlServer.Dts.Runtime However, I don't have this DST Runtime DLL installed on my machine. I have installed "everything" in SQL Server Developer Edition and Visual Studio. Any idea how I can get this?
I just ran a testbed of 4 types of SQL queries:1. inline SQL with a StringBuilder2. managed sql3. SQL text processing (@SQL as varchar(5000); SET @SQL = 'SELECT ' + @var...)4. a regular sproc that has the columns and table name hard coded1,2, and 4 always end up at about the same time given the averages.3 is always at last 1.5 times slower, and usually closed to 2 times.1 and 2 both use StringBuilders, the code is a direct copy, and 3 is a copy as well.My managed SQL is: [Microsoft.SqlServer.Server.SqlProcedure] public static void usp_Items_Select_Managed(SqlString table, SqlString name, SqlString value) { // sql StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendFormat( "SELECT {0}.* FROM {0} WHERE {0}.{1} = {2}", table, col, value ); SqlConnection sqlConnection = new SqlConnection("context connection=true"); SqlCommand sqlCommand = new SqlCommand(stringBuilder.ToString(), sqlConnection); sqlConnection.Open(); SqlContext.Pipe.Send(sqlCommand.ExecuteReader()); sqlConnection.Close(); }Is there anything wrong with my Managed SQL, or is this just the way that it is?Thanks
I'm running a package on SQL Server 7, SP2 created in the same environment. When running a package from DTS Designer, I get an execution status of "Error Occurred" in the Package Execution Status dialog on one of the data pump tasks I'm running along with the number of rows inserted. When I double-click on the task, I get the following message: " The Connection is currently being used by a task. The connection cannot be closed or reused".
Both the exception log for the task and the package, specified for error output, indicate the task ran successfully and the clients confirm that the appropriate number of rows have been inserted in the table. Has anyone encountered this error that can explain the cause/cure?
When I'm using installshield to install sql runtime, I get the message "The Workstation service has not been started" during Configure SQL Server Agent. Does someone know what it means and how to solve it?
I've an DTS package, which has an Execute SQL Task. I'm doing the operations based on a parameter. I need to pass that in runtime. Is there any way to do that in Execute SQL Task? BOL says that the runtime parameter can be set by giving a question mark(?). But when I tried this, it says, value not passed.
I am Using Sql Server 2005 enterprise edition to develop an accounting system. now i want to distribute this software to other cleints. I have created a setup which includes all the components required for the run time of the software but i dont know how to include the sql server database in it. as i know that i have created access based software i used to include the database file in the setup and it would work but in the case of sql server i dont know how to do it . is there any runtime of sql server which needs to be downloaded or any other way out.
set @t = 'Test' set @chg22 = 'USE <%1> GO' set @chg22 = REPLACE(@chg22,'<%1>',@t)
exec(@chg22) SELECT * FROM Table_Name
but i am not getting it..in above example i am just took one line select * from table_name but actually in .sql file more that 300 lines are there so i m not able to concatenate it..
We run a regular query through Excel that is linked to a Microsoft SQL Server data source.
We have run this query routinely for the past few years. Suddenly this query has started returning an error message - “[Microsoft][ODBC SQL Server Driver] [SQL Server] Difference of two datetime columns caused overflow at runtime�. It seems to be a common error (as per Google search) however I don’t want to go messing around with something I don’t fully understand. Can anyone point me in the direction of what to look out for?
Currently im using SQL queries in combination with ASP.NET..
I have currently only one table('Requests'), which has all the user info of name,id,studyrequested etc.. A person can request for any number of studies.
Now the prob is that from now on whenever a user requests for a new study not only should his details be stored in the Request table but also in a new Users table. In the Users table that particular users details must only be loaded once.. i.e. if the same user enrolls for another study his details should only be updated in the requests table and not in the Users table, since his details have already been loaded once in the Users Table..
While this works fine for new users, but what bout the old users already stored in the Requests table before the Users table existed.
Is there any way i could run a sql script only once at runtime, so that all the old legacy users are loaded once in to the Users Table.
Hi!Can anybody tell me what I'm missing here?I'm trying to insert a new record into a sql-database from code atruntime (not stored procedure),but get the following error message:"The 'strUn' is not permitted in this context.Only constants, expressions or variables allowed here.Column names are not permitted."//Create sql connectionSqlConnection con = new SqlConnection("server=LocalHost;database=Users;uid=geir;pwd=geir");//Open database connectioncon.Open();//Create variables to hold values from textboxesstring strUn = txtUsername.Text;string strPw = txtPassword.Text;//Create a sqlCommand to insert textbox values into sql-databaseSqlCommand sqlcmd = new SqlCommand();sqlcmd.CommandText = "INSERT INTO tblUsers(Username,Password)VALUES(strUn, strPw)";sqlcmd.Connection = con;try{sqlcmd.ExecuteNonQuery();}catch(SqlException ex){lblInfo.Text = "ExecuteNonQuery failed because: " +"" +ex.Message;}finally{con.Close();}
My boss claims that there is a free SQL server runtime. Is thistrue? I was only aware of MSDE. But I believe the connections arecapped at 5 in MSDE. If there is a free SQL server runtime, are thereany limitations to using it (performance, connection count)? Thanks.
I want to combine a bunch of reports (which are stand alone reports on there own) as subreports in a parent or master report. We have done this in Crystal Reprots in order to get a group of reports out in one file.
The issue with Reporting Services is the header and footers of the subreports are not rendered, so I have to repeat the logo information for each subreport in the body of the parent report. I can do this in a table or list or rectangle, but I have to do this for each subreport. Is there any way that I can specify the name of the subreport at runtime? That way I can put everything into a List and drive it from the database. I noticed that the dropdown to select the report name does not allow you to create an expression for this field.
Does anyone have an idea on how to handle runtime parameters for a package? Ideally I'd like to have the package prompt the user for a date range and then store the 2 dates in package variables for use later in the package.
I am trying to create a report with unknown number of report items. (as I dont know how many columns the stored proc is going to return).Is there a way to create these type of reports using SSRS other than creating the rdl programatically using vb.net or c#?
I'm trying to create a custom data flow transformation, I need to set the value of a user variable which will be used by a downstream component(for example: a data flow destination) at runtime, is this possible? If possible, in which method should I do that? Thanks.
Our company is currently looking at a package which uses sql server 2000 as backend and power builder as front end. The vendor said that we need to have SQL client runtime install in the user pc. Can anyone tells me what is SQL client rutime and the purpose of it?
Hi! My question is exactly the subject. My Web Form has only a GridView and a DetailsView, there is no SqlDataSource at project time, i create the SqlDataSource at runtime using code like this in the Page_Load event: (I NEED IT TO BE CREATED DYNAMICALLY)1 Dim SQLDS As SqlDataSource = New SqlDataSource() 2 3 SQLDS.ID = "CustomerDataSource" 4 SQLDS.ConnectionString = ConfigurationManager.ConnectionStrings("connectionstring").ConnectionString 5 SQLDS.SelectCommand = "select customerid,companyname,contactname,country from customers" 6 SQLDS.InsertCommand = "insert into customers(customerid,companyname,contactname,country) values(@customerid,@companyname,@contactname,@country)" 7 SQLDS.UpdateCommand = "update customers set companyname=@companyname,contactname=@contactname,country=@country where customerid=@customerid" 8 SQLDS.DeleteCommand = "delete from customers where customerid=@customerid" 9 10 SQLDS.UpdateParameters.Add(New Parameter("companyname")) 11 SQLDS.UpdateParameters.Add(New Parameter("contactname")) 12 SQLDS.UpdateParameters.Add(New Parameter("country")) 13 SQLDS.UpdateParameters.Add(New Parameter("customerid")) 14 15 Page.Controls.Add(SQLDS) 16 17 If Not Page.IsPostBack Then 18 GridView1.DataKeyNames = New String() {"customerid"} 19 GridView1.DataSourceID = SQLDS.ID 20 21 ' ... and so on The DetailsView1 uses the same SqlDataSource to show data, but i could not find a way to synchronize the DetailsView1 with the GridView1 when a record is selected in the GridView1.How can I synchronize the DetailsView?I played with the ControlParameter but i can't find either how to add a ControlParameter in code, is there a way? Every place talking about ControlParameter shows something like this: 1 <asp:SqlDataSource ID="SqlDataSource1" runat="server" 2 ConnectionString="<%$ ConnectionStrings:Pubs %>" 3 SelectCommand="SELECT [au_id], [au_lname], [au_fname], [state] FROM [authors] WHERE [state] = @state"> 4 <SelectParameters> 5 <asp:ControlParameter Name="state" ControlID="DropDownList1" PropertyName="SelectedValue" /> 6 </SelectParameters> 7 </asp:SqlDataSource> 8 Ok. OK. But my SqlDataSource is created dynamically. Any ideas on how to solve this problem?Thanks!
Hi, I am trying to create a DTS package dynamically. I have taken all these steps i.e., 1. SN.EXE -K c:DTS.KEY2.tlbimp.exe "C:program filesmicrosoft SQL Sever80ToolsBindtspkg.dll" /out:c:Microsoft.SQLServer.DTSPkg80.dll /Keyfile:c:DTS.KEY3.gacutil.exe -i C:Microsoft.SQLServer.DTSPkg80.dll. Now when i compile the code, i didnt get any compilation error. But when execute the code it gives me a runtime error which goes as given below : An unhandled exception of type 'System.InvalidCastException' occurred in DTSFactory.exe Additional information: QueryInterface for interface Microsoft.SQLServer.DTSPkg80.CustomTask failed. I am getting this error near the line : oCustTask = (DTS.DataPumpTask2)oTask.CustomTask; The following is the code. using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using DTS = Microsoft.SQLServer.DTSPkg80; namespace DTSFactory { /// <summary> /// Summary description for Form1. ///This is assuming that all steps have been taken in the following document: ///http://SQLDEV.NET/DTS/DotNetCookBook.htm ///SN.EXE -K c:DTS.KEY ///tlbimp.exe "C:program filesmicrosoft SQL Sever80ToolsBindtspkg.dll" /out:c:Microsoft.SQLServer.DTSPkg80.dll ///Keyfile:c:DTS.KEY ///gacutil.exe -i C:Microsoft.SQLServer.DTSPkg80.dll ///These steps are needed for interop with dtspkg.dll /// </summary> public class Form3 : System.Windows.Forms.Form { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null; private System.Windows.Forms.Button button1; public DTS.Package2Class pkg = new DTS.Package2Class(); public Form3() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // } private void Form3_Load(object sender, System.EventArgs e) {
In a web site the user has to choose one out of several sql tables to deal with. He will then be allowed to view the selected table data through a GridView, to insert a new row into and to update a row in the selected table by means of an array of TextBoxes created dynamically on the base of the selected table. I think it is possible to solve the problem fully by properly configuring at run time an SqlDataSource. I have solved the issue of data display by declaring in the code behind within the OnPageLoad sub the following: SqlDataSource1.SelectCommand = "Select * FROM " & selectedTable While for the GridView1 I have added the selected table columns to the columns collection as follows: for i=0 to ColumnCount-1 Dim cac As BoundField = New BoundField cac.HeaderText = HeaderNamesArray(i) cac.DataField = ProductNamesArray(i)Me.GridView1.Columns.Add(cac) next I have difficulty on how to do similar declarations for the insertcommand and update command.
Hi I am binding SQLdatasource with the Gridview at runtime that works fine, but i have mentioned the update command as well, but grid is not updating, there is no error, but after clicking update, no thing happens and grid returns to last state. Part of code is : void btnshowdata_click(){ SqlDataSource1.SelectCommandType = SqlDataSourceCommandType.StoredProcedure; SqlDataSource1.SelectCommand = "dbo.getAllOutstanding"; SqlDataSource1.UpdateCommand = "UPDATE SPS_Oustandings SET Status = @Status, Comments = @Comments WHERE (Inv_No = @Inv_no)"; grid.DataBind(); } datasource is already attached to grid, but its select query is chaning at button click. At design time binding update works but when i click the button binding(select quesry) is changed, after that update is not working.
Here is the code I am trying to use to set a update parameter at runtime. (Depending on what linkbutton a user clicks on the STATUS_ID value will change.) SqlDataSource1.UpdateParameters("STATUS_ID").DefaultValue = 33332Here are my parameters: <UpdateParameters> <asp:Parameter Name="CUSTOMER_ID" Type="Decimal" /> <asp:Parameter Name="RECEIVED_BY" Type="String" /> <asp:Parameter Name="CALL_DATETIME" Type="DateTime" /> <asp:Parameter Name="AREA_ID" Type="Decimal" /> <asp:Parameter Name="CLASS_ID" Type="Decimal" /> <asp:Parameter Name="STATUS_ID" Type="Decimal" /></UpdateParameters>Sqldatasource1 is the name of my datasource control. Any thoughts?