Create SQL Table From Excel Or DataTable?

Jul 24, 2007

Hello,
I am trying to create a new table in SQL Server based on an excel sheet someone uploads to my site (ie No DTS, and I don't know the field names).  How can I easily do that? 
Can I make a sql table based on a DataTable without going row-by-row?  Cause then I could go excel to datatable to sql table.

Thanks a bunch, 

View 3 Replies


ADVERTISEMENT

How Do Create Table From Excel (based On Excel Column Name) And Import Data From It?

Jun 14, 2006

l've the following situation,

l've some excel files controlled by Vendor which changing frequently. The only thing does not change is the header name of each column.

So my question is, is there any way to create a new table based on the excel file selected including the column name in SSIS? So that l can use the data reader as source to select those columns l am interested on and start the integration.


Thanks.

Regards,
Yong Boon, Lim


p/s : The excel header is at the row 7.

View 3 Replies View Related

Using CREATE TABLE DDL On Excel Creates Two Tables

Mar 11, 2008

Hello. I am using OLEDB 4.0 to create an excel file and store DataTable rows into it. I am using

CREATE TABLE [SheetName] ([Column1] longtext, [Column2] longtext....

DDL and then write data using INSERT INTO ... DDL.

There are three strange things that i've encountered and will be glad to get help from anyone:



If I use as a table name expression with spaces, the name is changed to expression with underscore '_' symbol instead of spaces.
I can not set trailing '$' when creating a table, but when inserting data I have to use the name with traling '$' otherwise the exception is thrown. Moreover, if i get the scheme of the Excel file later I am getting TWO tables instead of one: a first with the name without '$' and another the same with trailing '$'. Nedless to say that visually Excel shows only a name without '$'
If I am trying to do same operations using OLEDB 12.0 (Office2007) I get invalid file.
If anyone knows how I can overcome above issues, please write me a code. I am coding in C# but VB examples are as good as any other.

View 5 Replies View Related

How Can I Create A DTS Package To Update A Table With Data From An Excel Spreadsheet?

Jul 9, 2006

Every month a client sends a spreadsheet with data which we use to update matching rows in a table in the database. I want to automate this using a DTS package but am having quite a bit of trouble accomplishing what I think should be trivial task. I've been attempting to use a Transform Data Task with a modification lookup but I just keep inserting the rows from the source excel spreadsheet in to the existing destination table without ever modifying the existing data.

Any guidance would be greatly appreciated as to a best practice approach.

View 3 Replies View Related

T-SQL (SS2K8) :: Create Separate MS Excel Files By Looping Through Large Table

Jun 24, 2014

I have a master table containing details of over 800000 surveys made up of approximately 400 distinct document names and versions. Each document can have as few as 10 questions but as many as 150. Each question represents one row.

My challenge is to create a separate spreadsheet for each of the 400 distinct document names and versions containing all the rows and columns present in the master table. The largest number of rows would be around 150 and therefore each spreadsheet will not be very big.

e.g. in my sample data below, i will need to create individual Excel files named as follows . . .
"Document1Version1.xlsx" containing all the column names and 6 rows for the 6 questions relating to Document 1 version 1
"Document1Version2.xlsx" containing all the column names and 8 rows for the 8 questions relating to Document 1 version 2
"Document2Version1.xlsx" containing all the column names and 4 rows for the 4 questions relating to Document 2 version 1

I assume that one of the first things is to create a lookup of the distinct document names and versions assign some variables and then use this lookup to loop through and sequentially filter the master table data ready for creating the individual Excel files.

--CREATE TEMP TABLE FOR EXAMPLE

IF OBJECT_ID('tempdb..#excelTest') IS NOT NULL DROP TABLE #excelTest
CREATE TABLE #excelTest (
[rowID] [nvarchar](10) NULL,
[docName] [nvarchar](50) NULL,

[Code] .....

--Output

rowIDdocNamedocVersionquestionblankField
1document11q1NULL
2document11q2NULL
3document11q3NULL
4document11q4NULL
5document11q5NULL
6document11q6NULL

[Code] .....

View 9 Replies View Related

Filling A DataTable From SqlQuery : If SqlQuery Returns Null Values Problem Ocurrs With DataTable

Sep 3, 2007

Filling a DataTable from SqlQuery : If SqlQuery returns some null values problem ocurrs with DataTable.
Is it possible using DataTable with some null values in it?
Thanks

View 2 Replies View Related

Can A DataTable Update An SQL Table?

Jul 24, 2007

Can you use a DataTable to update an SQL Table and can it be done in a batch UPDATE as opposed to incrementing through every row using a stored procedure similar to UPDATE SQLTable SET Position = @Position WHERE ID = @ID?

View 3 Replies View Related

Update/Insert DataTable Into SQL Table

Jan 31, 2008

I'm importing XML file into DataTable and need to Insert Data into SQL Table.
I'm not sure if its posible to take a DataTable with Data and insert into DataAdapter.  From there i wanted to update SQL using TableAdapter?
Any Tips?
Thanks,

View 4 Replies View Related

Putting Data From DataTable/DataSet Into SQL Server Table?

May 5, 2005

Hello,
I created this DataTable, add rows of data to it, and then display the data on to a form via a repeater.
Dim ds As DataSet = New DataSetDim dtTableName As DataTable = New DataTable("dtTableName") dtTableName.Columns.Add("Description")dtTableName.Columns.Add("ItemNumber")dtTableName.Columns.Add("Quantity")dtTableName.Columns.Add("Price")ds.Tables.Add(dtTableName)
What I need to do now is create a table in SQL Server and update the database with the data I've collect in my dataset. How do I bind and update this data to a sql server table?
Thanks!James

View 1 Replies View Related

SQL 2012 :: Bulk Insert (or Another Way) To Table From Datatable From Inside Store Procedure

Nov 4, 2014

I passed .net datatable from a .net app to a store procedure. From this store procedure, how to code to bulk insert (or another way) to SQL table?

View 7 Replies View Related

Importing Data In Datatable Using SSIS Package Trigger On Insert Is Not Firing On That Table

Oct 6, 2007

Hi
I am Importing data in datatable using SSIS package . I made trigger on that table on insert. The trigger on insert is not firing on that table
Please help
Thanks
CP

View 1 Replies View Related

Create Table From Text File, Extract Data, Create New Table From Extracted Data....

May 3, 2004

Hello all,

Please help....

I have a text file which needs to be created into a table (let's call it DataFile table). For now I'm just doing the manual DTS to import the txt into SQL server to create the table, which works. But here's my problem....

I need to extract data from DataFile table, here's my query:

select * from dbo.DataFile
where DF_SC_Case_Nbr not like '0000%';

Then I need to create a new table for the extracted data, let's call it ExtractedDataFile. But I don't know how to create a new table and insert the data I selected above into the new one.

Also, can the extraction and the creation of new table be done in just one stored procedure? or is there any other way of doing all this (including the importation of the text file)?

Any help would be highly appreciated.

Thanks in advance.

View 3 Replies View Related

Can You Create An Excel File Using T-SQL?

Aug 20, 2002

I have a stored procedure. This proc returns some data that needs to be put in an excel format. Is it possible to create a excel file to have the result of a select statement from the database?

Thanks

View 1 Replies View Related

Create A Import From Excel

Feb 17, 2007

Hello All

First time setting up A SSIS

Trying to import a excel that creates a new table called lockbox.

Does not import any records from Columns-Contract Id, Owner ID,
that have a null value.

Then in the Site Id -that is a number value- change to a text value
and update it to it text value.

for example: Site Id Column
2 = Ell
3 = CSI
12 = Ell2

Can someone get me started in the right direction?

Thanks for your time and help

JK

View 1 Replies View Related

Problems On Create Proc Includes Granting Create Table Or View Perissinin SP

Aug 4, 2004

Hi All,

I'm trying to create a proc for granting permission for developer, but I tried many times, still couldn't get successful, someone can help me? The original statement is:

Create PROC dbo.GrantPermission
@user1 varchar(50)

as

Grant create table to @user1
go

Grant create view to @user1
go

Grant create Procedure to @user1
Go



Thanks Guys.

View 14 Replies View Related

Boolean: {[If [table With This Name] Already Exists In [this Sql Database] Then [ Don't Create Another One] Else [create It And Populate It With These Values]}

May 20, 2008

the subject pretty much says it all, I want to be able to do the following in in VB.net code):
 
{[If [table with this name] already exists [in this sql database] then [ don't create another one] else [create it and populate it with these values]}
 
How would I do this?

View 3 Replies View Related

Problem In Using Sqlbulkcopy To Insert Data From Datatable(no Identity Column) Into Sql Server Table Having Identity Column

Jun 19, 2008

Hi,
I am having problem in bulk update of a sql server table haning identity column from a datatable( has no identity column) using sqlbulkcopy. I tried several approaches, but it does not show any error nor is the table getting updated. But the identity value seems to getting increased every time.
thanks.
varun

View 6 Replies View Related

Dynamic Create Table, Create Index Based Upon A Given Database

Jul 20, 2005

Can I dynamically (from a stored procedure) generatea create table script of all tables in a given database (with defaults etc)a create view script of all viewsa create function script of all functionsa create index script of all indexes.(The result will be 4 scripts)Arno de Jong,The Netherlands.

View 1 Replies View Related

Create Excel File Is Ssis

Feb 6, 2008

Hi,

I have a package that writes information to a table in sql server 2005. I created an Excel file called ErrorLog.xls with column headers:
AccountNumber and Date.
I have a Data Flow Task that inserts from SQL into the Excel File.
This works fine the first time.
However, I then want to rename the Excel File, delete and recreate it with just the column headers AccountNumber and Date.
I need the Excel file to be empty every time the package runs.
I am able to create an Excel File using Script Component but how can I also add the headers?
Thanks

Whisky-my beloved dog who died suddenly on the 29/06/06-I miss u so much.

View 2 Replies View Related

HOW TO: Create Dynamic Excel Destinations

Jun 22, 2006

I have a ForEach Loop Container that is running from a Foreach ADO Enumerator with records telling me which companies have records to export. As I loop through I use a data flow task to export the records to Excel, I want to create separate Excel files using some of the parameters from my recordset as parts of the name.

I have DelayValidation=True for my DFT and my Excel Connection Manager, ValidateExternalMetaData=False for my Excel Destination Adapter, and an expression setting the ExcelFilePath and ServerName properties to the dynamic path & file name from variables.

The layout will be the same (i.e. metadata) for each file. The files are just getting broken up by company and service type and I want to use that in naming the files.

I am currently getting the following errors:

[EX_DST New Enrollments File [238]] Error: An OLE DB error has occurred. Error code: 0x80040E37.

[EX_DST New Enrollments File [238]] Error: Opening a rowset for "NewEnrollments$" failed. Check that the object exists in the database.

[DTS.Pipeline] Error: component "EX_DST New Enrollments File" (238) failed the pre-execute phase and returned error code 0xC02020E8.

What do I have to do to create the new Excel File? I thought it would do it when the properties were set. Do I have to create the "table" for the worksheet named "NewEnrollments"? If so, how do I accomplish it.

Thanks in advance.

sk

View 1 Replies View Related

Can CREATE DATABASE Or CREATE TABLE Be Wrapped In Transactions?

Jul 20, 2005

I have some code that dynamically creates a database (name is @FullName) andthen creates a table within that database. Is it possible to wrap thesethings into a transaction such that if any one of the following fails, thedatabase "creation" is rolledback. Otherwise, I would try deleting on errordetection, but it could get messy.IF @Error = 0BEGINSET @ExecString = 'CREATE DATABASE ' + @FullNameEXEC sp_executesql @ExecStringSET @Error = @@ErrorENDIF @Error = 0BEGINSET @ExecString = 'CREATE TABLE ' + @FullName + '.[dbo].[Image] ( [ID][int] IDENTITY (1, 1) NOT NULL, [Blob] [image] NULL , [DateAdded] [datetime]NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]'EXEC sp_executesql @ExecStringSET @Error = @@ErrorENDIF @Error = 0BEGINSET @ExecString = 'ALTER TABLE ' + @FullName + '.[dbo].[Image] WITHNOCHECK ADD CONSTRAINT [PK_Image] PRIMARY KEY CLUSTERED ( [ID] ) ON[PRIMARY]'EXEC sp_executesql @ExecStringSET @Error = @@ErrorEND

View 2 Replies View Related

OPENROWSET ( CAN WE CREATE FILE WITHOUT EXCEL TEMPLATE??)

Mar 20, 2008

insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=D: esting.xls;', 'SELECT * FROM [SheetName$]') select * from pubs.dbo.authors
 
I am using similiar query to above to create a excel file, however for this to work, I need to create a template file which has the same columns as the authors table. Is there a way to NOT to define template columns , as I some times will not know which columns will be available... as teh query is dynamic....

View 4 Replies View Related

DTS To Create New Excel Sheet In Existing Workbook

Jan 12, 2004

Has anyone been able to create a DTS that will create a new sheet within an existing Excel file. I want one Excel file with multiple tabs referencing the beginning of each week and growing. The name needs to be dynamic so as to not overwrite previous sheets (tabs) in the file.

I have a current ActiveX script that will move the data to a dynamic name (date), I just can't create the table (sheet/tab) to move the data to.

Any help would be appreciated.

-Mark

View 6 Replies View Related

How To Create An Excel Connection Manager Programmatically ?

Sep 18, 2007

I am following the samples in the online books. I've got an OLEDB connection manager and source component defined. I now want to create an Excel connection manager and destination component (see below). How can I do this?


Dim conMgr As ConnectionManager = package.Connections.Add("OLEDB")

conMgr.ConnectionString = "Provider=SQLOLEDB.1;" "Data Source=FLL-EIS;Initial Catalog=DataLoad;" & _

"Integrated Security=SSPI;"

conMgr.Name = "SSIS Connection Manager for OLE DB"

conMgr.Description = "OLE DB connection to FLL-EIS."

' Create and configure an OLE DB source component.

Dim source As IDTSComponentMetaData90 = dataFlowTask.ComponentMetaDataCollection.New

source.ComponentClassID = "DTSAdapter.OleDbSource"

' Create the design-time instance of the source.

Dim srcDesignTime As CManagedComponentWrapper = source.Instantiate

srcDesignTime.ProvideComponentProperties()

' Assign the connection manager.

source.RuntimeConnectionCollection(0).ConnectionManager = _

DtsConvert.ToConnectionManager90(conMgr)

' Set the custom properties of the source.

srcDesignTime.SetComponentProperty("AccessMode", 2)

srcDesignTime.SetComponentProperty("SqlCommand", Dts.Variables("User::gsQuery").Value.ToString)

' Connect to the data source,

' and then update the metadata for the source.

srcDesignTime.AcquireConnections(Nothing)

srcDesignTime.ReinitializeMetaData()

srcDesignTime.ReleaseConnections()



' Create and configure an OLE DB destination. (This is where I need help, as this code does not work)

Dim destination As IDTSComponentMetaData90 = dataFlowTask.ComponentMetaDataCollection.New

destination.ComponentClassID = "DTSAdapter.ExcelDestination"

' Create the design-time instance of the destination.

Dim destDesignTime As CManagedComponentWrapper = destination.Instantiate

' Where can I find documentation about the various ComponentClassIds and Properties???

destDesignTime.ProvideComponentProperties()
destDesignTime.SetComponentProperty("ExcelFilePath", Dts.Variables("User::gsExcelFile").Value.ToString)

destDesignTime.SetComponentProperty("TableName", Dts.Variables("User::gsSheetName").Value.ToString)

View 6 Replies View Related

Create, Insert And Format Into 1,000 Excel Files

Feb 24, 2008

Hello,

I need to create about 1,000 (literately) Excel files that each contain 5 tabs. The data being placed on the tabs will always be the same (meaning the columns are static).
I am fairly advanced at Excel VBA so I can write code that does all the following in Excel (looped 1,000 times):


Open an Excel template

Bring data in from the tables

Filter, then copy-paste the appropriate rows into each tab.

Save the new Excel file.

Email the file to appropriate individual (it is a Microsoft Exchange Server).
As I started this in VBA, I thought that I might be able to do it with SSIS. My concern is I need to have the rows formatted (font, border, etc.) and the number of rows change.

My questions are:
Is it possible to format Excel with SSIS?
Can I email the files even if it is not with an SMTP protocol?
Would SSIS process this data faster then Excel?
Does this approach even make sense? Am I better just doing it with VBA?


Thank you for the help.

-Gumbatman

View 4 Replies View Related

Create A Package For Export The Query Results To Excel

Dec 1, 2005

Hi,

In SQL Server,

does anybody provide the steps for create a Package for exporting the query results to Excel environment?

I just know that click the "Export", then choose the query file to export to Excel.

I want to know how to create the Package to export it.

Please let me know, thanks.

View 3 Replies View Related

SSIS Read Excel Rows And Create New Output

Feb 1, 2013

I have an excel file with following data:

Agent State Exposure Insured Name
Rogers Inc MA 100,000 John Smith
SAN Group RI 200,000 Jim Morrison
SAN Group RI 100,000 Jimi Hendrix
123 Agency MA 300,000 Mickey Mouse
Rogers Inc MA 50,000 Mike Greenwell

I want to be able to read the file and create new excel files for each Agent listed. So for Example, the above file would create 3 separate files since there are 3 different Agents listed. Each Agent file would contain the same information from the original file. The name of the file would be somethign like AgentName.xls...So the SAN group file would have this:

Agent State Exposure Insured Name
Rogers Inc MA 100,000 John Smith
SAN Group RI 200,000 Jim Morrison
SAN Group RI 100,000 Jimi Hendrix

Is there a way to accomplish this in SSIS?

View 2 Replies View Related

Can't Create Excel File With SQL Server 2000 Client.

Jan 3, 2007

Hi ;

I am trying to create several Excel sheets using SQL 2000 views like so:

Select * INTO [Excel 8.0;Database="C:spreadSheetsaNew.xls"] FROM [aView].

When I try and execute this in my app I get the following - Specified owner
name 'Excel 8.0;Database=c:spreadSheetsaNew.xls' either does not exist or
you do not have permission to use it.

If I use the above Select statement with an OLEDB connection it works.

I am using Imports System.Data.SqlClient, instantiating a new SQlConnection
object, opening the connection, etc..

Thanks,

Gordon

View 1 Replies View Related

Integration Services :: Script Task - Create Excel Using C#?

Jun 6, 2015

I need to create excel workbook "SalesData.xlsx', which should have worksheet "POS". After creating excel file in specific location, script should be able to format cells as well.For instance, first two column type should be numbers. Here are the columns:

ColumnName : Type
Id : Number
AccountNumber : Number
Name: Text
Address: Text

Also, it checks for existing file . If it exist, then overwrite the file.

View 5 Replies View Related

Data Flow From SQL Server To Excel - 'Cannot Create An OLE DB Accessor'

Mar 7, 2008

Hello all,

I am creating an SSIS package that takes data from a SQL Server 2005 table, adds some columns, programatically changes some values based on business requirements, and then writes the output to an Excel template which I've already prepared. Everything seems to work fine, but the package always errors out when immediately after it hits the Excel Destintation component, with the following errors:

Error: 0xC0202009 at Process Quarterly Data, Export to Excel [12621]: An OLE DB error has occurred. Error code: 0x80040E21.
Error: 0xC0202025 at Process Quarterly Data, Export to Excel [12621]: Cannot create an OLE DB accessor. Verify that the column metadata is valid.
Error: 0xC004701A at Process Quarterly Data, DTS.Pipeline: component "Export to Excel" (12621) failed the pre-execute phase and returned error code 0xC0202025.

I have verified that the Excel destination file is writing the correct headers to the specified file. I thought that the issue might be that one of the dynamically created columns isn't matching the Excel file, so I manually checked each and every one of them (there are 248 columns, although a lot of them aren't really used - however, we are required to use the template provided , so must include fields in the specified order whether or not they have any data) and made sure that I selected the exact same datatype for each column. However, I still get the error and no rows are written to the Excel file.

Here is the code generated by the Excel Destination Manager:





Generated Code - Excel Destination (SSIS)


CREATE TABLE `xxx_LoadData` (
`PART NUMBER` NVARCHAR(255),
`PART NAME` NVARCHAR(255),
`PRICE TBD` INTEGER,
`PRICE` MONEY,
`UOI` NVARCHAR(4),
`Items per UOI` INTEGER,
`NSN` NVARCHAR(255),
`OEM NAME` NVARCHAR(255),
`OEM PN` NVARCHAR(200),
`UPC` NVARCHAR(255),
`DESCRIPTION` NVARCHAR(255),
`EXPANDED DESCRIPTION` ntext,
`CLASSIFICATION CODE` NVARCHAR(255),
`DAYS ARO` INTEGER,
`IMAGE DESCRIPTION` NVARCHAR(255),
`IMAGE URL IF SELF HOSTED OR IMAGE NAME MANTECH HOSTED` NVARCHAR(255),
`SHIPPING WEIGHT` REAL,
`SHIPPING WEIGHT UNIT OF MEASURE` NVARCHAR(4),
`SHIPPING LENGTH` REAL,
`SHIPPING WIDTH` REAL,
`SHIPPING HEIGHT` REAL,
`SHIPPING UNIT OF MEASURE` NVARCHAR(4),
`PRODUCT WEIGHT` REAL,
`PRODUCT WEIGHT UNIT OF MEASURE` NVARCHAR(4),
`PRODUCT LENGTH` REAL,
`PRODUCT WIDTH` REAL,
`PRODUCT HEIGHT` REAL,
`PRODUCT UNIT OF MEASURE` NVARCHAR(4),
`FEDERAL SUPPLY CODE` NVARCHAR(255),
`ENAC CODE` NVARCHAR(255),
`PACKAGE UNIT OF ISSUE` NVARCHAR(4),
`PACKAGE UNITIP OF ISSUE` NVARCHAR(4),
`PACKAGE PRICE` MONEY,
`CERTIFIED NSN` NVARCHAR(255),
`COG CODE` NVARCHAR(255),
`HAZMAT` NVARCHAR(255),
`UNSPSC` NVARCHAR(255),
`SALE_START_DATE` DATETIME,
`SALE_END_DATE` DATETIME,
`PB1 Quantity` INTEGER,
`PB1 Zone 1 Price` MONEY,
`PB1 Zone 1 Sale Price` money,
`PB1 Zone 2 Price` money,
`PB1 Zone 2 Sale Price` money,
`PB1 Zone 3 Price` money,
`PB1 Zone 3 Sale Price` money,
`PB1 Zone 4 Price` money,
`PB1 Zone 4 Sale Price` money,
`PB1 Zone 5 Price` money,
`PB1 Zone 5 Sale Price` money,
`PB1 Zone 6 Price` money,
`PB1 Zone 6 Sale Price` money,
`PB1 Zone 7 Price` money,
`PB1 Zone 7 Sale Price` money,
`PB1 Zone 8 Price` money,
`PB1 Zone 8 Sale Price` money,
`PB1 Zone 9 Price` money,
`PB1 Zone 9 Sale Price` money,
`PB1 Zone 10 Price` money,
`PB1 Zone 10 Sale Price` money,

/* Repeated through PB10 Zone 10 - code not shown for brevity */


)
Does anyone have any suggestions as to what I'm doing wrong? I'm making an attempt to set up a process for the company, instead of throwing something together; while that would be much quicker (I've spent pretty much the whole day working on this), lack of processes are a big detriment to our current operations.

Any help would be greatly appreciated - I'm not that familiar with SSIS or its nuances just yet.

View 2 Replies View Related

Transact SQL :: Raw Excel File - Create Automated Insert Into DB

Sep 17, 2015

I have a raw excel file which I am trying to create an automated insert into a DB.

Data in excel file is two columns, Row_Data, Row_ID

I am trying to split rows and store them in columns in a table.

Row_ID column is simply row identifier column

E.g.:

Row_Data  Row ID
Frank          2
Seattle            3
WA           4
34     5
1010.00   6

How can i insert this data into a table where i`ll have columns of Name, City, State, Age and Amount?

View 18 Replies View Related

Default Table Owner Using CREATE TABLE, INSERT, SELECT && DROP TABLE

Nov 21, 2006

For reasons that are not relevant (though I explain them below *), Iwant, for all my users whatever privelige level, an SP which createsand inserts into a temporary table and then another SP which reads anddrops the same temporary table.My users are not able to create dbo tables (eg dbo.tblTest), but arepermitted to create tables under their own user (eg MyUser.tblTest). Ihave found that I can achieve my aim by using code like this . . .SET @SQL = 'CREATE TABLE ' + @MyUserName + '.' + 'tblTest(tstIDDATETIME)'EXEC (@SQL)SET @SQL = 'INSERT INTO ' + @MyUserName + '.' + 'tblTest(tstID) VALUES(GETDATE())'EXEC (@SQL)This becomes exceptionally cumbersome for the complex INSERT & SELECTcode. I'm looking for a simpler way.Simplified down, I am looking for something like this . . .CREATE PROCEDURE dbo.TestInsert ASCREATE TABLE tblTest(tstID DATETIME)INSERT INTO tblTest(tstID) VALUES(GETDATE())GOCREATE PROCEDURE dbo.TestSelect ASSELECT * FROM tblTestDROP TABLE tblTestIn the above example, if the SPs are owned by dbo (as above), CREATETABLE & DROP TABLE use MyUser.tblTest while INSERT & SELECT usedbo.tblTest.If the SPs are owned by the user (eg MyUser.TestInsert), it workscorrectly (MyUser.tblTest is used throughout) but I would have to havea pair of SPs for each user.* I have MS Access ADP front end linked to a SQL Server database. Forreports with complex datasets, it times out. Therefore it suit mypurposes to create a temporary table first and then to open the reportbased on that temporary table.

View 6 Replies View Related

What Is The Difference Between: A Table Create Using Table Variable And Using # Temporary Table In Stored Procedure

Aug 29, 2007

which is more efficient...which takes less memory...how is the memory allocation done for both the types.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved