Good Practice When Working With Objects Using SQLServer As A Secure Store.
Oct 11, 2006
I'm sure this has been asked plenty of times before, so I'm after a link to a good answer.
I have tens of thousands of milk crates, holding dozens of different types of milk in hundreds of locations. I am used to working with objects but not databases. For this situation however I want the security of SQLServer transactions to track, for example, when a robot moves a crate from one location to another.
I am thinking of using SQLServer as a store. On startup I want to get my ecosystem of objects out of the store. While I am running, I'll just use objects. When I change an object property I want it to securely persist. I don't want to snapshot the whole menagerie of object states, just update the values that changed. Which will sometimes include the addition or deletion of objects. How do I do this? Is there an example somewhere that does this (or approximately this)?
I use VB and have Visual Studio 2005. (Which, by the way, is stunning. I thought all that "you will use less time and code more and better" talk was just hype. But its for real. Amazing product.)
i have configure a SSIS package in BIDS to use an Env. Var. to store the location of the .dtsconfig file for the connection to my SSIS configuration table in SQL. I than use another Env. Var. to retrieve the source conn. str. from my SQL SSIS configuration table. Once my package loads, i select a simple sql task to execute, but it comes back and says that it cannot make the connection. How does the SQLServer connection string know what password to use? This is where i'm confused. I believe it loads the connection string for my source database but it doesn't get the password. I just started working in SSIS and i'm trying to get my head around all of the dynamic options of SSIS. I appreciate your time and help.
Problem Details: package A has 1 sql execute task Env.Var. 1 stores the location of the .dtsconfig file that stores the connection data to ssis sqlserver configuration table (used to store additional package properties in sql server) Env. Var. 2 stores the connection string of my source database. package protection level set at "EncryptSensitiveWithPassword" the sql task is assigned to the source connection string,right click and execute task.
here is the error: Failed to acquire connection "source database" Connection may not be configured correctly or you may not have the right permission on this connection.
I'm executing this from within BIDS just to check that my setup is going to work.
Here are some items i've tried or troubleshoot:
1. If I roll back the 2 package Configs or disable using package configs and replace my original source connection manager and create a new connection manager than i can get the sql task to successfully execute again. It won't usually work by just disable the package configs. i had to delete the existing source connection manager.
2. create a new package trying the same steps as above.
3. change the package protection level to "encryptSensitiveWithPassword" expecting this to retain the source connection password. I tried a variety of package protection levels.
I know that <asp:SqlDataSource> is fast, but is it a good practice to use this. The sqldatasource is right there in the aspx page and the SQL for sqldatasource is also right there.Does that not break the 3 tier model, as normally we call a database layer and we have all the SQL's there. In one of the code in saw the following. I don't know if it is a good practice to do something like this. <asp:DropDownList ID="CountryDropDownList" runat="server" DataSourceID="SqlDataSource2" DataTextField="PickListLabel" DataValueField="PickListValue" OnDataBound="hidePanel"> </asp:DropDownList><asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:webrepos %>" SelectCommand="SELECT [PickListLabel], [PicklistValue] FROM [PickList_Values] WHERE (([ObjectName] = @ObjectName) AND ([FieldName] = @FieldName)) ORDER BY [AbbrCode]"> <SelectParameters> <asp:Parameter DefaultValue="Account" Name="ObjectName" Type="String" /> <asp:Parameter DefaultValue="Country__c" Name="FieldName" Type="String" /> </SelectParameters> </asp:SqlDataSource>
is it a good practice to use autoincrement fields in an access database for master and detail? and for unique record identification. if not please tell why.. im currently using access and with autoincrement for unique record identification and for master and detail.. then there is a possibilities to transfer from access to mssql. will i encounter problems when migrating since i am using an autoincrement fields
in mssql is there an autoincrement fields like access?
dont be harsh ok.. just anoob trying to learn. :eek:
hi experts, i have a postcode database that i need to update. the database cnotains of 6tables, the file i ahev has all the information at once, so i have to organize it and insert records into the appropriate tables. this is the first time i'm doign this so i would like to know what the best way to do? do i need to create a stored procedure or a script, or may be something special and efficient that i do not know yet. any advise will be very appreciated thanks in advance
I would like to have a stored procedure executed once a week via a DTS package. The data I would like inserted into Table_2, which is the table where the DTS is being executed on, comes from a weekly dump from Oracle into a Table_1 via another DTS package.
I would like to only import data since the last import so I was thinking of my logic to be like this:
INSERT INTO Table_2 (Field1, Field2, ... , FieldN) VALUES (SELECT Field1, Field2, ... , FieldN FROM Table_1 WHERE ThisDate > MAX(Table_2.ThatDate))
Does this make sense? Or do you all suggest a different mannger of accomplishing this?
Hi All, I need to send out email when error occurs in the package. Is it a good practice to put the send email task in the event handler? Then MaximumErrorCount is set to 1. But for some reason, some time I saw more than one email are sent out. Please advise. Thanks
After found out the `transfer object` command in MS SQL EM didn`t work well in my databases, I started code by myself to generate the `Create xxx` statements to copy objects across databases (structure only) using SQL.
I`ve coded out most of them, logins, defaults, UDT, tables, stored procedures, but then I started to have problems with primary keys and foreign key const.
Has anyone tried to do the same thing before or is there some SQL scripts created to handle this already? Please advise me.
I am thinking to use SQL-DMO with VBscript now. But I still prefer a good SQL script (old thought, the DB-Lib based `isql` is more reliable than the SQL-OLE).
I am new to working with Database using .net C#. i will really appreciate if someone can point me to a link where i can find best practices of working with sql express database with my c# web service applications.
preferably i would like to have answers for:
- to have one db or to have one for testing and one real db?
- db security
- use windows authentication or db user authentication
hi Do you have any good example of CURSOR with sqlserver. When we should use? Any live example will be appreciated, also how to call Cursor from .net Web Application pls help to learn
Do you believe that SqlServer Express can work absolutely without any administration? That is to say: my clients are people without any technical knowledge and they usually communicate never with me. Is SSE the correct database for this status, or should I use a desktop database like VFP or Access?
I am new to SS2005, and I've just started working on a small test/devdatabase.I recently read that one should store things like tables, views,constraints, etc. in the *.ndf file rather than in the *.mdf file.Does this make it any easier to transfer/copy files or databases orother items from test/dev to production??If I have a database already with items in the *.mdf file, how do Itransfer things like tables, constraints, views, etc. to an *.ndf filein another database??I also read that one can make it the default in SS2005 to store thingsin the *.ndf file, how is this done??Thank you,Tom
I have the following:omegalove.comIf you go to the search portion u will notice that there are three dropdownlist that are populate using sqldatasource object.I do not want these two post back. Is there a way we can cache this so it is faster.I would like to learn. I appreciate any help. Please don't give me links. I much rather learn from someone who has hands on.Thank you I will have to separate the code from the ui?--------------------------------------------------------------------- Country:<asp:Image ID="FlagImg" runat="server" Height="12px" Width="20px" />
How can we store native .NET objects like arraylists, hashtables in Sql Server? Is this possible? If so, can anybody provide some insight on how to do this?
I want to serialize a dataset and store it in database.How can i do that.In sqlserver 2005 which data type i need to use for storing objects. Please advice
We are in the midst of cleaning up database01. There are objects in database01 that are widely used in store procedures that reside in database02.
Problem is: I need to know which tables and view from database01 are in use by store procedures in database02. This is important because if I accidently decommission tables that are currently in use by production class s-procedures, it will not be pretty. A sample output could look like:
I am not a programmer and none of our programmers here claim that there is any solution to this problem without spending thousands on s/w licenses. Any simple solution + code snippet that will help me resolve this problem by myself would be incredibly valuable.
I have written an SSIS package with a Transfer SQLServer Objects task which I want to use to copy database objects from a SQL Server 2000 database to SQL Server 2005.
When I run this task, I find the following error:
[Transfer SQL Server Objects Task] Error: Execution failed with the following error: "Version80 database compatibility level is not supported
Is there a way around this aside from changing the compatibility level of my SQL Server 2005 database?
I have a sql server project where I have added 1 stored procedure (named StoredProcedure1) and 1 class (named MyClass). MyClass has two functions Func1() and Func2(). The stored procedure simply instantiates MyClass and calls Func1().
Func1() creates a SqlConnection object using "context connection=true" - opens the connection and then calls Func2(). Func2() also creates a SqlConnection object using "context connection=true" - and attempts to open the connection. However when attempting to the Open() call inside Func2(), the code just exits. What gives? The code is pasted below, thanks!
*******THE STORED PROCEDURE************** using System; using System.Data; using System.Data.SqlClient; using System.Data.SqlTypes; using Microsoft.SqlServer.Server; using SqlServerProject1;
public partial class StoredProcedures { [Microsoft.SqlServer.Server.SqlProcedure] public static void StoredProcedure1() { // Put your code here MyClass obj = new MyClass(); obj.Func1(); obj = null; } };
*******THE CLASS "MYCLASS"************** using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Data.SqlClient; using System.Data.SqlTypes; using Microsoft.SqlServer.Server;
public class MyClass { public MyClass() {
}
public void Func1() { using ( SqlConnection conn = new SqlConnection("context connection=true") ) { conn.Open();
Func2(); conn.Close(); } }
public void Func2() { using ( SqlConnection conn = new SqlConnection("context connection=true") ) { if ( conn.State != ConnectionState.Open ) conn.Open();
if ( conn.State == ConnectionState.Open ) conn.Close(); } } }
I'm unable to copy my Stored Procedures from one database to another. I'm using mixed mode authentication. I have set CopyAllStoredProcedures to True, DropObjectsFirst to True and CopySchema to True.
Nothing gets copied. I have followed many web sites that say Transfer SQL Server Objects Task is broken. Is this true and I should give up?
Also, I'm on SQL 2005 SP2 which appears to be the latest and I assume is the update for SSIS? yes ?
Thanks for any help
[Transfer SQL Server Objects Task] Error: Execution failed with the following error: "ERROR : errorCode=-1073548784 description=Executing the query "CREATE PROCEDURE [dbo].[del_Admin_RemoveContractorFromContract] @ContractID int, @ContractorID int AS DELETE FROM CONTRACTOR_CONTRACTS WHERE CONTRACT_ID = @ContractID AND CONTRACTOR_ID = @ContractorID DELETE FROM CONTRACTOR_USER_CONTRACTS WHERE CONTRACT_ID = @ContractID AND CONTRACTOR_ID = @ContractorID " failed with the following error: "There is already an object named 'del_Admin_RemoveContractorFromContract' in the database.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. helpFile= helpContext=0 idofInterfaceWithError={8BDFE893-E9D8-4D23-9739-DA807BCDC2AC}". Warning: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
I have this select statement: SELECT * FROM [enews] WHERE ([name_nws] LIKE '%" + strSearch + "%' OR [title_nws] LIKE '%" + strSearch + "%'OR [sub_nws] LIKE '%" + strSearch + "%' OR [sum_nws] LIKE '%" + strSearch + "%' OR [content_nws] LIKE '%" + strSearch + "%')
This statement works fine but when I turned it into a store procedure, it returns nothing. I created the store procedure as follows: SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <Author,,Name> -- Create date: <Create Date,,> -- Description: <Description,,> -- ============================================= CREATE PROCEDURE sqlSearch -- Add the parameters for the stored procedure here @strSearch varchar(250) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON;
-- Insert statements for procedure here WHERE ([name_nws] LIKE '%" + @strSearch + "%' OR [title_nws] LIKE '%" + @strSearch + "%'OR [sub_nws] LIKE '%" + @strSearch + "%' OR [sum_nws] LIKE '%" + @strSearch + "%' OR [content_nws] LIKE '%" + @strSearch + "%') END GO
How can i Store files like (abc.txt , abc.doc) in SqlServer Database from ASP.NET application ?? my files are about (2 Mb ) size aslo want to know about text as well as .jpg , . gif files also pls send me code ... help me
I have a question about where package is stored if you select sqlserver or SSIS package store (msdb). Is both of these going to the same place sysdtspackages90. On one of my systems I was saving as sqlserver but when users created a job they where using SSIS package store msdb. This seems to be working, though I would have thought that they were to different locations. On another system when I did same thing the job failed, and looked like maybe it was running wrong version, but when I resaved project as SSIS package store(msdb) then it did work. Even though I had earlier saved that package under sql server. So on 1 system it looks like they are the same on the other system I am not sure.
So if you can clarify for me what the difference between the two areas are if any?
i have this trigger in my database : ALTER TRIGGER dbo.AddVoucher ON dbo.User_AddVoucher AFTER INSERTAS SET NOCOUNT ON;DECLARE @UserId int, @Add_id int, @voucher_id char, @Kredit money, @date smalldatetime, @last_balance money, @voucher_status charSELECT @UserId = UserId, @voucher_id = Voucher_ID, @Add_id = Add_id, @date = Deposit_Date FROM InsertedSELECT @Kredit= Voucher_Value, @voucher_status = Voucher_Status FROM Voucher WHERE Voucher_ID = @voucher_idINSERT INTO User_Balance(AddVoucher_ID, UserId, Update_Type, Update_Date) VALUES (@Add_id,@UserId, 'Kredit',@date)select @last_balance = Balance from User_Balance WHERE UserId = @UserId and Balance = (select TOP 1 Balance User_Balance where UserId = @UserId order by Update_Id DESC) if (@voucher_status = 'active') -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. -- Insert statements for trigger hereBEGIN update User_Balance set Balance = @last_balance + @Kredit where AddVoucher_ID = @Add_id update Voucher set Sold_Date = @date where Voucher_ID = @voucher_idENDELSE BEGIN raiserror ('Voucher is not valid',0,1) rollback transaction ENDgo the problem is the update function is not working and the if statement always put to 'FALSE' do you think anything wrong with the code
Hi allWe have some tables with a couple of layers of very simple views built ontop. In the table are maybe 6 columns and about 15000 records. The firstview cobines the data in the table with some other data from a lookuptable. The second view does some sorting on the first view using certaindates . They have worked fine for well over a year now.Until this morning that is... the views stopped returning the full set ofresults- even the very simple one that sits just above the table. The viewreturned the core of the data from the main table, but nothing from thelookup table.In order to get them to work we had to delete each view (using access frontend to do this), and then recreate it with exactly the same SQL text. I amguessing this causes SQL Server to recompile it. As soon as view 1 had beenrecreated it worked, but view 2 still failed, again rebuilding view 2 itstarted working.The only thing I can think of is that this morning I added 2 new fields tothe base table, but I'm sure I've done this before without any (noticable)problems.any thoughts as to why it happened would be welcome, I am a bit nervousnow...thanksAndy
Hello, I am wondering how it is going to work using SQL Server configuration type to store connection string in the SQL Server table. How does SSIS know what database to connect to if its connection string is store in the database? Thanks
- Operating System Minimum Level Requirement (Success) Messages * Operating System Minimum Level Requirement
* Check Passed
- Operating System Service Pack Level Requirement. (Success) Messages * Operating System Service Pack Level Requirement.
* Check Passed
- SQL Server Edition Operating System Compatibility (Warning) Messages * SQL Server Edition Operating System Compatibility
* Some components of this edition of SQL Server are not supported on this operating system. For details, see 'Hardware and Software Requirements for Installing SQL Server 2005' in Microsoft SQL Server Books Online.
* The current system does not meet the minimum hardware requirements for this SQL Server release. For detailed hardware and software requirements, see the readme file or SQL Server Books Online.
* Microsoft Internet Information Services (IIS) is either not installed or is disabled. IIS is required by some SQL Server features. Without IIS, some SQL Server features will not be available for installation. To install all SQL Server features, install IIS from Add or Remove Programs in Control Panel or enable the IIS service through the Control Panel if it is already installed, and then run SQL Server Setup again. For a list of features that depend on IIS, see Features Supported by Editions of SQL Server in Books Online.
- Internet Explorer Requirement (Success) Messages * Internet Explorer Requirement
* Check Passed
- COM Plus Catalog Requirement (Success) Messages * COM Plus Catalog Requirement
* Check Passed
- ASP.Net Version Registration Requirement (Success) Messages * ASP.Net Version Registration Requirement
* Check Passed
- Minimum MDAC Version Requirement (Success) Messages * Minimum MDAC Version Requirement
* Check Passed
furthermore i get error 26 when trying to create new sql server database. and while doing the SQL server surface area configuration i got this message.:
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) ------------------------------ Program Location: at Microsoft.SqlSac.MainPanel.FormFeatures..ctor(String machineName, Form callingForm)
HOpefully somebody out there will help me...or is this problem only appearing in sql server 2005 and would it be a better decision to install SQL server 2000...or if someone can help me rectify this problem i'll be really thankful.
please help newbieI need to create a lot of objects the same type (let's say: schemas)I wish to use paramerized block in loop to do so.- how to put names of my objects to such control-flow?belss you for help
passing serialised objects to a stored procedure for the purpose of data inserts. I see this as being a way to handle multiple row inserts efficiently.
However, in my limited use of XML data I am not so sure how to link the data when I have a dependency on another "object" within the serialised XML.
Below is a code snippet showing what I have so far.
The first insert statement works fine - but how to retrieve the identifier created by the DB - I want to use an SQL statement that finds the record in the table based on the XML representation (of the PluginInfo), allowing me to insert the ConfigurationInfo with the correct reference to the PluginInfo
DECLARE @Config NVARCHAR(MAX) DECLARE @Handle AS INT DECLARE @TransactionCount AS INT SELECT @Config = ' <ConfigurationDirectory > <ConfigurationInfo groupKey="Notifications" sectionKey="App.Customization.PluginInfo"
I am designing an application built on sql server 2000 how can I prohibit other sql server users from accessing my database and allowing only acceesing it through my application or through owner designer of sql server database.
my situation needs sometimes copying the db from the end user platforms to my designer computer to analyze some problems or maintainenace or modification, and also I have no control on users windows environment and I need the end user professional not to enter the my db from outside my application.
So, is there anything I can do to secure an MDF (MSDE/SQL Server 2000) file so that a user cannot see my schema under any circumstances.
Even if I lock the MDF down and secure the instance, a smart user can just shut off the SQL server, copy the MDF to another instance, sp_attachdb and open it with sa rights. I need a way to prevent others from getting inside my schema.