What are the best practices in writing a sql stored procedure?

I found that SQL stored procedures are very interesting and useful. I have written stored procedures but i want to w...

What does the N mean??

I have seen many SP like: SET @SQLString = N'SELECT @max_titleOUT = max(JobTitle) FROM AdventureW...

How to execute a stored procedure inside a select query?

SELECT col1, col2, col3, EXEC GetAIntFromStoredProc(T.col1) AS col4 FROM Tbl AS T WHERE (co...

How to use a DataAdapter with stored procedure and parameter?

I want to fill a DataGridView control using DataAdapter. But I don't know how to do it since I'm using a stored proc...

Insert results of a stored procedure into a temporary table?

How do I do a SELECT * INTO [temp table] FROM [stored procedure]? Not FROM [Table] and without defining [temp table]...

What is the difference between a stored procedure and a view??

I am confused about a few points: What is the difference between a stored procedure and a view? When should I use ...

Creating stored procedure and SQLite??

Is it somehow possible to create a stored procedure, when using SQLite? ...

How to schedule a stored procedure??

How do I schedule a stored procedure in Sql Server 2005 that it runs once at the start of every month (and on databa...

SQL Server: How to group by substring?

I have the following stored procedure to fetch data from a table. The table has a column "region" that contains val...

In SQL Server, what does “SET ANSI_NULLS ON” mean??

The definition says: When SET ANSI_NULLS is ON, a SELECT statement that uses WHERE column_name = NULL returns ze...

SQL Server Insert if not exists?

I want to insert data into my table, but insert only data that doesn't already exist in my database. Here is my cod...

Insert default value when parameter is null?

I have a table that has a column with a default value: create table t ( value varchar(50) default ('something')...

Entity Framework Vs Stored Procedures - Performance Measure?

I'm trying to establish how much slower Entity Framework is over Stored Procedures. I hope to convince my boss to l...

MongoDB Stored Procedure Equivalent?

I have a large CSV file containing a list of stores, in which one of the field is ZipCode. I have a separate MongoDB...