Showing posts with label store. Show all posts
Showing posts with label store. Show all posts

Friday, March 9, 2012

I am looking for a string in stores procedure

hello. A question please. How can I do a search to find a string in all stores procedure ?

I need to know which are the store procedure that use a field of a table.

Thanks...

Have a look at this recent post on the same subject:

http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=1303077&SiteID=17

Chris

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 Datatype in SQL Server?!

Dear All,

I just want to know ,wheather there is any way to store 'hyperlink' in sql Table as in Ms Access.

or

What is the Procedure to store a Path of a file in SQL table and file should be able to retrieve through the query.

Thhank you

Graceson MathewI think that you will find that what you are asking for is a mix of back-end storage and front-end (client) formatting. Access really blurs the line between these two (very different) functions. SQL Server, on the other hand, is clearly a back-end storage system (ie, minimal client-side formatting features).

What you will end up having to do is to store text values for URLs and/or file locations and then use a client-side script/program/tool to format the data for presentation.

I personally like to pull the data using an ADO stream formatted in XML and then transform it with an XSL template. It's fast (as long as the recordsets aren't too big), it's flexible and gives you a great deal of control over how the data is represented.

This is not, however, the only solution.

Regards,

hmscott

Dear All,

I just want to know ,wheather there is any way to store 'hyperlink' in sql Table as in Ms Access.

or

What is the Procedure to store a Path of a file in SQL table and file should be able to retrieve through the query.

Thhank you

Graceson Mathew

Sunday, February 19, 2012

Hyperlink

Is it possible to store an email address as a hyperlink in SQL Server table?
Thanks
No, there is not a hyperlink data type in SQL. You will have to store the
value as a different data type and do the programming on the front end
application to use it as a hyperlink. I would suggest varchar, but I am
fairly new to SQL and there may be a better data type.
"Brennan" wrote:

> Is it possible to store an email address as a hyperlink in SQL Server table?
> Thanks
|||You can store the email address as character data in SQL Server. However,
hyperlink functionality (launch email client or browser) is a function of
the front-end application, not the relational database. For example, if you
are rendering data in html, you could enclose the email address in an anchor
tag:
<a href="http://links.10026.com/?link=mailto:me@.mydomain.com">me@.mydomain.com</a>
Hope this helps.
Dan Guzman
SQL Server MVP
"Brennan" <Brennan@.discussions.microsoft.com> wrote in message
news:879832D4-68A3-4500-9410-D424A19C7EBC@.microsoft.com...
> Is it possible to store an email address as a hyperlink in SQL Server
> table?
> Thanks

Hyperlink

Is it possible to store an email address as a hyperlink in SQL Server table
?
ThanksNo, there is not a hyperlink data type in SQL. You will have to store the
value as a different data type and do the programming on the front end
application to use it as a hyperlink. I would suggest varchar, but I am
fairly new to SQL and there may be a better data type.
"Brennan" wrote:

> Is it possible to store an email address as a hyperlink in SQL Server tab
le?
> Thanks|||You can store the email address as character data in SQL Server. However,
hyperlink functionality (launch email client or browser) is a function of
the front-end application, not the relational database. For example, if you
are rendering data in html, you could enclose the email address in an anchor
tag:
<a href="http://links.10026.com/?link=mailto:me@.mydomain.com">me@.mydomain.com</a>
Hope this helps.
Dan Guzman
SQL Server MVP
"Brennan" <Brennan@.discussions.microsoft.com> wrote in message
news:879832D4-68A3-4500-9410-D424A19C7EBC@.microsoft.com...
> Is it possible to store an email address as a hyperlink in SQL Server
> table?
> Thanks

Hyperlink

Is it possible to store an email address as a hyperlink in SQL Server table?
ThanksNo, there is not a hyperlink data type in SQL. You will have to store the
value as a different data type and do the programming on the front end
application to use it as a hyperlink. I would suggest varchar, but I am
fairly new to SQL and there may be a better data type.
"Brennan" wrote:
> Is it possible to store an email address as a hyperlink in SQL Server table?
> Thanks|||You can store the email address as character data in SQL Server. However,
hyperlink functionality (launch email client or browser) is a function of
the front-end application, not the relational database. For example, if you
are rendering data in html, you could enclose the email address in an anchor
tag:
<a href="http://links.10026.com/?link=mailto:me@.mydomain.com">me@.mydomain.com</a>
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Brennan" <Brennan@.discussions.microsoft.com> wrote in message
news:879832D4-68A3-4500-9410-D424A19C7EBC@.microsoft.com...
> Is it possible to store an email address as a hyperlink in SQL Server
> table?
> Thanks