Tag | SQL Posts

If you are a developer, you will encounter countless problems in your career. As a developer, problem solving is what you do. Still, some may try to shy away from problems in order to make their lives easier. I say do not, especially if you are a new developer or are learning a new technology. Learn to embrace problems as they come along. I am not simply referring to basic business problems, but issues that you encounter that cause weird problems that you must solve in order to continue. I’ll give ...
Introduction By now, most of you have heard that Windows Phone 7 – Mango release will support Local Databases (SQL CE) using Linq to SQL. But what you probably haven’t heard much about is how to extract the .SDF that is created in isolated storage to your local computer and view the contents. I find this extremely important for debugging application and making sure my database is setup exactly like I want it. So, that is what we are going to do today. Getting Started with a sample application: For ...
To start, I love Red Gate Software’s Tools. I have loved them since the first time I started using SQL Backup and SQL Compare when I first started Geekswithblogs.net. I think they create quality products and have been a “Friend of Red Gate” for years. So know that this review is coming from a “fan boy” of sorts. What is SQL Compare? Well the name sort of says it all, this product compares SQL databases. But not just databases, but backups, snapshots, and source control using their product SQL Source ...
Recently I used Entity Framework 4.1 with Code First approach and step on a hidden rake. My application should create an SQL Server CE database file using supplied model classes. I created some model classes, one of the classes was declared as namespace MyProject.Models { public class Object { public int Id {get; set;} public String Name {get; set;} } } Then, I tried to declare property of DbSet<MyProject.Models.O... type in my class derived from DbContext: namespace MyProject.Models { public ...
The last thing anyone wants to do is mess up an UPDATE statement! Here's a quick refresher for those of you using SQL Server: Simplest case (a single row, in a single table with a single known value in a column): UPDATE YourTableName SET Column1 = ‘NewValue’ WHERE SameOrOtherColumn = ‘OldValue’ Most common case (multiple rows, using another table as the source data with multiple columns): UPDATE YourTableName SET ColumnX = OtherTable.Column1, ColumnY = OtherTable.Column2 FROM OtherTable WHERE YourTableName.Column1 ...
To quickly look through your stored procedure objects for a text value in a database instance, do the following: use [Metro] go SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION LIKE '%whatyouarelookingfor%' AND ROUTINE_TYPE = 'PROCEDURE' Now, this is no replacement for a configuration management repository, but it will do in a pinch. BTW, remember this sql statement does NOT transcend all databases on the server, just a single db instance ...
It’s been quite a while since I’ve done a GeeksWithBlogs.net Influencers review. This time, I had the opportunity to check out Red Gate’s SmartAssembly 6.1, which is a integrated collection of tools for modifying and manipulating assemblies. Now that phrase, while accurate, is quite a mouthful. So what all does it actually do? SmartAssembly has the ability to: Do strong name signing; Add automated error reporting; Add feature usage reporting; Merge dependencies (e.g. libraries) into the main assembly ...
Apologies in advance for any problems caused as I move over to http://ericnelson.wordpress... over the next few days. I will blog again on here when the move is fully complete. I have had a superb time on http://geekswithblogs.net which I moved to back in January 2009 – but it doesn’t quite match what I am after in a blogging platform right now where as wordpress.com broadly does. This will be my second change of platform in 7 years – it was back in July 2004 I created my first technology blog over ...
NHibernate has many ways to create and executes queries. With one of them* - the Named Queries we can execute our manually created stored procedures. This example is dedicated to SQL Server. This is important to notice, because this code is database specified. That means, for each database the query can look diffrent. E.g. in SQL Server we call the stored procedure by using the syntax: exec <procedure>. In Oracle it is: call <procedure>, so we must remember it. Let's assume we have a ...
I just wanted to return from sql server data as xml. This is very easy to do, because sql server has a build-in suppot for that. select Id, Name from Extensions FOR XML RAW('Extension'), ROOT('Extensions') But using this query, the returned column has name like XML_F52E2B61-18A1-11d1-B105... It's been some time when I manually created a sql query, so I lost few minutes to think, how to alias this column using the AS keyword. Correct query looks as follows select (select Id,Name from Extensions ...
SQL Server “Denali” is at CTP3 – and would therefore very much welcome feedback. SQL Azure continues an aggressive cycle of release - and would therefore very much welcome feedback. Which is why we have https://connect.microsoft.c... A great place to give feedback and to to see what others care about. For SQL Azure (and the Windows Azure Platform in general) we also have http://www.mygreatwindowsaz... Thanks in advance… ...
The Microsoft SQL Server team has been interacting on a regular basis with developers and users in the form of surveys. If you have 15mins spare and would like to do your bit to help shape the roadmap for SQL Server then please pop over to http://www.zoomerang.com/Su... And… My own simple one question version if you only have one minute to spare. Apologies in advance for stuff I left out! Related Links: More details of the survey are posted on the ADO.NET team blog ...
In September we will start to deliver monthly workshops on the Windows Azure Platform to help Microsoft partners who are developing software products and services and would like to explore the relevance and opportunities presented by the Windows Azure Platform for Cloud Computing. Overview: The workshops are designed to help partners such as yourself understand what the Windows Azure Platform is, how it is being used today, what resources are available and to drill into the individual technologies ...
I have a client that desired to have the MOSS 2007 capability of My Links but in no way wanted My Sites in SharePoint 2010. I took some steps that gave them the capability of My Links by creating a personalized web part that could be linked to in a modal. It worked, However, in addition, they didn’t want users without web admin rights to see the SharePoint ribbon. The result was that admins could use the web part and the personalization data would be kept by SQL in the personalization database. Members ...
There is a misunderstanding about SQL Injection attack in that some people think that that is is restricted to Microsoft. Here is a case where it happened on a PHP system. see http://www.securityfocus.co... Proud fan ofThe best C# & VB.NET refactoring plugin for Visual Studio ...
The origin of the following is now lost in the mists of time but it bears repeating. A big party is being held to honor relational database systems & their impact on the modern society. Outside the venue, the host awaits the guests. The first limousine arrives and out steps Oracle followed by 4 people Host: Who have you brought along? Oracle: I have 4 DBA’s in tow. One to install me, one to design the databases, one to administer me and the other to justify the cost. A second limo arrives and ...
Recently i caught in a peculiar situation where i need to modify the check constraint expression to include more criteria to be validated through T-SQL. Although there is no declarative command or mechnism to modify the expression except dropping and recreating the check constraint. One exception is to use the Sql Management studio to modify it in design mode. But modifying using design mode was out of scope. The actual work was to alter or modify the defintion of a check constraint created with ...
Performing Composite Operations on Oracle Database is very similar to SQL Server Database. I just want to point out one mistake developers might easily make during the send port configuration. For any composite operation, the generated binding script doesn't include the composition operation tag in SOAP action header, therefore a new line needs to be manually added for each composite operation during the send port configuration. For WCF SQL Adapter, it looks like <Operation Name="CompositeOperationName" ...
Everyone has a journey. You start off young & stupid, and 2 decades later, you're closer to understanding the nature of reality. That’s one of the main goals in life, to seek knowledge (justified, true beliefs – pick any 2 J ). I must have read 5000 books in my life. From some of my readings it could be construed that reality computes itself, It from Bit. From others, it can be concluded that Entropy is decreased by increased rates of computation, and in the short span of human civilization, ...
In this Issue: Morten Nielsen(-2-), Mike Gold, Jesse Liberty, Derik Whittaker, Den Delimarsky, Austin Andrews, and Oscar Agreda. Above the Fold: Silverlight: "Silverlight MVVM Code Smith Templates" Oscar Agreda WP7: "Working with a simple ViewModelLocator from MVVM-Light" Mike Gold From SilverlightCream.com: WPF vs. Silverlight - Part 4 - Animations Part 4 of Morten Nielsen's WPF and Silverlight comparison yeields this post on Animations... the launching thereof to be exact WPF vs. Silverlight - ...
No matter which ORM or data access technology you use, at some point you just need to do some CRUD, and you need to do it fast. In this post, I’m going to show you how to get your CRUD on with the latest version of Entity Framework in no time flat. In fact, I’d be surprised if the code to get your first CRUD operation done takes you more than a few minutes. The one thing the EF team did right with Code-First is make it really easy, but most of the “getting started” videos and documentation is packed ...
In this Issue: Kunal Chowdhury, Beth Massi(-2-), Gill Cleeren, Rajat Jaiswal, Mike Taulty, Jesse Liberty, Derik Whittaker, Den Delimarsky, Austin Andrews, and Oscar Agreda. Above the Fold: Silverlight: "How to Close Browser Window from Silverlight Application?" Kunal Chowdhury WP7: "How to access blacklisted apps in the Windows Phone emulator ROM (with the locked BIN image)" Den Delimarsky LightSwitch: "Getting Started with the LightSwitch Starter Kits" Beth Massi Shoutouts: Michael Palermo's Desert ...
Today I wanted to count each unique element in a SQL Server table to make sure they were unique. Took a bit of playing but this finally works great: SELECT DISTINCT t.columntocheck, (Select COUNT(columntocheck) from tabletoserach where columntocheck = t.columntocheck) as countof FROM tabletoserach t This gives me back a list of all unique items in columntocheck and also counts the number of them. Of course, theres no where clause on this so be careful if you have a huge table. Mine was really small, ...
In this Issue: Colin Eberhardt, Ollie Riches, Morten Nielsen(-2-), Mike Taulty, Den Delimarsky, Derik Whittaker, Oscar Agreda, Austin Andrews, Manas Patnaik, and Jesse Liberty(-2-). Above the Fold: Silverlight: "Conditional CellTemplete controls at Runtime in Silverlight DataGrid" Manas Patnaik WP7: "Implementing a Windows Phone 7 Conversation View Part Two" Colin Eberhardt Expression Design: "Tutorial: Creating an Icon" Austin Andrews Shoutouts: SilverlightShow has their top 5 from last week listed: ...
In this Issue: Michael Washington, Pontus Wittenmark(-2-), Derik Whittaker, Peter Kuhn, Michael James, XamlNinja, Adam Kinney, Morten Nielsen(-2-), Alex Sorokoletov(-2-), and Den Delimarsky. Above the Fold: Silverlight: "WPF vs. Silverlight - Part 1 - Custom Controls Theme" Morten Nielsen WP7: "New Windows Phone “How Do I” Video Series" Adam Kinney LightSwitch: "The LightSwitch Control Extension Makers Dilemma" Michael Washington Shoutouts: Michael Palermo has his latest Desert Mountain Developers ...
Just an update .... I'm currently working on the next presentation in the multi-part of a series on the Applied Design Patterns project called “AdventureWorksDesignPatterns” . It has been a busy summer both at work and home. Summer is "DIY" time at my house as I'm building a 16 by 20 foot raised deck. Work wise ..... Some of my team and I have been updating some of our "Demonstration" and "Proof Of Concept" applications to test out Microsoft's Windows Azure, SQL Azure and AppFabric. This is turning ...
In this Issue: Oren Gal, Oscar Agreda(-2-), Michael Washington, Mike Gold, John Papa, Paul Sheriff, Jesse Liberty(-2-), András Velvárt, and Derik Whittaker. Above the Fold: Silverlight: "here is a Complete Silverlight Business Application using MVVM" Oscar Agreda WP7: "SurfCube on Mango Part 2– The SystemTray" András Velvárt LightSwitch: "WCF RIA Service: Combining Two Tables" Michael Washington Shoutouts: Michael Crump's articles on OData at Silverlight show have been pulled into an eBook: My eBook ...
After a few months of work, I am very happy to announce that the Dallas TechFest Speaker line up and schedule is full and finalized. You can find it on the Dallas TechFest website or on Michael Perry’s Windows Phone 7 app in the marketplace. I am very excited to see some of the more popular speakers such as Denny Cherry, Miguel Castro, Matt Hienze, Chris Koenig, and Caleb Jenkins to name a few. I am also jazzed about some of the new faces like Calvin Carter and Kumar Unnikrishnan and their enthusiasm ...
This is very cool Just found this fab, tool to generate all the insert statements you need from a SQL database. If you have SQL Server 2008 R2 Installed - Run "C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Publishing\... This lets you select individual tables, views, stored procedures and script out both data and schema structures. Perfect for populating SQL Azure, when migrating from on-Premise databases ...
This morning I got the information that the Windows Azure Tools for Visual Studio 2010 - August 2011 Upgrade had been released. The version of this new upgrade is 1.4.40727.1601 with the Windows Azure SDK v1.4.20407.2049. This upgrade includes some awesome features that I was looking forward for a long time, which are: Profiling the application running in Windows Azure. New ASP.NET MVC 3 web role template. Multi-configuration files in one cloud project. More validation in the service package and ...
Today's $10 Deal of the day from Apress at http://www.apress.com/97814... is Beginning SQL Server 2008 Administration. "Beginning SQL Server 2008 Administration is essential for anyone wishing to learn about implementing and managing SQL Server 2008 database." Proud to useIn-depth C# code analysis with instant errorand warning highlighting and quick-fixes ...
Normal 0 false false false EN-GB X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.000... mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Calibri","sans... mso-bidi-font-family:"Times New Roman";} There remains a lot of complacency concerning ...
In this Issue: Max Paulousky, Ollie Riches, Derik Whittaker, John Garland, WindowsPhoneGeek, Manas Patnaik, Xianzhong Zhu, John Papa, Dhananjay Kumar, Jesse Liberty, Peter Torr, Gill Cleeren, and Jonas Follesø. Above the Fold: Silverlight: "Multiple MonthView DatePicker Control in Silverlight" Manas Patnaik WP7: "Silverlight TV 79: Data Binding Debugging" John Papa From SilverlightCream.com: Windows Phone (Mango) DB Engines Performance Testing Max Paulousky's latest post is on performance testing ...
CTEs or common table expressions can be used to make recursive SQL stantements. CTEs are ANSI-99 standard. Please read www.sql-server-performance.... for more information. I have only had 2 instances in my career where CTEs made sense for me to use in a pratical setting. If you have found them more practical, please share. The first time I needed a CTE I was displaying corporate branches from a recurssive table. Some branches had branches, which had branches, and so on, whereas ...
As of today, the official release of Lightswitch is now available. Visit: http://www.microsoft.com/vi... or you can download from your MSDN subscription. What is Lightswitch? It is basically a simple to use application generator that can be used to build applications within minutes in many cases. If you have an existing, well structured (primary keys, relationships) SQL Server database you are just a few clicks away from an administration tool and well on the way to a full ...
This blog will help you prepare for an upcoming release of SQL Azure that will offer support for Data Federation. While no date has been provided for this feature, I was able to test an early preview and compiled a few lessons learned that can be shared publicly. Note however that certain items could not be shared in this blog because they are considered NDA material; as a result, you should expect additional guidance in future posts when the public Beta will be made available. What is Data Federation? ...
In our environment most of developers use SQL Server 2008,but in production we have SQL Server 2005, and some databases still have compatibility level 80(SQL server 2000) It sometimes causes problems E.g. the SQL wtitten on SQL Server 2008 INSERT INTO[dbo].[SiteIds] ([SiteID], [SiteCode],[ParentID]) VALUES (11,'ChildOfXX',(select [SiteID] from [SiteIds] where SiteCode='XX')) GO on SQL Server 2005 caused Msg 1046, Level 15, State 1, Line 5 Subqueries are not allowed in this context. Only scalar expressions ...
I have a need for a highly responsive web page that must at least appear to be "pushed" information from the server as it happens, much like you'd see with an HTTP protocol based chat window. The client will utilize JavaScript, and will use JQuery and its UI plugins, and will use its AJAX support to call the requests that will only return when there is data to be "pushed". I know HTML 5 includes support for WebSockets, but I feel it is too soon to rely on them, as the spec is not yet finished and ...
In a number of talks I’ve given, including a session at last year’s Microsoft BI Conference, I’ve mentioned that if you’re not looking at partner offerings in the Microsoft Business Intelligence ecosystem, then you’re not getting the full Microsoft BI picture. This rubs two ways: Microsoft BI may look misleadingly deficient, in comparison to its competitors, if partner solutions are not taken into consideration If you’re an MS BI user and you’re not looking at partner products, your MS BI investment ...
MvcScaffolding is a tremendous productivity improvement for MVC developers. Earlier this year, Steve Sanderson posted the definitive 7-part series on MvcScaffolding which is a must-read for anyone serious about doing scaffolding. The best part about the scaffolding infrastructure is that MvcScaffolding is actually built on top of another package called T4Scaffolding. T4Scaffolding can be used as the basis for *any* scaffolding – not just MVC projects. To that end, we can enjoy the same power of MvcScaffolding ...
Technorati Tags: Team Foundation Server 2010,Power Tools,TF254027 Error Recently moved from TFS 2010 server to another TFS 2010 server and trying to configure a backup plan using the Backup plan wizard that comes along with the TFS Power Tools. The tool allows you to set up Team Foundation Server backups - The tool can schedule backups for the following databases that your deployment of Team Foundation Server uses: the configuration database the database for each team project collection the databases ...
Today it will be a concise post, but I hope quite helpful and informative. As most SSIS developers know SSIS Expressions are used to drive several key tidbits of a package components as the Conditional Split, Package Variables value assignments, Derived Column Transformation, form a SQL statement for Execute SQL task, drive precedence constraints, set package properties as connection string for example and more. So it is hard to underestimate the importance of the SSIS Expressions for a SSIS developer. ...
In exploring the SQL Server site at microsoft.com, I came across the Learning Center option. It is a wealth of information to become familiar with the features and capabilities of the platform. It has as I mentioned, a wealth of information. Available for versions 2008 R2, 2008 and 2005. Go check it out here: http://www.microsoft.com/sq... A sample clipping of what the site displays: ...
After done mapping for my entities I wanted to test the basic CRUD operations. I stuck with a problem of inserting a data to tables in many to many relation, so I wanted to look at the generated sql by the NHibernate to find out, what is really generated to investigate the problem in my mappings. The NHibernate have a property called show-sql to show the generated statements. I enabled it in the config: var configure = new Configuration(); configure.SessionFactoryNam... configure.DataBaseIntegrati... ...
I just wanted to add a log4net library to log all the sql commands generated by NHibernate, but there was one problem. After I downloaded this library using NuGet, I could add a code from this assembly to configure the library, intellisense worked as usual, but when I wanted to compile the project, I ended with error The name 'log4net' does not exists in the current context This was new experience to me, because I have never had that strange situation. In every other solution that I created, this ...
If you aren't sure what is actually in the backup file, or even if you think you are sure--execute this statement from a fresh query window: RESTORE FILELISTONLY FROM DISK = 'X:\MDD\Clients\Lg\H4\H4L.bak' The information about the mdf/ldf files will show up looking like this: In this example, I was restoring a database to a different server with different filegroups, directory setups, etc.--so I had to 'MOVE' the location paths to represent the drives I had available. If I were restoring to the same ...
Hi there, Recently we had a requirement to integrate a RESTful Service with BizTalk Server. Well no biggie. You can use WCF – Custom Adapter and use webHTTP binding and add a webHttp Endpoint behavior. Wala. Easy to say, little bit tricky to do. That all is fine, but what if you want to have a polling receive location which needs to go and do an HTTP GET to a RESTful Service. Aahh!! That’s even more trickier. Bunch of you reading this post would have already thought about some or other way of doing ...
I'm diving in the NHibernate 3.2 mapping by code recently. I throught that, mapping a string with specific max length to the appropriate database table will be easy, but it wasn't. I lost some time to figure it out. At the beginning I mapped a string field in that way Property<string>(x => x.Title, x => x.Length(Int32.MaxValue)); After generating the tables in database with my schema, unfortunatelly this field was generated as a nvarchar(255) and I didn't know why. We can deal with it ...
Today's $10 Deal of the day from Apress is Expert SQL Server 2008 Development "Focuses on sound development and architectural practices that will help you become a better developer, capable of designing high-performance, robust, maintainable database applications." www.apress.com/media/catalo... ...

At http://searchsecurity.techtarget.co.uk/tip/How-to-stop-SQL-injection-and-prevent-data-compromises there is a free download on measures to combat SQL Injection Attack. (free registration is required).

One very important thing to note is that SQL Injection Attack is not confined to IIS / SQL Server but has occurred on many non-Microsoft systems.