RSS

Tag Archives: sql

2012 Baton Rouge SQL Saturday & Tech Day

The information for this year’s Baton Rouge SQL Saturday & Tech Day came online this past week. It’s scheduled for August 4, 2012.

Free SQL Server, SharePoint and .NET training!  Chance to win great prizes!  What more could an IT Professional ask for?  If this sounds good to you, then don’t miss your opportunity to attend SQL Saturday #150 and TECH Day, the largest FREE training event in Louisiana dedicated exclusively to SQL Server, .NET, Development, SharePoint and Business Intelligence.   This is a COMMUNITY driven event!

For more information visit the official website at: http://sqlsaturday.com/150/eventhome.aspx

 
Leave a comment

Posted by on April 18, 2012 in Uncategorized

 

Tags: , , , , , , ,

SQL Server Foreign Keys and Indexes

This is another one of those cases that just beats it into your head to stop making assumptions.

My first delve into RDBMS’s was MySQL. When you create a Foreign Key in MySQL, it will create an Index for you. Unfortunately, I assumed that SQL Server would do the same. Then about a year ago, I was researching ways to speed up some of the queries in a customer’s application when I came across a thread on StackOverflow. What did I find? I was making the wrong assumption and you have to create both the Foreign Key and Index in SQL Server.

 
Leave a comment

Posted by on October 23, 2010 in Database Development

 

Tags: , , , ,

SQL Saturday #28: Baton Rouge

This Saturday (August 14th) LSU will be hosting SQL Saturday #28. The all day event will feature a number of great sessions and speakers. If you’re a technology professional in the Baton Rouge area, this event is a must. Along with the speakers and sessions, there will be plenty of local technology professionals attending (close to 600 registered attendees) which should make it a great event for networking.

The local user groups will also have a table setup to help spread the word. If you’re interested in getting involved with the .NET, SQL, or SharePoint user groups, please stop in and say hello. I’ll probably spend most of the day at the table talking up the New Orleans SharePoint User Group.

 
Leave a comment

Posted by on August 11, 2010 in Uncategorized

 

Tags: , , , , ,

InfoPath Data into SharePoint List and SQL

A client wished to push data into their SQL databases from an InfoPath form. Usually quite a simple task but the form was published to a SharePoint library and had fields published so they could be displayed in the library. We looked into a few different mechanisms but ultimately decided on a workflow set to start on creation or update of a list item. The workflow consisted only of a code block that produced the contents of the XML file stored in the SharePoint library and passed it into a stored procedure. The following code block was used produced the entire contents of the XML file as well as the file name.

/*
The variable workflowProperties is an instance of SPWorkflowActivationProperties:
SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();
*/
if (workflowProperties.Item.File.Exists)
{
    // get file contents
    string contents;
    using (StreamReader reader = new StreamReader(workflowProperties.Item.File.OpenBinaryStream()))
    {
        contents = reader.ReadToEnd();
    }
    string fileName = Path.GetFileNameWithoutExtension(workflowProperties.Item.File.Name);
}

At this point, you can use code to get specific values or pass the entire XML string to SQL depending on your requirements. I would recommend using SharePoint’s unique ID for the list item to identify the record in SQL. This will allow you to synchronize any CRUD operation on the SharePoint record to the SQL record.

 
1 Comment

Posted by on July 2, 2010 in Microsoft SharePoint

 

Tags: , , , , , ,

Free SQL 2008 R2 Ebook

Microsoft Press has released a free ebook entitled Introducing Microsoft SQL Server 2008 R2.

PART I Database Administration

CHAPTER 1 SQL Server 2008 R2 Editions and Enhancements 3
CHAPTER 2 Multi-Server Administration 21
CHAPTER 3 Data-Tier Applications 41
CHAPTER 4 High Availability and Virtualization Enhancements 63
CHAPTER 5 Consolidation and Monitoring 85

PART II Business Intelligence Development

CHAPTER 6 Scalable Data Warehousing 109
CHAPTER 7 Master Data Services 125
CHAPTER 8 Complex Event Processing with StreamInsight 145
CHAPTER 9 Reporting Services Enhancements 165
CHAPTER 10 Self-Service Analysis with PowerPivot 189

More information:
http://blogs.msdn.com/microsoft_press/archive/2010/04/14/free-ebook-introducing-microsoft-sql-server-2008-r2.aspx

 
Leave a comment

Posted by on April 15, 2010 in Database Development

 

Tags: , ,

T-SQL String Padding Functions

Some time ago I found myself needing to format the data within a dataset. I thought about writing the code for it but then realized that a SQL implementation would probably be more efficient. I wrote two functions fPadLeft and fPadRight to allow a varchar(MAX) to be padded with any character (in my case it was zeros).

Here’s the fPadRight function:

CREATE FUNCTION fPadRight
(
  @OrigString VARCHAR(MAX) = NULL,
  @PadLength INT = 0,
  @PadChar CHAR(1) = ''
)
RETURNS VARCHAR(MAX)
AS
BEGIN
  DECLARE @Result VARCHAR(MAX);
  DECLARE @OrigLength INT;

  SET @OrigLength = LEN(@OrigString);

  IF (@OrigLength >= @PadLength)
  BEGIN
    SET @Result = @OrigString
  END
  ELSE
  BEGIN
    SET @Result =  @OrigString + REPLICATE(@PadChar, @PadLength - @OrigLength);
  END

  RETURN @Result
END

The entire scripts, including if exists logic, are included in the following release:

SQL Padding Function Scripts (.zip)

 
Leave a comment

Posted by on June 9, 2009 in Database Development

 

Tags: , , ,

 
Follow

Get every new post delivered to your Inbox.

Join 57 other followers