
SQL Server, SQL Server Express, and SQL Compact Edition, and/or at other forums like stackoverflow, you could study the many questions and answers. Like the famous question: How do you get to Carnegie Hall? If your really want to learn, you must do, and do, and do. You might also consiider attending a course. accidental DBA I think it’s called) which causes quite a delay. I prefer to work on something real and with roots into actual problems meaning I mostly only get to play around with my skills and learn more about database (I’m actually a developer. You can find many non-MS tutorials, some you must pay to use: My problem is that while I would love to practice outside the work place, I struggle with arbitrarily defined or thought up examples. " Microsoft® SQL Server® 2012 T-SQL Fundamentals" Imho, it's worth your time to study the schemas: (v=sql.100).aspxĪshvin, there are no shortcuts to learning this. That article address, at length the various components of a connection string and the areas they influence.Ashvin, i'm guessing you've been here already: To know more about connection strings and their anatomyĪ couple of years ago, I wrote a piece on ( Connection Strings 101). It is therefore a best practice to also set the Application Name and Workstation Id as part of the connection string of your application. Now, the SQL Server can be programmed to only log connections not originating from certain applications, or can be programmed to respond differently when the same database/stored procedure is being executed over different connections – the possibilities are endless! Running the same test again shows us that the Profiler can now distinguish between the calls coming in via “MyTestApp” through it’s the various sessions (represented as the HostName) v/s the calls coming in from the SQL Server Management Studio itself. Provider=SQLNCLI10 Data Source=WINDOWS8RPSQL2K12 Initial Catalog=AdventureWorks2012 User ID=someuser Password=userpassword Application Name=”MyTestApp” Workstation Id=”SSMS01” For the ADO connection string shown above, a simple modification like the following would work wonders: The solution – Modify your connection string!įrom an auditing and troubleshooting standpoint, it is therefore, always a good practice to include the application name of the calling application and the workstation Id of the workstation. In production systems, this is not the case and therefore, an alternate approach becomes necessary. Therefore if the associated SPID is known, auditing is not a difficult task. Now, we know that each query editor will open it’s own connection to the SQL Server. You can also develop a test application and run multiple instances of the application to observe a similar behaviour. I then executed the same T-SQL query from these query editor windows, and attempt to identify each connection using the SQL Server Profiler (Refer tutorial here). Let’s just see an example of this situation.įor this demo, I launched multiple query editors within the SQL Server Management Studio, connected to the same instance of SQL Server. Database mirroring practice, Programmer All, we have been working hard to make. Not only is this bad from a security standpoint, it is also not recommended from an auditing and troubleshooting perspective also. The request could have come from almost anywhere and it would have honoured the request provided the details were correct. To the SQL Server, the originator of the request is essentially unknown. What it does not have is the information about the calling application. the credentials for a successful SQL authenticationĪll of the above constitute required information, and includes all the essential information about the SQL Server instance.


To most developers, a simple ADO connecting string would be something like: Exercises are growing in difficulty, from the most basic to others a bit more complicated, where you’d get data from more than on table in the.

The first day of this journey we’ll work on the most basic statement I can think of, the SELECT statement. Connecting Strings have the power to influence: Day 1 AdventureWorks, some basics about SELECT, JOINS and more. The connection string serves a purpose much greater than simply connecting the two together. The glue that holds the connection between an application and a SQL Server instance is just a simple string, called the “connection string”.
