How To Create The Security Connectstring String In Asp.net Page ?

Jan 16, 2006

hello,

     I installed  my sql 2000 database server  in my Lan server,and I installed the vs.net in my computer(workstation).now I want to develop my system in my computer with the remote sql 2000 database.

  So how to create a security connect string of  web.config  in my project  ?

thanks in advanced!

 

     

View 1 Replies


ADVERTISEMENT

SQL 2012 :: Persist Security Info And Integrated Security In Connection String

Dec 4, 2014

I use from sql server 2008. and c#

what is the best connectionstring?

I don't know if i use Persist Security Info and Integrated Security or not?

And if yes then their value must be true or false?

View 1 Replies View Related

Peoblem With Connectstring For Connecting Informatica To Sql Server

Mar 11, 2006

i have a problem connecting to sql server. I want to connect to sql server using informatica repository server.But i am unable to connect because i couldn't find the connectstring for sqlserver from informatica repositoryserver.

View 2 Replies View Related

Cannot Access The Security Page In ASP.Net Configuration

Mar 9, 2007

Hi,
 Im developing an application in Visual Web Developer with an MS SQL Server Database.
I have Visual Web Developer Express edition installed on my machine and i had MS SQL Server 2005 Express Edition and everything was fine.
However i need to use SQL Server Agent to develop a job and this is not included in the express Edition of Ms SQL Server 2005 Express Edition.
So i installed the 2005 developer edition of MS SQL Server.
Now Im currently getting the following error when i access the security page in the ASP.Net Configuration page
 
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
 
Anyone tell me how i can fix this error?
 
 

View 4 Replies View Related

Can Not Access Security Page On Web Administration Tool

Dec 1, 2006

I get the following error message when i click the Security tab on my websites' Administration tool. All the other tabs are working properly.
There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store. The following message may help in diagnosing the problem: An error occurred during the execution of the SQL file 'InstallCommon.sql'. The SQL error number is 1802 and the SqlException message is: CREATE DATABASE failed. Some file names listed could not be created. Check related errors. Cannot create file 'C:SAFETYDATABASEAPP_DATAASPNETDB_TMP.MDF' because it already exists. Change the file path or the file name, and retry the operation. Creating the ASPNETDB_652db56c1d7d4c9f94da67107d9c917a database...
Any help is appreciated.

View 1 Replies View Related

About SQL String (security Question)

Feb 12, 2007

I have a SQL Query String like below..
 
 string SQLUpd = "UPDATE Member SET Member_pwd = '" + pwd + "',Member_nickname = '" + NickName + "',Member_mail = '" + Mail + "',Member_birthday = '" + BDay + "', Member_gende_no = " + Gender + ",Member_mobile = '" + Mobile + "' ,Member_tel_day = '" + DTel + "',Member_tel_night = '" + NTel + "',Member_occupy_no = " + occupy + ",Member_national_no = " + National + ",Member_area_no = " + Area + ",Member_address = '" + Address + "' WHERE (Member_no = " + MemberNo + " )";
 in my program it does work perfectly ... but now I  just recalled my teacher have told.. it may cause security problem in that way...
maybe I need to change �UPDATE Member SET Member_pwd = '" + pwd +】 to �UPDATE Member SET Member_pwd = '" + @pwd +】
is there any difference between pwd and @pwd?
 
thank you very much

View 6 Replies View Related

T-sql String Checking For Security

Nov 8, 2007

Help desperately needed for SQL noobie..

I need to check long strings and only allow them through if they contain alpha-numeric characters and selected other characters (apostrophe, comma, colon, full stop), and reject all other strings.
So in pseudocode (very roughly) :

FOR EACH character in string
IF( character not alphanumeric AND character not valid character )
reject string
(end loop)
Accept string


What is the best way to do this in T-SQL?

Many thanks for any help,
Joe

View 3 Replies View Related

Page 2 - String To Smallmoney - Sql2000

Jul 21, 2003

the placeholder approach works nicely with an insert statement and I've tried it with an update statement but keep getting an error. This is the current code:

Var1 = strArray(1)
Var2 = strArray(2)
Var3 = (strArray(3)


Cmd.CommandText = "UPDATE WBS.dbo.pludec38 SET PLU = ?, SET Dscrpt1 = ?, SET Price = ?"

Cmd.Parameters.Refresh
Cmd.Parameters(0) = Var1
Cmd.Parameters(1) = Var2
Cmd.Parameters(2) = Var3

Cmd.Execute

The error occurs at or near the refresh stmt. What am I doing that is causing this? And what is the difference between this and the insert. The insert uses the parameters block without choking.
Thanks
RK

View 11 Replies View Related

Security Checking On Input String

Nov 8, 2007

Hi all,
I need to have a check procedure which rejects long strings if they contain anything other than 'allowed' characters (alphanumeric characters and selected other characters - space,comma, apostrophe).
So in (very rough) pseudocode:

FOR EACH character in string
IF( chararacter is not alphanumeric AND character is not valid )
reject string;
(end checking)
Accept string.

What is the best was to do this in T-SQL??

Many thanks for helping a noobie,
Joe

View 2 Replies View Related

Loop's To Create A Page!

Jul 9, 2007

Hi,Right, I have this problem, and it;s more through lack of understanding vb.net that well more then an actual problem I will out line what I want to do,basically it all revolves around a page that needs to be built when navigated to so it can be easily updated without anyone having to edit the code.Get all the table names from a databaseLoop through each of the results to build a statementNest a 2nd loop to split the returned data from the correct tableBuild a listbox for each table returnedThis is what I have currently, this works but the problem is, if another course is added, someone will need to manually edit the code on the page to add a new code to get the new course hence why I want to create a loop that gets all the data so all someone needs to do is put in the all table the new course name. Please noteI cut this down to just show 2 result but there is about 30 odd.  1 DBConn = New SqlConnection("Server=SD02;Initial Catalog=WhoGetsWhat;Persist Security Info=True;UID=x;Password=xx")
2 'Dim DBDataAdapter As SqlDataAdapter
3 DBDataAdapter = New SqlDataAdapter("Select AOE,ADC, FROM TBL_Role WHERE Title = @ddlTitle", DBConn)
4 DBDataAdapter.SelectCommand.Parameters.Add("@ddlTitle", SqlDbType.NVarChar)
5 DBDataAdapter.SelectCommand.Parameters("@ddlTitle").Value = TitleDropDown.SelectedValue
6 DBDataAdapter.Fill(DSPageData, "Courses")
7
8 'Loop through each record, split at + and place in ListBoxs
9
10 VarDS = DSPageData.Tables("Courses").Rows(0).Item("AOE")
11 Dim VarArray As String() = VarDS.Split("+")
12 Dim i As Integer
13 For i = 0 To VarArray.Length - 1
14
15 Dim li As New ListItem()
16 li.Text = VarArray(i).ToString()
17 li.Value = VarArray(i).ToString()
18 Me.txtAOE.Items.Add(li)
19 Next i
20
21 VarDS = DSPageData.Tables("Courses").Rows(0).Item("ADC")
22 VarArray = Nothing
23 VarArray = VarDS.Split("+")
24 i = Nothing
25 For i = 0 To VarArray.Length - 1
26
27 Dim li As New ListItem()
28 li.Text = VarArray(i).ToString()
29 li.Value = VarArray(i).ToString()
30 Me.txtADC.Items.Add(li)
31 Next i
  Now here is my pseudo code to what I roughly want to do, hope it makes sense to someone and someone can point me in the correct direction. Please note,I know the split bit works, so at the minute I am just trying to get the loop to get all my courses 1 DBConn = New SqlConnection("Server=SD02;Initial Catalog=WhoGetsWhat;Persist Security Info=True;UID=wgw;PWD=wgwsql;")
2 DBSelect.Connection = DBConn
3 DBSelect.Connection.Open()
4 'Get the row number in the database
5 DBSelect.CommandText = "SELECT COUNT(*) FROM TBL_All"
6 DBResult = DBSelect.ExecuteScalar()
7 DBSelect.Connection.Close()
8 Dim Count = DBResult
9 'Get all the Tables and Keys in the Database's
10 DBDataAdapter = New SqlDataAdapter("SELECT * FROM TBL_All", DBConn)
11 DBDataAdapter.Fill(DSPageData, "All")
12 'declare all loop vars
13 Dim X As Integer
14 Dim Y As Integer
15 Dim i As Integer
16 'Loops through all the tables
17 Dim DSArray As String() = DSPageData.Tables("All").Items()
18 For Y = 0 To Count
19 Dim VarDS As String() = DSPageData.Tables("All").Rows(0).Item(DSArray(Y))
20 Dim SplitArray As String() = VarDS.Split("+")
21
22
23 For i = 0 To SplitArray.Length - 1
24 Dim Li As New ListItem()
25 Li.Text = SplitArray(i).ToString()
26 Li.Value = SplitArray(i).ToString()
27 Me.txt & DSArray(Y) &.Items.Add(Li)
28 Next i
29
30 Next Y
 

View 3 Replies View Related

How To Create A Report To Be Viewable From A Web Page

Feb 18, 2001

HI, Is there a way to generate a high graphic report to a web page . if so how ?

Thanks
Ali

View 1 Replies View Related

Are These The Correct Steps? -- Encrypted Connection String And Security

Feb 6, 2007

Hi,

Assume I have an asp.net/sql server 2000 web app in a shared hosting
environment. I then encrypt the connection string using
ProtectSection("DataProtectionConfigurationProvider") in the page load
of my default.aspx page.

Am I understanding the following concepts then correctly?

1. I upload the site to the shared hosting server.
2. The first time I run the app eg. www.whatever.com/default.aspx,
the ProtectSection method above is executed.
3. Now the conn string area of my web.config is encrypted, and
asp.net will decrypt as needed.

4. If someone were to hack the server and view the web.config --
whether via getting into the server or via ftp, they would see an
encrypted connection string.
Thanks very much!

View 1 Replies View Related

Is It Possible To Create A Cover Page In SSRS 2005?

Jan 31, 2007

Very simply, I need to add a cover page to my SSRS 2005 report. I've tried this using the Page Header region, but the cover page will not show up on Preview or Export. How and where do I create a cover page?

View 1 Replies View Related

How To Create A Report Include 2 Page Form

Dec 4, 2007



Hi.
Does anybody knows how to create a report inside include 2 page? per page has itself body & pagefooter. for example on Page 1 is PO on page 2 is this PO contract list.


Thanks

View 6 Replies View Related

SQL Security :: Permissions To Create And Drop Tables?

Jul 31, 2015

what are the minimum permissions to allow a user to view, create, & drop tables within a DB (SQL 2008)?

View 4 Replies View Related

Missing Permission To Create Datasource, New Folder, Add Security..etc

Jun 20, 2007

I have windows 2003 reporting services 2005 that has been working fine. Now all of a sudden when I go to http://localhost/reports I am unable to assign security to folders(the link is hidden) the New data source button is hidden, the new folder button is hidden, upload folder and report builder are also hidden. I am logged in as aministrator.





Also when I connect to reporting services through SQL Mgmt Studio I have the same issue, there are no options for permissions only a general option.



I'm sure it's a permissions issue but what do i do to resolve?



Thx

View 2 Replies View Related

Create Subscription For Rpt Service With Windows Integrated Security !!!

Sep 29, 2005

hi All,

View 8 Replies View Related

SQL Security :: Create Linked Server Using Windows Authentication

Sep 9, 2015

I have two SQL Server machines - RPTPROD and DATAPROD.

I wanted to create a linked server from RPTPROD pointing to DATAPROD using Windows Authentication.  When I tried to create this linked server, I keep getting this error

"Login failed for user 'NT AUTHORITYANNOYMOUS LOGON' (Microsoft SQL Server,Error: 18456)".  

On the "Security" page, I chose "Be made using the login's current security context".   I'm sysadmin on both SQL Server machines.  

View 3 Replies View Related

Does Security Admin Have Access To Create Logins Using Sp_addlogin

May 31, 2007

i have an asp.net web application that uses SQL2000 backend. any users login to the application using a proper SQL login. so each user has unique logins

One of the roles within the application is to allow the user to create new logins for the application which inturn creates a SQL login. for this i have been using the following special sp's within an application specific sp:-

EXEC sp_addlogin @strUsername, null, 'WEA_MIS', @loginlang
EXEC sp_grantdbaccess @strUsername, @strUsername
EXEC sp_addrolemember @strRole, @strUsername
EXEC sp_password NULL, @strPassword, @strUsername




the only way ican get this to run is if the user executing the sp is a member of sys admin, ideally i dont want to be giving anyone access to sys admin. i thought security admin would allow me to do the above but it doesnt. Is there any other ways or ideas to get around this problem

Cheers,
Craig

View 5 Replies View Related

TRYING TO CREATE CERTIFICATE FOR SERVICE BROKER SECURITY BUT GETTING ERROR

May 22, 2007

hi all,

i m trying to send message between different server instance using service broker.

and for security purpose i am trying to create certificate. for that i have used makecert.exe and get a certificate and a private key. but when i am creating certificate using that file it is showing error

the code is --

CREATE CERTIFICATE ctfSourceServerMaster

FROM FILE = 'C:SourceServer.cer'

WITH PRIVATE KEY ( FILE = 'C:SourceServer.pvk', DECRYPTION BY PASSWORD = 'PrivateKeyPassword' )

ACTIVE FOR BEGIN_DIALOG = ON

GO

i have created the file SourceServer.cer' and SourceServer.pvk' by using makecert.exe tool.

the idea behind creating the certificate ctfSourceServerMaster is to give transport security.

I am running the particular script in the master database.

but still i am getting error

ERROR:----

The certificate, asymmetric key, or private key file does not exist or has invalid format.



If any body has any idea please help!!!!!!!!!!!

Thanks a lot in advance

View 1 Replies View Related

Error At Login Page: Conversion Failed When Converting From A Character String To Uniqueidentifier.

Jan 5, 2008

Hello,  Im Getting an error (below) at the login page. The only control on
that page is a Login control, adn the error below comes when I click login. Does anyone know what Im doing wrong? This is my login page:<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" Title="myapp- Login" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentHeader" Runat="Server">    LOGIN</asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="ContentBody" Runat="Server">    <table border="1" cellpadding="0" cellspacing="0" width="305">        <tr>            <td class="bodyText" colspan="2" style="height: 20px; text-align: center;">                <p>                    <!-- TemplateBeginEditable name="mainText" -->                    &nbsp;<asp:Login ID="Login1" runat="server" TitleText="Existing Users Log In">                    </asp:Login>                </p>            </td>        </tr>        <tr>            <td style="text-align: right">                <asp:LinkButton ID="lbNewmembers" runat="server" OnClick="lbNewmembers_Click">New Member?</asp:LinkButton></td>            <td>                <asp:LinkButton ID="lbForgotPassword" runat="server" OnClick="lbForgotPassword_Click">Forgot Password?</asp:LinkButton></td>        </tr>    </table></asp:Content>Error: 
Server Error in '/myApp' Application.


Conversion failed when converting from a character string to
uniqueidentifier. Description:
An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and
where it originated in the code. Exception Details:
System.Data.SqlClient.SqlException: Conversion failed when converting from a
character string to uniqueidentifier.Source Error:



An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:



[SqlException (0x80131904): Conversion failed when converting from a character string to uniqueidentifier.] System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +859322 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +736198 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1959 System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31 System.Data.SqlClient.SqlDataReader.get_MetaData() +62 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +903 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +122 System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) +62 System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +1121 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105 System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42 System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +83 System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +160 System.Web.UI.WebControls.Login.AttemptLogin() +105 System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +99 System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35 System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +163 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

Version Information: Microsoft .NET Framework Version:2.0.50727.312;
ASP.NET Version:2.0.50727.833

View 1 Replies View Related

Reporting Services :: All Record Are Displaying On One Page - How To Display Page By Page

Nov 11, 2015

I have created one reports but all the records are displaying on one page.find a solution to display the records page by page. I created the same report without group so the records are displaying in page by page.

View 3 Replies View Related

SQL Security :: Create Database User And Give Grants To Few System Tables

Aug 12, 2015

Need to create a user in sql server provide grants to few system tables to the above user.

View 10 Replies View Related

SQL Security :: Give Access To Create Alter And Execute SPs In Server 2008R2

May 12, 2015

Is there a way i can grant a windows authenticated user say abcadam privilege:

-> to create, execute and alter the stored procedures that will be created by him only:

Point is we do not want the user to execute alter or modify other stored procedures out there for that DB

View 13 Replies View Related

SQL Security :: How To Create A Low Privilege User And Role For Server Session State

May 26, 2015

An old website I inherited uses sa to connect to SQL SessionState and had the details in the web.config. This is bad for security.The session state database is of -sstype "t" which is defined as:Temporary. Session state data is stored in the SQL Server tempdb database. Stored procedures for managing session state are installed in the SQL Server ASPState database. Data is not persisted if you restart SQL. This is the default.What kind of WIndows user, SQL Login, role and permissions do I need to create to make Session State secure? (Windows Server 2012 and SQL Server 2012 mixed mode authentication, Webfarm).

View 4 Replies View Related

How To Create/enable Row Level Security Using An Indirect Match On A Report Model

Feb 13, 2008



I've been through a number of tutorials on how to enable row-level security based on a userID, but my problem is more complicated and I do not have sufficient understanding of report models to guess.

My security information is defined in a table within my database. It contains a username and an account mask. An account mask maps to 1 or more account codes contained in the other data tables in my report model. A user may have more than one account mask defined for his account.

I understand the concept of directly mapping the logged-in user to a field containing a matching username. Is it possible to do a two-step mapping, so that based on the user ID I can get the account mask(s) and then evaluate which account codes match the mask(s)?

Or is there a different/better way to set this up? Defining SQL roles/groups is not an option, because of some compatibility issues with external systems.


So far, because my security table has no defined relationship with the data tables, I have not even been able to get it into my report model (Would love any suggestions on that one, too.)

I'd appreciate any ideas or suggestions - even if only something to investigate.
Thanks,
Sarah

View 1 Replies View Related

Create A Certificate From Hex String

Feb 7, 2008

Hi,

Does anyone know if there's a way to create a certificate from a hex string rather than a backup file? i.e:





Code Snippet

create certificate from 0x123ABC...;

rather than

create certificate from 'C:mycert.cer' (or whatever the syntax is)
I know that you can do this for assemblies (and in fact I use this) - is there an equivalent for certificates? If not, why not?

Cheers,
Adam

View 3 Replies View Related

Is This An Efficient Way To Create A Comma String

Dec 5, 2005

Hi there,I have created a sp and function that returns amongst other things acomma seperated string of values via a one to many relationship, thecode works perfectly but i am not sure how to test its performance.. Isthis an efficient way to achieve my solution.. If not any suggestionshow i can improve it.. What are the best ways to check query speed???MY SP:CREATE PROCEDURE sp_Jobs_GetJobsASBEGINSELECT j.Id, j.Inserted, Title, Reference, dbo.fn_GetJobLocations(j.id)AS location, salary, summary, logoFROM Jobs_Jobs j INNER JOIN Client c ON j.ClientID = c.idORDER BY j.Inserted DESCENDGO--------------------------------------------MY Function:CREATE FUNCTION fn_GetJobLocations (@JobID int)RETURNS varchar(5000) ASBEGINDECLARE @LocList varchar(5000)SELECT @LocList = COALESCE(@LocList + ', ','') + ll.location_nameFROM Jobs_Locations l inner join List_Locations ll onll.LocationID = l.LocationIDWHERE l.JobID = @JobIDRETURN @LocListENDAny help or guidance much appreciated...

View 2 Replies View Related

How To Manipulate String In Query And Create New Field

Dec 22, 2006

I'm very new to SQL server and can use some help. MyTable has ColumnA, which contains strings composed of 1 to 4 numeric characters (0 thru 9) followed by alphabetic characters. For example, "53ASDF". In my query, I need to create ColumnB, which takes the numeric prefix from ColumnA's string and prepends it with zeros, if necessary, to create a string of exactly 4 numeric characters. For example, I could get the following result:

ColA ColB
"6abc" "0006"
"457def" "0457"
"7232hij" "7232"

I have implemented a temporary solution using a CASE statement:
SELECT ColA, ColB =
CASE
WHEN ISNUMERIC(LEFT(ColA, 4)) = 1 THEN (LEFT(ColA, 4))
WHEN ISNUMERIC(LEFT(ColA, 3)) = 1 THEN '0' + (LEFT(ColA, 3))
WHEN ISNUMERIC(LEFT(ColA, 2)) = 1 THEN '00' + (LEFT(ColA, 2))
WHEN ISNUMERIC(LEFT(ColA, 1)) = 1 THEN '000' + (LEFT(ColA, 1))
ELSE ''
END
FROM MyTable


Because of additional complexities, I need to implement the solution with a loop instead of a CASE statement. Can someone please describe such a solution?

I'm very confused about how variables work in SQL Server, but made an attempt to implement a solution. Hopefully, someone can make corrections and describe how to use it with a SELECT statement. I would greatly appreciate any suggestions. This is what I started with:

DECLARE @ColBstring char(4)
DECLARE @num int
SET @ColBstring = ''
SET num = 1;
-- Get the numeric prefix from ColumnA's string
WHILE(isnumeric(substring(colA, 1, num)) = 1)
@ColBstring = (substring(colA, 1, num)
num = num + 1

-- Prepend the ColumnB string with zeros
WHILE(LEN(@ColBstring) < 4)
@ColBstring = '0' + @ColBstring


Thanks for any help,
Mike

View 1 Replies View Related

Create Procedure Or Trigger To Auto Generate String ID

Feb 20, 2004

Dear everyone,

I would like to create auto-generated "string" ID for any new record inserted in SQL Server 2000.

I have found some SQL Server 2000 book. But it does not cover how to create procedure or trigger to generate auto ID in the string format.

Could anyone know how to do that?? Thanks!!

From,

Roy

View 7 Replies View Related

Create A String Of Records From A Table In A Stored Procedure,

Jul 20, 2005

I have a table tblCustomers in a one-to-many relationship with tabletblProducts.What I want to do is to create a stored procudure that returns a listof each customer in tblCustomers but also creates a field showing astring (separated by commas)of each matching record in tblProducts.So the return would look like:CustID Customer ProductList1 Smith Apples, Oranges, Pears2 Jones Pencils, Pens, Paperetc...Instead of:CustID Customer Product1 Smith Apples1 Smith Oranges1 Smith Pears2 Jones Pencils2 Jones Pens2 Jones PaperWhich is what you get with this:SELECT tblCusomers.CustID, tblCusomers.Customer,tblProducts.ProductFROMtblCusomers INNER JOINtblProducts ONtblCustomers.CustID = tblProducts.CustIDI'd appreciate any help!lq

View 6 Replies View Related

How To Create Trigger Which CREAT TABLE From A Variable String?

Feb 23, 2006



I have a Table Name "Forums". I want to ceate an AFTER-Trigger on it. It will execute when ever a new row is inserted to "Froums" Table.

Here is what I did but It needs to be corrected:

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

ALTER TRIGGER CreateTopicsTableTrigger

ON dbo.Forums

AFTER INSERT

AS

SET NOCOUNT OFF

DECLARE @myNewForum varchar

CAST(@@ROWCOUNT as varchar) /*Is it OK???*/

SET @myNewForum=@myNewForum+@@ROWCOUNT /*Here I dont know how assigments work in SQL*/

GO

CREATE Table @myNewForum /*Will this work some how???*/

( TopicID int IDENTITY NOT NULL, TopicTitle varchar(50) , CreatedBy varchar(50) ,

DateCreated DateTime , DateLastUpdate DateTime , LastUpdateBy varchar(50) )



::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

View 5 Replies View Related

SQL Server 2012 :: Adding A Number To A String To Create Series

Sep 3, 2014

add a number to the end of an ID to create a series.For example, I have an EventID that may have many sub events. If the EventID is 31206, and I want to have subEvents, I would like have the following sequence. In this case, lets say I have 4 sub Events so I want to check the EventID and then produce:

312061
312062
312063
312064

How can I check what the EventID is, then concatenate a sequence number by the EventID?

View 9 Replies View Related







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