This blog is subject the DISCLAIMER below.
Showing posts with label MSSQL. Show all posts
Showing posts with label MSSQL. Show all posts

Wednesday, September 15, 2010

SQLServer : How to know the last modified table in your DB

Here is simple T-SQL tip but great to be known. It was part of my task today :). It was making auditing tables for tables created after specific date.

Select * from sys.objects where type_desc= 'USER_TABLE' ORDER BY modify_date desc

type_desc : is object type in SQL and here we wrote 'USER_TABLE' as we need tables created by user.

.. more.

Sunday, October 11, 2009

Table-Value and Temp Tables

Table-Value Parameters
Table-value parameters offer more flexibility and better performance than temporary tables to pass a list of parameters. Table-value parameters do not acquire locks for the initial population of data from a client and do not cause a statement to recompile.

Table-value parameters offer the following benefits:
·Provide a simple programming model.
·Enable inclusion of complex business logic in a single routine.
·Reduce round trips to the server.
·Include a table structure of different cardinality.
·Enable strongly typed and set-oriented queries.
·Enable the client to specify sort order and unique keys.

Table-value parameters have the following restrictions:
·Statistics are not maintained on columns of table-value parameters.
·Table-value parameters must be passed as input READONLY parameters to Transact-SQL routines.
·DML operations such as UPDATE, DELETE, or INSERT cannot be performed on a table-value parameter in the body of a routine.
·Table-value parameters cannot be used as the target of a SELECT INTO or INSERT EXEC statement. Table-value parameters can be in the FROM clause of SELECT INTO, or in the INSERT EXEC string or stored procedure.

Source: http://bit.ly/3rmMLK

.. more.

Wednesday, September 09, 2009

Want to learn SQL Server Data Services (SDS)?

Overview of Microsoft SQL Server Data Services
This 1-hour online clinic provides SQL Server developers who are experienced in implementing database solutions with an overview of SQL Server Data Services (SSDS).

The topics covered in the clinic include:
- Introduction to SSDS
- SSDS Object Model
- Working with SSDS

More on: http://learning.microsoft.com/Manager/ResourceDetails.aspx?resourceId=cbe836be-394e-4a23-9f87-5d12127cccd5&clang=en-US&brand=Learning

Developing an Application for Microsoft SQL Server Data Services
This 1-hour online clinic provides SQL Server developers who are experienced in implementing database solutions with an explanation of the knowledge and skills required to develop an application in SQL Server Data Services (SSDS).

Topics covered in the clinic include:
- Building an SSDS Application
- Enhancing an SSDS Application

More on: http://learning.microsoft.com/Manager/ResourceDetails.aspx?resourceId=9b2d7204-9f2e-4657-a4c7-0952b32ae081&clang=en-US&brand=Learning

More on SQL Azure Database: http://www.microsoft.com/azure/data.mspx

.. more.

Friday, August 17, 2007

Solveing DateTime problem (SQL Server)

Are you created a table have a dateTime field before ? Are this field made a problem with your application because both of them have a different format ? if you don't want to change the operating system dateTime format to unify both …..

Read , this article that try to solve this headaches .

By the way , I found two SQL Server functions that may be a way to solve the problem because they provides a number of options you can use to format a date/time string.

  • getdate()

  • convert ( , )

by mixing the usage of both you can get your goal as this :

select convert(varchar, getdate(), 9)

that returns :

Dec 11 2007 11:11:11:111AM

You have many date and time schemes by changing the second parameter in Convert function (use one of the below values to change the format).

Rang (1 to 7 + 10 + 101 to 107 + 110 + 111 ) Date format

Rang ( form 8 + 14 ) Time format

Rang ( 9 or 109 ) DateTime format

Explore this simple Demo :


create table fci_blog_table1
(
z datetime null
)
/*Demo1 ,How to insert */
insert into fci_blog_table1 values ( convert(varchar, getdate(), 1))

create proc fci_blog_pro1 /*to make a stored proceure*/
@x int output
as
select @x = 1
WHILE (@x < style="color: rgb(51, 51, 255);">BEGIN

select convert(varchar, getdate(), @x)
select @x = @x + 1
END

PRINT 'Have a nice time'

DECLARE @TheCount int
EXEC fci_blog_pro1
@x = @TheCount OUTPUT
Select TheCount = @TheCount

.. more.

Wednesday, February 14, 2007

Get your Video Series: SQL Server 2005 Express Edition for Beginners CD

We would like to announce about we have downloaded “Video Series: SQL Server 2005 Express Edition for Beginners”
So, for whom they like to take it, kindly, drop a comment! just to know the number of people, 3rd year students have higher priority as they study Microsoft SQL Server 2000
So, volunteers who will burn more CDs kindly, drop a comment!
Actually there are 5 CDs for anyone and 5 CDs for volunteers (who should copy at least one CD for other people)

.. more.

Monday, February 12, 2007

Video Series: SQL Server 2005 Express Edition for Beginners

Getting Started with SQL Server Express

This video series is designed specifically for SQL Server beginners—individuals who are interested in learning the basics of how to create, manage, and connect to SQL Server Express databases. Whether you’re just a beginner or somewhat familiar with databases, these video lessons will help you get better acquainted with SQL Server 2005 Express.

Getting Started

The series includes almost 9 hours of video-based instruction that walks SQL Server beginners through the steps of learning about SQL Server databases to actually connecting a SQL Server database to a Web application. Select your starting point below based on your skill set.
Introduction
Learning Video 1: What is a database?
Designing Tables
Learning Video 2: Understanding Database Tables and Records
Learning Video 3: More about Column Data Types and Other Properties
Learning Video 4: Designing Relational Database Tables
Database Functions
Learning Video 5: Manipulating Database Data
Learning Video 6: More Structured Query Language
Learning Video 12: Creating and Using Stored Procedures
Learning Video 13: Enabling Full-Text Search in your Text Data
Creating and Using Reports
Learning Video 10: Getting Started with Reporting Services
Learning Video 11: Embedding, Packaging and Deploying SQL Server Express Reporting Services
Database Security
Learning Video 7: Understanding Security and Network Connectivity
Database Management
Learning Video 9: Using SQL Server Management Studio Express
Publishing to the Web
Learning Video 8: Connecting your Web Application to SQL Server 2005 Express Edition

For more information, here

.. more.