What is the syntax to create a table variable?
CREATE TABLE @username (name nvarchar(50))Please suggest any option.
View Articleavoid table writes in cursor
Hi guys,I was wondering if there is a way to avoid table writes(select into or insert into) inside cursors. I mean, if i can use the data that is being formed inside the cursor without storing in...
View ArticleChange row to column when inserting to temp table
Hi all, I need some help with this - I want to create a temporary table. To the temp table I want to insert a row from a different table BUT I want this row to be in a column form inside the temp...
View Articleselect into temporary tables
Hello,I have the following script:create table #tabela1(DocNo varchar(50),Rata int) select d.DocumentNumber, isnull(LS.Amount,0)+isnull(LS.InterestAmount,...
View ArticleMust declare the table variable in a stored procedure
Hello. I have this sp:ALTER PROCEDURE [dbo].[sp_test] @strID varchar(5) AS BEGIN DECLARE @columnID int, @columnName varchar(50) DECLARE @tempTable Table (buuID int primary key (buuID), buuName...
View Articleerror 9001: tempdb log is not available
I have SQl Server 2000. I wrote following stored procedure for one of my queries. I am .net programmer do not know much about sql. All of a sudden from last week , our tempdb database is blown up and i...
View ArticleBest method to build a transactional database summary
Hi,I'm new to SQL programming & SQL Server. I'm running SQL Server 2008.Problem: I have a database table (1 million+ lines) with transactional information (i.e. sales, returns, etc.). A sample is...
View Articlehow to improve performance of a LIKE clause?
I have a query that's taking a reasonably long time - analysis of the execution plan points the finger at a LIKE clause. Due to the nature of how I'm dealing with hierarchies and parent/child...
View ArticleCursor runs faster on Physical tables versus Temp Tables?
Why would a cursor run faster on physical table than on a temporary table? My tempdb is no slouch either, sits on a 4 disk RAID 10.
View ArticleAre Table Variables a bad thing?
I would very much like the experts advice on the subject of Table Variables and Temporary tables. What should be the recommendation on their use? I wrote an article on Simple-Talk recently called...
View Article@temptable vs #temptable
I have a little confusion about @temptable & #temptable. Can somebody guide me **when to choose @temptable instead of #temp & vice versa** ? Please note that i have the basic knowledge about...
View ArticleDynamic Table Optimization - Select *
Hi All, I have a dynamically created temp table that is a result of several processing steps. At the end of the program I do a select * fromt the table and then the excel VBA program copies the result...
View ArticleTable variables in user defined functions
Hi All, Recently I had been asked the **difference between temporary tables and table variable**. then one point I mentioned that only table variable can be used in the user defined functions but not...
View ArticleSSRS 2008 Temp Table
Hi, Here is the what i have encountered. I have a report which uses a couple of temp tables. The reports are deployed and here is the issue. The execution time of report is changing with No.of users....
View Articletemp table vs data flow task on physical table
Here is the scenario I have one staging table for csv file which is My source I am loading it into physical staging table I will be doing transformations on this staging table data in later part of...
View ArticleJoining to local tables vs #temp tables
We have a warehousing stored procedure that creates #temp tables (some of these have up to 100k rows), then creates indexes on them and uses them to join to other #temp tables or regular tables (some...
View ArticleLoan EMI Mortgage Calculation
dear Geeks good day to you !!! I am stuck in a very huge problem while creating a calculator of Loan in which Mortgage will be added on daily basis. there are inputs as below...
View ArticleYou executed this command to create a temporary table: (inside) What is true...
Hello, i need answer to this question. Thanks a lot. You executed this command to create a temporary table: SQL> CREATE GLOBAL TEMPORARY TABLE report_work_area (startdate DATE, enddate DATE, class...
View ArticleMust declare the table variable in a stored procedure
Hello. I have this sp:ALTER PROCEDURE [dbo].[sp_test] @strID varchar(5) AS BEGIN DECLARE @columnID int, @columnName varchar(50) DECLARE @tempTable Table (buuID int primary key (buuID), buuName...
View Articleerror 9001: tempdb log is not available
I have SQl Server 2000. I wrote following stored procedure for one of my queries. I am .net programmer do not know much about sql. All of a sudden from last week , our tempdb database is blown up and i...
View Article
More Pages to Explore .....