Showing posts with label creating. Show all posts
Showing posts with label creating. Show all posts

Wednesday, March 21, 2012

I cant create a temp table

Hi all!
I have a problem with a temp table.
I start creating my table:

bdsqlado.execute ("CREATE TABLE #MyTable ...")

There is no error. The sql string has been tested and when it's
executed in the sql query analyzer it really creates the table.

After creating the table, I execute an insert statement:

bdsqlado.execute ("INSERT INTO #MyTable VALUES(...) "

It returns an error like this: "Invalid Object Name #MyTable"

I don't understand what's wrong. If I execute both sql sentences in
the SQL Query Analyzer it works perfectly.
I use the same connection to execute both statements and I don't close
it before the INSERT is executed.
I think it may be something related to dynamic properties of the
connection, but I'm not sure. It's just an idea.

Please I need help.

Thanks a lot,
Sergio wrote:

> Hi all!
> I have a problem with a temp table.
> I start creating my table:
> bdsqlado.execute ("CREATE TABLE #MyTable ...")
> There is no error. The sql string has been tested and when it's
> executed in the sql query analyzer it really creates the table.
> After creating the table, I execute an insert statement:
> bdsqlado.execute ("INSERT INTO #MyTable VALUES(...) "
> It returns an error like this: "Invalid Object Name #MyTable"

Hi. Let me play Kreskin... I'm guesing you're using JDBC, and MS's
free driver. If this is true, add the property selectMode=cursor to
your connection properties. What is happening is that the driver
*is spawning multiple actual DBMS connections* to support a
single logical connection having multiple concurrent open statements.
This means the spid of one statement will be different than another, and
therefore one statement will not be able to see another's temp table!

Joe Weinstein

>
> I don't understand what's wrong. If I execute both sql sentences in
> the SQL Query Analyzer it works perfectly.
> I use the same connection to execute both statements and I don't close
> it before the INSERT is executed.
> I think it may be something related to dynamic properties of the
> connection, but I'm not sure. It's just an idea.
> Please I need help.
> Thanks a lot,

Friday, March 9, 2012

I am getting an error in creating a simple store procedure!

Hi ,
Here is my stored proce and I am not sure why its complaining about
the below error
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[USP_InsertUserInfo]
@.aspnet_userid uniqueidentifier(50)
,@.DealershipID int
,@.LastName varchar(50)
,@.FirstName varchar(50)
,@.AddressLine1 varchar(50)
,@.AddressLine2 varchar(50)
,@.City varchar(50)
,@.State varchar(50)
,@.Zip varchar(50)
,@.Country varchar(50)
,@.HomePhoneNumber varchar(50)
,@.MobileNumber varchar(50)
,@.OfficePhoneNumbre varchar(50)
,@.OfficePhoneExtension varchar(5)
,@.EmailAddress varchar(50)
,@.PreferredCommunication varchar(50)
,@.InsertedBy uniqueidentifier
,@.InsertedDate datetime
,@.ModifiedBy uniqueidentifier
,@.ModifiedDate datetime
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO [GroundingDemo].[dbo].[Users]
(aspnet_userid
,DealershipID
,LastName
,FirstName
,AddressLine1
,AddressLine2
,City
,State
,Zip
,Country
,HomePhoneNumber
,MobileNumber
,OfficePhoneNumbre
,OfficePhoneExtension
,EmailAddress
,PreferredCommunication
,InsertedBy
,InsertedDate
,ModifiedBy
,ModifiedDate)
VALUES
(aspnet_userid
,DealershipID
,LastName
,FirstName
,AddressLine1
,AddressLine2
,City
,State
,Zip
,Country
,HomePhoneNumber
,MobileNumber
,OfficePhoneNumbre
,OfficePhoneExtension
,EmailAddress
,PreferredCommunication
,InsertedBy
,InsertedDate
,ModifiedBy
,ModifiedDate)
END
GO
*************************************her
e is the error
***********************************
Msg 128, Level 15, State 1, Procedure USP_InsertUserInfo, Line 63
The name "aspnet_userid" is not permitted in this context. Valid
expressions are constants, constant expressions, and (in some contexts)
variables. Column names are not permitted.
****************************************
***********************
if I take off the aspnet_userid column from the stored proce and also
the table and re execute it then complains about DealerShipID with the
same kind of error.
Am I missing some thing here?
Thanks
-Lyou are missing a comma after @.aspnet_userid uniqueidentifier(50)
and also
VALUES
(aspnet_userid
,DealershipID
has to be
VALUES
(@.aspnet_userid, --comma here also
,@.DealershipID etc etc etc
Denis the SQL Menace
http://sqlservercode.blogspot.com/|||Hi,
You are using the procedure's parameters in the values list, but forgot to
prefix them with the "@.". Like this:
VALUES
(@.aspnet_userid
,@.DealershipID
etc.
hth,
Dean
"Learner" <pradev@.gmail.com> wrote in message
news:1145648788.592029.198590@.g10g2000cwb.googlegroups.com...
> Hi ,
> Here is my stored proce and I am not sure why its complaining about
> the below error
>
> SET ANSI_NULLS ON
> GO
> SET QUOTED_IDENTIFIER ON
> GO
> CREATE PROCEDURE [dbo].[USP_InsertUserInfo]
> @.aspnet_userid uniqueidentifier(50)
> ,@.DealershipID int
> ,@.LastName varchar(50)
> ,@.FirstName varchar(50)
> ,@.AddressLine1 varchar(50)
> ,@.AddressLine2 varchar(50)
> ,@.City varchar(50)
> ,@.State varchar(50)
> ,@.Zip varchar(50)
> ,@.Country varchar(50)
> ,@.HomePhoneNumber varchar(50)
> ,@.MobileNumber varchar(50)
> ,@.OfficePhoneNumbre varchar(50)
> ,@.OfficePhoneExtension varchar(5)
> ,@.EmailAddress varchar(50)
> ,@.PreferredCommunication varchar(50)
> ,@.InsertedBy uniqueidentifier
> ,@.InsertedDate datetime
> ,@.ModifiedBy uniqueidentifier
> ,@.ModifiedDate datetime
> AS
> BEGIN
> SET NOCOUNT ON;
> INSERT INTO [GroundingDemo].[dbo].[Users]
> (aspnet_userid
> ,DealershipID
> ,LastName
> ,FirstName
> ,AddressLine1
> ,AddressLine2
> ,City
> ,State
> ,Zip
> ,Country
> ,HomePhoneNumber
> ,MobileNumber
> ,OfficePhoneNumbre
> ,OfficePhoneExtension
> ,EmailAddress
> ,PreferredCommunication
> ,InsertedBy
> ,InsertedDate
> ,ModifiedBy
> ,ModifiedDate)
> VALUES
> (aspnet_userid
> ,DealershipID
> ,LastName
> ,FirstName
> ,AddressLine1
> ,AddressLine2
> ,City
> ,State
> ,Zip
> ,Country
> ,HomePhoneNumber
> ,MobileNumber
> ,OfficePhoneNumbre
> ,OfficePhoneExtension
> ,EmailAddress
> ,PreferredCommunication
> ,InsertedBy
> ,InsertedDate
> ,ModifiedBy
> ,ModifiedDate)
> END
> GO
> *************************************her
e is the error
> ***********************************
> Msg 128, Level 15, State 1, Procedure USP_InsertUserInfo, Line 63
> The name "aspnet_userid" is not permitted in this context. Valid
> expressions are constants, constant expressions, and (in some contexts)
> variables. Column names are not permitted.
> ****************************************
***********************
> if I take off the aspnet_userid column from the stored proce and also
> the table and re execute it then complains about DealerShipID with the
> same kind of error.
>
> Am I missing some thing here?
> Thanks
> -L
>|||"SQL" <denis.gobo@.gmail.com> wrote in message
news:1145649123.181217.315180@.u72g2000cwu.googlegroups.com...
> you are missing a comma after @.aspnet_userid uniqueidentifier(50)
Actually, he's not :) The comma *is* there, but not where one would normally
expect it to be.
Dean

> and also
> VALUES
> (aspnet_userid
> ,DealershipID
> has to be
> VALUES
> (@.aspnet_userid, --comma here also
> ,@.DealershipID etc etc etc
>
> Denis the SQL Menace
> http://sqlservercode.blogspot.com/
>|||I am not sure if I am understanding it right... I have another stored
proc that works and it doesn't have commas after it . I mean I am
trying to do the same thing with my new one ...
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[SP_InsertNewVehicleFeed]
@.VIN char(17),
@.AccountNum varchar(14),
@.CustomerName varchar(50),
@.CoByerName varchar(50),
@.Owner varchar(15),
@.SubOwner varchar(15),
@.IssuingFSO varchar(10),
@.OwningFSO varchar(10),
@.DealerShipID int,
@.ReturnDate smallDateTime,
@.Odometer varchar(6),
@.Year int,
@.MakeID int,
@.ModelID int,
@.SubModelID int
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO VehicleInformation
(VIN,
AccountNum,
CustomerName,
CoBuyerName,
Owner,
SubOwner,
IssuingFSO,
OwningFSO,
DealerShipID,
ReturnDate,
Odometer,
Year,
MakeID,
ModelID,
SubModelID)
VALUES
(@.VIN,
@.AccountNum,
@.CustomerName,
@.CoByerName,
@.Owner,
@.SubOwner,
@.IssuingFSO,
@.OwningFSO,
@.DealerShipID,
@.ReturnDate,
@.Odometer,
@.Year,
@.MakeID,
@.ModelID,
@.SubModelID)
END
IF (@.@.ERROR > 0)
Begin
Select 'Failure'
End
Else
Begin
Select 'Success'
End|||He Dean,
yes that was silly :) jezz I was so stupid abou it..
THANK YOU
-L|||yes thats right. I just put infront of the each parameter not after :)
I don't know when I started it but just doing it.

Friday, February 24, 2012

Hyperlink Target in Same Frame

I'm having trouble creating a hyperlink that opens the page in the same frame (_self). I have a report being displayed in a frame, and want a hyperlink to stay in the same frame. I've read all about opening a new window, etc., etc., but the techniques I've read about don't work for the "_self" target.

I've tried appending the "&rc:LinkTarget=_self" to the URL, but that doesn't work. I've also tried the javascrippt options but they don't work either. They work fine for opening a new window, but not for staying in the same frame.

When I look at the source code generated for a hyperlink in a report page, it specifically spells-out "target=_top" in the resultant code, even though I'm not specifying that anywhere. If I could only suppress that, then it might work and stay in the same frame.

Can anyone help here? Thanks.

Did you happen to solve this issue? I was just trying to do the same thing and I'm not getting anywhere.

Thanks,

Derek

|||

Derek,
I had to add the target parameter in the report control on the web page:
<rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" PromptAreaCollapsed="True" Width="100%" Height="98%" HyperlinkTarget="_self">
Now, I'm not sure if it's still needed, but I also have this in the hyperlink in the report XML:
<Action>
<Hyperlink>="http://www.somewhere.com/Page.aspx?ID=" &amp; trim(Fields!ID.Value) &amp; "&amp;rc:LinkTarget=_self"</Hyperlink>
</Action>
This worked and now the hyperlinks in the reports stay in the same frame. Hope this helps!
Dan

Hyperlink Target in Same Frame

I'm having trouble creating a hyperlink that opens the page in the same frame (_self). I have a report being displayed in a frame, and want a hyperlink to stay in the same frame. I've read all about opening a new window, etc., etc., but the techniques I've read about don't work for the "_self" target.

I've tried appending the "&rc:LinkTarget=_self" to the URL, but that doesn't work. I've also tried the javascrippt options but they don't work either. They work fine for opening a new window, but not for staying in the same frame.

When I look at the source code generated for a hyperlink in a report page, it specifically spells-out "target=_top" in the resultant code, even though I'm not specifying that anywhere. If I could only suppress that, then it might work and stay in the same frame.

Can anyone help here? Thanks.

Did you happen to solve this issue? I was just trying to do the same thing and I'm not getting anywhere.

Thanks,

Derek

|||

Derek,
I had to add the target parameter in the report control on the web page:
<rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" PromptAreaCollapsed="True" Width="100%" Height="98%" HyperlinkTarget="_self">
Now, I'm not sure if it's still needed, but I also have this in the hyperlink in the report XML:
<Action>
<Hyperlink>="http://www.somewhere.com/Page.aspx?ID=" &amp; trim(Fields!ID.Value) &amp; "&amp;rc:LinkTarget=_self"</Hyperlink>
</Action>
This worked and now the hyperlinks in the reports stay in the same frame. Hope this helps!
Dan

Hyperlink in Excel

Hi.

When creating a report builder and exporting to excel, the excel file keeps the hyperlinks. How can this be switched off ?

Many Thanks.

Sorry, hyperlinks are always included on all output formats. There isn't any way to turn them off for a particular renderer.

If you explain your scenario, we may consider it for a future release.|||We are having the same issue of clearing out the hyperlinks from excel sheet rendered using sql reporting services.

The scenario is once the report is generated in report viewer, we require the hyperlinks to navigate to other linked reports. But when we export the report by clicking on the export link available on report viewer, we want to remove the links in the excel worksheet.

When the export link is clicked on report viewer i do not have any exclusive control where in i could identify the click event of the export type as Excel selected from the drop down.

Thanks

Sups
|||I understand what is being asked, and would like to see it as a feature. I have many reports that link to other reports for drill-down. When view in the report viewer everything is great, however when exported the link is something like "http://reportserver/ReportName?parameters" which is not a valid URL. It would be nice if this was removed from excel so as not to confuse the end consumers of the report.

Hyperlink in Excel

Hi.

When creating a report builder and exporting to excel, the excel file keeps the hyperlinks. How can this be switched off ?

Many Thanks.

Sorry, hyperlinks are always included on all output formats. There isn't any way to turn them off for a particular renderer.

If you explain your scenario, we may consider it for a future release.