Can We Create A Kind Of Temporary SP

Jan 4, 2007

If we don t have the right to create an SP, can we create a dynamic in memory kind of SP
what s the syntax pls?
Thanks a lot

View 8 Replies


ADVERTISEMENT

CREATE ASSEMBLY ERROR -- An Implicit Reference Of Some Kind ???

Jun 28, 2006

When I run this ...

CREATE ASSEMBLY asmRANDRTCalendaringGateway FROM 'E:sqlRANDRTCalendaringGateway.dll' WITH PERMISSION_SET = UNSAFE

I get this error ...

Msg 10301, Level 16, State 1, Line 1
Assembly 'RANDRTCalendaringGateway' references assembly 'system.web, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request.

Even though I do not explicity refer to system.web in the DLL's code ...

using Microsoft.Win32;
using System;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Configuration;
using System.Text;
using log4net;
using ADODB;
using MAPI;
using CDO;
using System.Runtime.InteropServices;

Is the problem just staring me in the face ?

cheers

View 14 Replies View Related

VB5 Create Temporary Stored Procedure

Sep 3, 1998

When I use comands insert and update with VB5 and ODBC, one temporary stored procedure is created in database tempdb to each command executed.
These stored procedures are deleted only when the connection is closed.
My program use comands insert and update inside a loop, and a lot of temporary stored procedure are generated and full the database tempdb. When it occur, others systems are afecteds.

My questions:
Why it occur ?
Wich have created this stored procedure ?
How to avoid it occur ?

The versions are:
SQL Server 6.5
Visual Basic 5.0
SQL Server ODBC Driver 2.65.0240

View 4 Replies View Related

Has Any One Know How To Create Temporary Tables Inside Dynamic SQL?.

Jul 28, 2000

it seems like i am able to create it. But when i try to access that
temporary table, i get an error "Invalid object".
this is happening only when i try to create local temporary table.
Global temporary table works fine inside the dynamic SQL.

Any Help appreciated.

View 1 Replies View Related

Create/Access Temporary Tables In SSIS?

Oct 16, 2007

Hi,
I'd like to create a temporary table (# or ## table) and have it available in DataFlow to work with it. I see I can create it using "Execute SQL Task" component in ControlFlow; but it's not available in DataFlow. It seems it should be created by a DataFlow component to be seen in the same DataFlow.
Any Idea on this?

View 2 Replies View Related

Create Temporary Column That Shows Results

Dec 10, 2007

*Groan* Sorry. One more.


ERD above is what my database looks like (ignore it's in Access, database is in SQL 2005)

I have this code:

SELECT orderID, orderAmount = SUM(customerID)/customerID FROM orders
GROUP BY orderID
-- When Sum of the customer ID (and then) divided by the customer ID > 1
HAVING orderAmount > 1

which doesn't work because I never did find out how you make a column in the results to output your maths in.
orderAmount doesn't exist as a column in the database, but for this query it should show only those customers who have ordered more than once with the company.

Thanks again for any replies.

View 4 Replies View Related

Create Temporary Table Through Select Statement

Jul 20, 2005

Hi,I want to create a temporary table and store the logdetails froma.logdetail column.select a.logdetail , b.shmacnocase when b.shmacno is null thenselectcast(substring(a.logdetail,1,charindex('·',a.logde tail)-1) aschar(2)) as ShmCoy,cast(substring(a.logdetail,charindex('·',a.logdeta il)+1,charindex('·',a.logdetail,charindex('·',a.lo gdetail)+1)-(charindex('·',a.logdetail)+1))as char(10)) as ShmAcnointo ##tblabcendfrom shractivitylog aleft outer joinshrsharemaster bon a.logkey = b.shmrecidThis statement giving me syntax error. Please help me..Server: Msg 156, Level 15, State 1, Line 2Incorrect syntax near the keyword 'case'.Server: Msg 156, Level 15, State 1, Line 7Incorrect syntax near the keyword 'end'.sample data in a.logdetailBR··Light Blue Duck··Toon Town Central·Silly Street···02 Sep2003·1·SGL·SGL··01 Jan 1900·0·0·0·0·0.00······0234578······· ····· ··········UB··Aqua Duck··Toon Town Central·Punchline Place···02 Sep2003·1·SGL·SGL··01 Jan 1900·0·0·0·0·0.00·····Regards.

View 2 Replies View Related

Deny Permission To Create Temporary Tables

Apr 7, 2007

Dear All,



This is my first post to this forum.

I would like to know if there is any way to restrict users from creating temp tables.



Problem: I am facing problems with lots of temporary objects getting created in my database. The users have read-only access to the database for adhoc-querying purpose through QA. Yet they are able to create temporary tables in tempdb database taking lot of resources on tempdb disk causing abnormally high growth of tempdb.



Thanks in advance.



Best Regards,

Chetan Jain



View 6 Replies View Related

How To Create Dynamic Columns In A Temporary Table

Sep 5, 2007

Hi there,
i have a requirement that a temporary table contains dynamic columns depending on where condition.

my actual table is like





Key
Value


X1
x

X3
x

X5
x

Y1
y

Y2
y
when user select x, the input variable passed to stored proc and the result is shown like

column names
X1 X3 X5 as column headers.

the select query is from temporary table.

these out put is based on the user selection. so the temporary table created with columns dynamically.

please help me out.
please let me know if you didn't understand.

thanks
Praveen.

View 7 Replies View Related

Create Global Temporary Tables In SQL SERVER

Sep 6, 2006

I m trying to create a global temporary table whose data will be deleted after the end of the session..

the DDL in oracle is

CREATE GLOBAL TEMPORARY TABLE STUDENT
(

name CHAR(20),

) ON COMMIT DELETE ROWS ;

I want to know the corresponding DDL in SQL Server..

when i try the following

CREATE TABLE ##STUDENT
(

name CHAR(20),

)

the table gets deleted at the end of the session..help needed



View 4 Replies View Related

Error - Distribution Agent Failed To Create Temporary Files

Sep 17, 2014

I've been using replication for a long while now but have never come across this error. It's a basic transactional replication from ServerA to ServerB, where ServerA is also the distributor. Everything had been running fine on it until yesterday, when this error started popping up and no further transactions could be delivered.

After some quick googling I was able to determine that the distribution agent account needed write access to C:Program FilesMicrosoft SQL Server100Com. According to the MSFT article it's because the distribution agent is running under a non-default profile. I didn't change this. However, what I did change around the time that these errors started occurring was the server's Replication Max Test Size setting. It would be far too coincidental for this to not be the cause, but what I don't understand is *why* that would have changed it.

how do I change this? It is definitely not preferable to create temp files in this directory in our environment.

View 1 Replies View Related

DB Engine :: Does Logon Trigger Create Internal Temporary Objects

Jun 4, 2015

I create a logon trigger on a sql server 2008 r2 instance,the trigger is very simple,like this:

CREATE TRIGGER tg_login
ON ALL SERVER
FOR LOGON
AS
IF ORIGINAL_LOGIN() IN('sa') AND HOST_NAME()='TestHost1'

[Code] ...

I use master.dbo.LoginRecord  table to record the bad logon. When the trigger is working ,latches produced sometimes,wait type is PAGELATCH_UP  and wait resource is 2:1:3. At this time, a large number of logon failed ,error message is  "Logon failed for login 'login name' due to trigger execution."

I think  logon trigger create internal temporary objects maybe,it is right?

View 13 Replies View Related

SQL Server Admin 2014 :: Create Temporary Table With Dynamics Column

Jun 10, 2014

I have created a stored procedure for retrieving column name, as shown below

CM_id, CM_Name, [Transaction_Month], [Transaction_Year], [Invoice raised date],[Payment Received date],[Payout date],[Payroll lock date]

Now I am trying to create a temporary table using the above generated coluimns from Stored Procedure with datatype.

View 3 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

Possible To Have Temporary Rows In A Non-temporary Table? Lifespan On Rows..

Mar 14, 2004

I have a table that includes the html-output of different parts of my pages. This table grows very big very fast, and rows older than 24 hours are useless.

My question is if it is possible to have temporary rows, whose are automatically deleted after these 24 hours? And then how to accomplish that?

View 2 Replies View Related

What Kind Of Project?

Jul 18, 2007

I'm not looking for details or code, just general direction I should go. Here is my goal:
I have a SQL stored procedure that returns data which I will need to add spaces to, then end up with a space delimited text file.
This txt file will then be needed to be saved and emailed.
Also, I would like to be able to schedule this in the Task Scheduler for once a month execution.
Is this all just one big crazy idea?
 Thanks for any help.
Andrew  
 

View 16 Replies View Related

Which Kind Of Replication Should I Use?

Aug 8, 2001

i want to take 70-028 test.
but i still have some questions about administration.
can anybody help me?
Question:
(NY1-----T1-----NY2)-----56kbps-----(Seattle-----T1-----SanFrancisco-----T1-----Los Angeles)
NY1=NewYork1,NY2=NewYork2,SF=SanFrancisco,LA=Los Angeles
A. NY1=pub/dist; NY2,Seattle,SF,LA as subscriber
B.NY1=pubs; NY2=dist;Seattle,SF,LA as subscriber
C.NY1=pubs; SF=subs/dist/pubs; NY2,Seattle,LA as subscriber
D.NY1=pubs; LA=dist; something not workable
which one is correct answer, and why?
How to do the questions like this?

View 1 Replies View Related

I'm Don't Know What Kind Of Replication Should I Use

Sep 18, 2002

In the company that I work there are two offices, one is outside the city and the other is in the city. They are connected trough a DS0 using frame relay. The thing is that the comunication is very slow (the SQL server is in the city) and we want to add a new server at the office outside the city and we want at the end of the day replicate the data between the two servers so every server has the actual data. We didn't use primary keys, instead of that we used identities (autoincremental value administered by the server). What kind of replication should I use and why? (I'm new with SQL Server). There are 3 kinds: Snapshot, Transactional and Merge.

View 4 Replies View Related

What Kind Of Index

May 12, 2004

I have 20 tables (the same schema)

I use view to search it with union operator.
now i have indexes on all of the tables on 1 kolumn (nvarchar)

what kind of index i should use to make it fastest


index on view ?

View 3 Replies View Related

What Kind Of Loop And How?

May 22, 2008



Im looking to create a Stock Levels table which goes through each record of my Part table updating the corresponding Part in the Stock Level table.

I know how to perform all the Count calculations etc, if someone could just give me an example of a suitable loop that would be great

cheers.

View 11 Replies View Related

One Kind Of Transformation

Jun 11, 2007

original data type is string ,format like MM/dd/YYYY,also there exists null or "" value

I need to convert them into datetime,format like YYYY--MM-dd

any idea about this?

thanks in advance

View 10 Replies View Related

What Kind Of Package Is It?

Aug 18, 2006

Hi everyone,

Is there any way to know how is stored a package before do loadpackage, loadfromsql... bla,bla??

I mean, is there any property for Package class where you can see how it is stored?

Thanks in advance for your comments,

View 3 Replies View Related

What Kind Of DB Is Members ASPNETDB.MDF?

Aug 3, 2007

Hello,   I created web site using VWD 2005 Express, and I use 'Create New user account' control for signin up. I need to know what kind of database is ASPNETDB.MDF ' in order to set it on server? I created ASPNETDB.MDF (database?) when I first created user in  ASP.Net Web Site Administration Tool . What tipe is ASPNETDB.MDF database?  . I have my web site on server, and DB is not working, because it is not set on server.I have this databases available on my server:Microsoft Access                   Unlimited     Microsoft SQL Server 2000     1 x    MySQL                                 1 x    PostgreSQL                           1 xDSN/ODBC                           Unlimited SQL Database Users              Unlimited         Which one you recommend should I choose for members database (ASPNETDB.MDF)?Thank you,   Beezgetz       

View 11 Replies View Related

Problem With This Kind Of Sql Statement WHERE ... IN (...,...,...)

Oct 28, 2004

Hi,

I have a problem in a Stored Procedure SQL query im writing, basically what I want is something that works like this

WHERE intField IN (@strCommaSepList_Of_Integers)

First I tried this:

SELECT idComp_Clie_Bran_User, strComp_Clie_Bran_User_FirstName, strComp_Clie_Bran_User_Surname
FROM dbo.tblComp_Clie_Bran_Users
WHERE (fk_idCompany = @fk_idCompany) AND (fk_idComp_Client = @fk_idComp_Client) AND (fk_idComp_UserGroup IN (@strListUserGroupsAllowed))

But if I passed a 25,26 value to the last paramenet is gave an error saying:

Syntax error converting the varchar value '25,36' to a cllumn of data type int.

How can I get this to work??

If for example I manually put the WHERE IN values it works, ike this I mean:

SELECT idComp_Clie_Bran_User, strComp_Clie_Bran_User_FirstName, strComp_Clie_Bran_User_Surname
FROM dbo.tblComp_Clie_Bran_Users
WHERE (fk_idCompany = @fk_idCompany) AND (fk_idComp_Client = @fk_idComp_Client) AND (fk_idComp_UserGroup IN (25, 36))

But thats no use as I have to pass the list of values dynamically...

Please help!!

- Carl

View 2 Replies View Related

Kind Attn.Ray / Kris

Feb 22, 2001

Hi,
I am unable to understand how can I create a new filegroup?
I know how to move certain text/ntext/images column to a new file group - thru design table but my problem is how to create a new filegroup?
Do I have to use Alter Table/Alter Database for this or there is any other better way?
TIA
Jai.

View 2 Replies View Related

How To Implement This Kind Of Sorting?

Jul 15, 2004

Here's a basic overview of my Table

ID identity int
ParentID int
Name varchar

Now, the root level items will have a ParentID of NULL, and the child nodes will have it's parent's ID in it's ParentID column (a simple self-referencing relationship).

However, when I select it, I would like to Order by ID, but then have all it's children right after it. For example, if this is the unsorted view:

Code:


ID ParentID Name
----------------------
1 <NULL> Test
2 1 Test Child 1
3 <NULL> Test 2
4 1 Test Child 2
5 3 Test 2 Child 1


I would like the sorted to look like:

Code:


ID ParentID Name
----------------------
1 <NULL> Test
2 1 Test Child 1
4 1 Test Child 2
3 <NULL> Test 2
5 3 Test 2 Child 1


Is this possible with my current structure? If not, how could I change it?

View 4 Replies View Related

A Different Kind Of MSSQL Question...

Jul 21, 2004

Hey all!
This may sound like a weird one but i couldn't think of a better audience to ask!

If you are a SQL Server DBA (or were, or aspire to be, or play one on T.V., etc.) and the CIO of your 2.something billion $ a year company has offered you an 1 hour forum to sit down and ask him anything you want with the pretense of getting a straight answer, what would you ask?

I know this offers an excellent opportunity to cut up a bit...and do so if you must (keeping us entertained around here is important too!)...but i'm looking for work related, SQL related, direction, strategy, etc, etc type stuff.
Not: 'Whats it like to drive a $250k 'benz to work everyday?' OR 'Can i have .5% of your $2,000,000 bonus this year?'

While i genuinely have those questions in my mind...i'm not looking to waste his $5,000 an hour ass's time - and I only have 1 hour to chew his ear off.

What do ya'll think?

View 4 Replies View Related

What Kind Of Fucntions I Cannot Use In Trigger?

Nov 3, 2006

Hi,

What kind of functions i cannot use within a trigger?
Thanks for all your replys for my previous posts.

View 1 Replies View Related

Help On A 'Spread' Kind Of Ranking...

Nov 9, 2007

Hi all,

Just can't figure this out. I'll try not to give a long-winded explanation (I hope), let's say this is the table, for example:
[Table1]
RowNumber | Value
1 | 4
2 | 6
3 | 3
4 |10
5 | 6
6 | 5
7 | 8
8 | 8
9 | 2
10 | 6

I want to write a query that creates a column whose values are similar to (ROW_NUMBER -1), and resets each time a value is present.
Using the above example, 6 will be the test value. So, I want to know how many rows it takes till 6 is repeated.

Output would be:
RowNumber | Value | Spread
1 | 4 | 1
2 | 6 | 0
3 | 3 | 1
4 |10 | 2
5 | 6 | 0
6 | 5 | 1
7 | 8 | 2
8 | 8 | 3
9 | 2 | 4
10 | 6 | 0

I think PARTITION BY can be used somewhere, with the ORDER BY on the [RowNumber] - but I'm just not sure on which ranking function to use, and how to reset the Ranking on the number 6 (above example).

Any help would be appreciated. This has been a mind-teaser for me, and I give

Thanks,
Denvas

View 5 Replies View Related

Looking For Some Guidance From A Kind Person

Apr 4, 2008

I am gonig into interview for a junior developer position. The role involves a lot of SQL based work. Training is on the job, and they know I am new to this, but they want to know what I can do with SQL server by wednesday, and obviosuly I stand a better chance if I can do a reasonable amount by then.I am assuming I can practise with offline databases, so I would like to do that. Also I was wondering if there were any simple example databases I can load up.

I have downloaded and installed the software, and would like to know how to connect and create a test database.
There will be a small test in the interview and the questions are:
1. SQL Management and Data Extraction
For this task you will need to be familiar with database tables, data types and constraints. There will be some administration work using SQL Management Studio along with some T-SQL queries. You will need to show use of the SELECT, INSERT, UPDATE and DELETE statements. If you do not have SQL Server, you can download the express edition for free at the following URL. http://msdn2.microsoft.com/en-us/express/bb410791.aspx


2. XSLT
For this task I will be asking you to produce some HTML output displaying the data from an XML file. The concept is similar to ASP.


3. Database Design
You will be given a scenario for a company that requires some database software for the smooth running of their organisation. You will need to plan and design a data structure to accommodate these requirements. You will be allowed to spend as much time on this part of the test as you wish. Key information here is going to be database normalization.




These questions dont make a whole lot of sense to be at the moment, so would appreciate a breakdown in simpler terms.





This job will be a fantastic opportunity for me to get into development, and would appreaciate any help that you guys have to offer, thanks in advance.

View 21 Replies View Related

Which Kind Of File With Extension .pem ?please Help Me

Jan 4, 2006

In document for  encryption in SQLServer with application XP_Crypt, i see file with extension .pem when using private key or public key. How to create file .pem. Please explain me private key or public key.

View 1 Replies View Related

Different Kind Of Connection Issue

Feb 3, 2006

Was able to solve my connection issues with my local (test) machine. However, now I've got a much bigger issue on my intranet machine (W2K Server that acts as a domain controller).

When I use essentially the same set up for connecting as I did for the other machine (adjusted for machine name, etc), I get the following message:

Login failed for user '[username]'. The user is not associated with a trusted SQL Server connection.

I went into the SQL Server Express Config, and discovered under "SQL Server 2005 Services>SQL Server(SQLEXPRESS)>Properties" that this service is set up to login as the Local System built-in account. When I try to change this to Network Service, I get the following popup error message:

Cannot perform this operation on built-in accounts. [0x8007055b]

1) This happens regardless of wheter I stop the service and try to reset, apply and restart, or simply try to change it while it's running

2) I can find nothing on the error code above anywhere on the Web (Google came up EMPTY).

Anyone have any ideas about this one?

View 4 Replies View Related

Some Kind Of Calculation Is Needed For This Query?

Sep 19, 2005

Hi,

I have a query which gives me the following results:

lLedgerCode sGLCode bDebit TotalSum sGLDesc
61 6843000701 0 600ALPS Holding
33 8345000701 0 1116ALPS Premium Due
56 1000000701 0 1116Regular Premium Income
63 6836000701 1 516ALPS Group Holding
61 6843000701 1 600ALPS Holding
30 6842000701 1 600ALPS Policy Clearing
33 8345000701 1 1116ALPS Premium Due


The Column bDebit has either value '0' or value '1' in it ('0' being debit - positive amount, and '1' - credit, negative amount).

I would like it to show the net amount for each account. Therefore in plain English I would like to take all GLCodes that are the same (eg 6843000701) and sum all amounts that have debit value of '0' and subtract all amounts that have debit value '1'. Therefore I would only see '6843000701' code once, and the amount would be '0' becase 600 - 600 = 0.

The current query is:
SELECT dbo.tbGLTransactions.lLedgerCode, dbo.tbGLTransactions.sGLCode, dbo.tbGLTransactions.bDebit, SUM(curAmount)As TotalSum, dbo.tbLedgerCode.sGLDesc
FROM dbo.tbGLTransactions
INNER JOIN dbo.tbLedgerCode
on dbo.tbGLTransactions.lLedgerCode = dbo.tbLedgerCode.lLedgerCode
WHERE dbo.tbGLTransactions.lGLExtractRun = '452'
Group By dbo.tbGLTransactions.lLedgerCode, dbo.tbGLTransactions.sGLCode, dbo.tbGLTransactions.bDebit, dbo.tbLedgerCode.sGLDesc
Order By dbo.tbGLTransactions.bDebit, dbo.tbLedgerCode.sGLDesc



Is someone able to help me as to how i need to modify this query to get the desired result?

Thanks!

View 8 Replies View Related







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