Storing DATA To Sql Server From Access Efficiency
Jun 13, 2008
I have a function which is writing thousands of records coming from Access database and I was wondering if someone can suggest how can reconstruct my code for faster processing.
Here my code:
Public Sub MigrateNFSData(ByVal calcTbl As DataTable, ByVal strDBConnection As String)
Dim sqlServerConn As New SqlConnection(strDBConnection)
'Define stored procedures
Dim command As New SqlCommand
Dim getAccID As New SqlCommand("GetAccountID", sqlServerConn)
Dim getActionID As New SqlCommand("GetActionID", sqlServerConn)
Dim getExchangeID As New SqlCommand("GetExchangeID", sqlServerConn)
'Dim getParrentAccID As New SqlCommand("GetParentAccID", sqlServerConn)
Dim getStatusID As New SqlCommand("GetStatusID", sqlServerConn)
Dim getTraderID As New SqlCommand("GetTraderID", sqlServerConn)
Dim getGroupID As New SqlCommand("GetGroupID", sqlServerConn)
Dim getGroupIDByIP As New SqlCommand("GetGroupIDByIP", sqlServerConn)
Dim getTraderIDByIP As New SqlCommand("GetTraderIDByIP", sqlServerConn)
'Define insert records stored procedures
Dim insertAcc As New SqlCommand("InsertAccount", sqlServerConn)
insertAcc.CommandType = CommandType.StoredProcedure
Dim insertAction As New SqlCommand("InsertAction", sqlServerConn)
insertAction.CommandType = CommandType.StoredProcedure
Dim insertExchange As New SqlCommand("InsertExchange", sqlServerConn)
insertExchange.CommandType = CommandType.StoredProcedure
Dim insertGroup As New SqlCommand("InsertGroup", sqlServerConn)
insertGroup.CommandType = CommandType.StoredProcedure
Dim insertStatus As New SqlCommand("InsertStatus", sqlServerConn)
insertStatus.CommandType = CommandType.StoredProcedure
Dim insertTrader As New SqlCommand("InsertTrader", sqlServerConn)
insertTrader.CommandType = CommandType.StoredProcedure
Try
sqlServerConn.Open()
Catch ex As Exception
MessageBox.Show("Connection failed to open!")
End Try
'Set parameters to helper Get Stored Procedures to retreive Id's
getAccID.Parameters.Add("@AccName", SqlDbType.NVarChar)
getAccID.CommandType = CommandType.StoredProcedure
getActionID.Parameters.Add("@ActionName", SqlDbType.NVarChar)
getActionID.CommandType = CommandType.StoredProcedure
getExchangeID.Parameters.Add("@ExchName", SqlDbType.NVarChar)
getExchangeID.CommandType = CommandType.StoredProcedure
'getParrentAccID.Parameters.Add("@ParentName", SqlDbType.NVarChar)
'getParrentAccID.CommandType = CommandType.StoredProcedure
getStatusID.Parameters.Add("@StatusName", SqlDbType.NVarChar)
getStatusID.CommandType = CommandType.StoredProcedure
getTraderID.Parameters.Add("@TraderName", SqlDbType.NVarChar)
getTraderID.CommandType = CommandType.StoredProcedure
getGroupID.Parameters.Add("@GroupName", SqlDbType.NVarChar)
getGroupID.CommandType = CommandType.StoredProcedure
getGroupIDByIP.Parameters.Add("@IP", SqlDbType.NVarChar)
getGroupIDByIP.CommandType = CommandType.StoredProcedure
getTraderIDByIP.Parameters.Add("@IP", SqlDbType.NVarChar)
getTraderIDByIP.CommandType = CommandType.StoredProcedure
command = New SqlCommand("InsertTradeTransaction", sqlServerConn)
command.CommandType = CommandType.StoredProcedure
'Set Parameters for Insert stored procedures
insertAcc.Parameters.Add("@Account", SqlDbType.Text)
insertAction.Parameters.Add("@ActionName", SqlDbType.Text)
insertExchange.Parameters.Add("@Exchange", SqlDbType.Text)
insertGroup.Parameters.Add("@Group", SqlDbType.Text)
insertGroup.Parameters.Add("@ACCID", SqlDbType.Int)
insertGroup.Parameters.Add("@GroupID", SqlDbType.UniqueIdentifier)
insertStatus.Parameters.Add("@StatusName", SqlDbType.Text)
insertTrader.Parameters.Add("@Group", SqlDbType.UniqueIdentifier)
insertTrader.Parameters.Add("@IP", SqlDbType.Text)
insertTrader.Parameters.Add("@TraderName", SqlDbType.Text)
insertTrader.Parameters.Add("@TraderID", SqlDbType.UniqueIdentifier)
'Adding stored Get Stored Procedure's parameters-----------------------
command.Parameters.Add("@OrderNum", SqlDbType.Text)
command.Parameters.Add("@ACC_ID", SqlDbType.Int)
command.Parameters.Add("@Group_ID", SqlDbType.UniqueIdentifier)
command.Parameters.Add("@Trader_ID", SqlDbType.UniqueIdentifier)
command.Parameters.Add("@Exch_ID", SqlDbType.Int)
command.Parameters.Add("@Date", SqlDbType.DateTime)
command.Parameters.Add("@Time", SqlDbType.DateTime)
command.Parameters.Add("@ActionID", SqlDbType.Int)
command.Parameters.Add("@StatusID", SqlDbType.Int)
command.Parameters.Add("@TimeSent", SqlDbType.DateTime)
command.Parameters.Add("@Qty", SqlDbType.Int)
command.Parameters.Add("@Product", SqlDbType.Text)
command.Parameters.Add("@MMYYY", SqlDbType.Text)
command.Parameters.Add("@ExchOrderID", SqlDbType.Text)
command.Parameters.Add("@TimeTicks", SqlDbType.Int)
command.Parameters.Add("@W2G", SqlDbType.Int)
command.Parameters.Add("@W2Exch", SqlDbType.Int)
command.Parameters.Add("@G2ExchDerived", SqlDbType.Int)
command.Parameters.Add("@Msg", SqlDbType.NVarChar)
'command.Parameters.Add("@ExchDate", SqlDbType.DateTime)
'command.Parameters.Add("@ParentID", SqlDbType.Int)
'Paremeters Defenition--------------------------------------
'Parsing DateTime Objects
Dim formaterA As IFormatProvider
formaterA = New System.Globalization.CultureInfo("en-GB", True)
Dim dateObj As Date
'DEBUG
'Dim rows = calcTbl.Rows.Count
Dim colValues = GetColumnsValues(calcTbl)
'Write table with computed NFS data to sql server DB
For Each dr As DataRow In calcTbl.Rows
Dim orderNo = dr.Item("Order No").ToString()
command.Parameters("@OrderNum").Value = dr.Item("Order No").ToString()
getAccID.Parameters("@AccName").Value = dr.Item("Acct").ToString()
If getAccID.ExecuteScalar() = Nothing Then
insertAcc.Parameters("@Account").Value = dr.Item("Acct").ToString()
insertAcc.ExecuteNonQuery()
getAccID.Parameters("@AccName").Value = dr.Item("Acct").ToString()
command.Parameters("@ACC_ID").Value = getAccID.ExecuteScalar()
Else
command.Parameters("@ACC_ID").Value = Int32.Parse(getAccID.ExecuteScalar()).ToString()
End If
getGroupID.Parameters("@GroupName").Value = dr.Item("Group ID").ToString()
If getGroupID.ExecuteScalar() = Nothing Then
'Find Group by IP address if input Data Table doesn't have group
getGroupIDByIP.Parameters("@IP").Value = dr.Item("IP").ToString()
If getGroupIDByIP.ExecuteScalar() = Nothing Then
insertGroup.Parameters("@GroupID").Value = Guid.NewGuid
insertGroup.Parameters("@Group").Value = dr.Item("Group ID")
insertGroup.Parameters("@ACCID").Value = getAccID.ExecuteScalar()
insertGroup.ExecuteNonQuery()
command.Parameters("@Group_ID").Value = getGroupID.ExecuteScalar()
Else
command.Parameters("@Group_ID").Value = getGroupIDByIP.ExecuteScalar()
End If
Else
command.Parameters("@Group_ID").Value = getGroupID.ExecuteScalar()
End If
getTraderID.Parameters("@TraderName").Value = dr.Item("Trd ID").ToString()
If getTraderID.ExecuteScalar() = Nothing Then
getTraderIDByIP.Parameters("@IP").Value = dr.Item("IP").ToString()
If getTraderIDByIP.ExecuteScalar() = Nothing Then
insertTrader.Parameters("@Group").Value = getGroupID.ExecuteScalar()
insertTrader.Parameters("@IP").Value = dr.Item("IP").ToString()
insertTrader.Parameters("@TraderName").Value = dr.Item("Trd ID").ToString()
insertTrader.Parameters("@TraderID").Value = Guid.NewGuid
insertTrader.ExecuteNonQuery()
command.Parameters("@Trader_ID").Value = getTraderID.ExecuteScalar()
Else
command.Parameters("@Trader_ID").Value = getTraderIDByIP.ExecuteScalar()
End If
Else
command.Parameters("@Trader_ID").Value = getTraderID.ExecuteScalar()
End If
getExchangeID.Parameters("@ExchName").Value = dr.Item("Exch").ToString()
If getExchangeID.ExecuteScalar() = Nothing Then
insertExchange.Parameters("@Exchange").Value = dr.Item("Exch").ToString()
insertExchange.ExecuteNonQuery()
command.Parameters("@Exch_ID").Value = getExchangeID.ExecuteScalar()
Else
command.Parameters("@Exch_ID").Value = getExchangeID.ExecuteScalar()
End If
getActionID.Parameters("@ActionName").Value = dr.Item("Action").ToString()
If getActionID.ExecuteScalar() = Nothing Then
insertAction.Parameters("@ActionName").Value = dr.Item("Action").ToString()
command.Parameters("@ActionID").Value = getActionID.ExecuteScalar()
Else
command.Parameters("@ActionID").Value = getActionID.ExecuteScalar()
End If
getStatusID.Parameters("@StatusName").Value = dr.Item("Status").ToString()
If getStatusID.ExecuteScalar() = Nothing Then
insertStatus.Parameters("@StatusName").Value = dr.Item("Status").ToString()
insertStatus.ExecuteNonQuery()
command.Parameters("@StatusID").Value = getStatusID.ExecuteScalar()
Else
command.Parameters("@StatusID").Value = getStatusID.ExecuteScalar()
End If
'getParrentAccID.Parameters("@ParentName").Value = ""
'If getParrentAccID.ExecuteScalar() = 0 Then
'insert parent acc
'Else
'command.Parameters("@ParentID").Value = getParrentAccID.ExecuteScalar()
dateObj = Date.Parse(dr.Item("Exch Date").ToString(), formaterA)
command.Parameters("@Date").Value = dateObj
command.Parameters("@Time").Value = DateTime.Parse(dr.Item("Time").ToString())
command.Parameters("@TimeSent").Value = DateTime.Parse(dr.Item("Time Sent").ToString())
If (dr.Item("Qty").Equals(System.DBNull.Value)) Then
command.Parameters("@Qty").Value = System.DBNull.Value
Else
command.Parameters("@Qty").Value = Int32.Parse(dr.Item("Qty").ToString())
End If
command.Parameters("@Product").Value = dr.Item("Product").ToString()
command.Parameters("@MMYYY").Value = dr.Item("MMMYY").ToString()
command.Parameters("@ExchOrderID").Value = dr.Item("Exchange Order ID").ToString()
If (dr.Item("Time Ticks").Equals(System.DBNull.Value)) Then
command.Parameters("@TimeTicks").Value = System.DBNull.Value
Else
command.Parameters("@TimeTicks").Value = Int32.Parse(dr.Item("Time Ticks").ToString())
End If
'command.Parameters("@ExchDate").Value = Date.Parse(dr.Item("Exch Date").ToString())
'command.Parameters("@ExchDate").Value = Convert.ToDateTime(dr.Item("Exch Date").ToString())
'DEBUG
'Dim strW2G = dr.Item("W2G").ToString()
'Dim strW2E = dr.Item("W2E").ToString()
If (dr.Item("W2G").Equals(System.DBNull.Value)) Then
command.Parameters("@W2G").Value = System.DBNull.Value
Else
command.Parameters("@W2G").Value = Int32.Parse(dr.Item("W2G").ToString())
End If
If dr.Item("W2E").Equals(System.DBNull.Value) Then
command.Parameters("@W2Exch").Value = System.DBNull.Value
Else
command.Parameters("@W2Exch").Value = Int32.Parse(dr.Item("W2E").ToString())
End If
'command.Parameters("@G2ExchDerived").Value = Int32.Parse(dr.Item("Time Delta G2E").ToString())
If (dr.Item("Time Delta G2E").Equals(System.DBNull.Value)) Then
command.Parameters("@G2ExchDerived").Value = System.DBNull.Value
Else
command.Parameters("@G2ExchDerived").Value = Int32.Parse(dr.Item("Time Delta G2E").ToString())
End If
command.Parameters("@Msg").Value = dr.Item("Msg").ToString()
command.ExecuteNonQuery()
Next
sqlServerConn.Close()
End Sub
View 3 Replies
ADVERTISEMENT
Apr 20, 2007
I am using the 3-tiered architecture design (presentation, business laws, and data acess layers). I am stuck on how to send the image the user selects in the upload file control to the BLL and then to the DAL because the DAL does all the inserts into the database. I would like to be able to check the file type in the BLL to make sure the file being uploaded is indeed a picture. Is there a way I can send the location of the file to the BLL, check the filetype, then upload the file and have the DAL insert the image into the database? I have seen examples where people use streams to upload the file directly from their presentation layer, but I would like to keep everything seperated in the three classes if possible. I also wasn't sure what variable type the image would be in the function in the BLL that receive the image from the PL. If there are any examples or tips anyone can give me that would be appreciated.
View 2 Replies
View Related
Dec 29, 2006
Hello there,I just want to ask if storing data in dbase is much better than storing it in the file system? Because for one, i am currenlty developing my thesis which uploads a blob.doc file to a web server (currently i'm using the localhost of ASP.NET) then retrieves it from the local hostAlso i want to know if im right at this, the localhost of ASP.NET is the same as the one of a natural web server on the net? Because i'm just thinking of uploading and downloading the files from a web server. Although our thesis defense didn't require us to really upload it on the net, we were advised to use a localhost on our PC's. I'll be just using my local server Is it ok to just use a web server for storing files than a database?
View 6 Replies
View Related
Feb 19, 2008
Hi
is it possible to store a SQL CE command object in SQL Server CE database.
If so then what would be the datatype of such column????
thanx in advance
View 1 Replies
View Related
Sep 10, 2007
Hi everyone,My company has a website, use ms sql server. One table has more than 1000000 records. When users search data from this table(such as search records which contain the word "school" in NewsTile field.And the server often occurred deadlock error.How can I improve it?Thanks.P.S. The table has these fields:NewsIDNewsTitleNewsContentNewsClickTimesNewsInsertTime
View 14 Replies
View Related
Oct 1, 2007
Hi,
How to insert or store arabic data into a table in sql server 2005, also i want to retrieve it as arabic format.But now it insert (?????) like this.Please help me to find a solution.
Regards
Sabna S
View 3 Replies
View Related
Mar 22, 2007
Hello All,
We are developing customer support application. We will have so many customers after launching this product. But my problem is how will i store data of all these customers in SQL Server. Please suggest me.
View 1 Replies
View Related
Oct 7, 2015
One of my current responsibilities is to export data to 3rd party vendors. Each export can contain many csv files. The exports are all different in terms of what data is being sent.
The way I have it currently setup is each file that needs to be created is a view. An SSIS package gets the data from the view, writes to CSV, and then sftp to 3rd party vendor. This seemed like a good idea at first because the columns are static but the calculations might change. So all I have to do is ALTER VIEW and I don't have to change anything in the package.
Is there a better way of doing this? I was curious to see what other people are doing. What makes it challenging is that all the exports are so different. If they were similar I could have created generic views that cover all the exports instead of each export having its own view. Eventually I'm going to have 100's of views.
View 9 Replies
View Related
May 1, 2007
Hi all,
I'm wondering what is the best way to store time-series data in an SQL database?? I've done a bit of investigating on the rrdtool (round robin database tool) that is used in a lot of nix based solutions for monitoring network equipment. I have a need to collect performance data from servers and routers and then produces some nice graphs from that data. I'm just not sure who i should store that data without the database growing to some huge size.
Any suggestions?
View 1 Replies
View Related
Feb 25, 2015
I want to store Images as binary data in SQL table and compare it each time with a image file I am getting. I've tried below approach but getting error:
DROP TABLE #BLOBTest
CREATE TABLE #BLOBTest
(
TestID int IDENTITY(1,1),
BLOBName varChar(50),
BLOBData varBinary(MAX)
);
[Code] ....
Error: Msg 4861, Level 16, State 1, Line 10
Cannot bulk load because the file "C:Files12656.jpg" could not be opened. Operating system error code 3(failed to retrieve text for this error. Reason: 15105).
View 4 Replies
View Related
Aug 4, 2015
I have created procedure that creates a temptable with the users from a certain business unit.
I need to save the output from the username field to my variable @TheUsers as I will be using this variable in ssrs.
CREATE TABLE #TEMP_TABLE
(
useriduniqueidentifier,
usernamevarchar(200),
unitiduniqueidentifier,
unitnamevarchar(200)
[Code] ....
View 6 Replies
View Related
Jul 20, 2005
Hello,Currently we have a database, and it is our desire for it to be ableto store millions of records. The data in the table can be divided upby client, and it stores nothing but about 7 integers.| table || id | clientId | int1 | int2 | int 3 | ... |Right now, our benchmarks indicate a drastic increase in performanceif we divide the data into different tables. For example,table_clientA, table_clientB, table_clientC, despite the fact thetables contain the exact same columns. This however does not seem veryclean or elegant to me, and rather illogical since a database existsas a single file on the harddrive.| table_clientA || id | clientId | int1 | int2 | int 3 | ...| table_clientB || id | clientId | int1 | int2 | int 3 | ...| table_clientC || id | clientId | int1 | int2 | int 3 | ...Is there anyway to duplicate this increase in database performancegained by splitting the table, perhaps by using a certain type ofindex?Thanks,Jeff BrubakerSoftware Developer
View 4 Replies
View Related
Feb 7, 2007
I'm using a Hemisphere West MSR-152 card reader. I need to take data from the reader and store it into SQL Server 2005 Express. Can anyone give ideas on how to do this (sample code recommendations). I'm using visual studio 2005 express and I code with VB.NET.
View 3 Replies
View Related
Aug 1, 2001
Is it possible for retriving data from a remote Sql server database and storing it in a local sqlserver database.
View 1 Replies
View Related
Feb 20, 2007
HI
i want to save data larger than 8000 charactors in a colomn
is there any way to do it in mssql server 2000 desktop addition
plz help me
Thanks in advance
View 14 Replies
View Related
Nov 5, 2007
Hi
I have a table in SQL Server with following spec
Table1(Grossamount(money))
I have a SSIS variable called grosstot of type double and use following sql in Execute SQL task in SSIS
Select Sum(Grossamount) from Table1
I then assign the result of above sql stmt to the SSIS variable grosstot within the same Execute SQL task.
it gives me the error :
[Execute SQL Task] Error: An error occurred while assigning a value to variable "grosstot ": "The type of the value being assigned to variable "User::grosstot " differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object. ".
I tried the following sql to no avail
Select CONVERT(numeric (12,2), Sum(Grossamount) from Table1
Your help very much appreciated
View 7 Replies
View Related
Jan 7, 2007
Hi there ,1. i have a database and i want to encrypt my passwords before storing my records in a database plus i will later on would require to authenticate my user so again i have to encrypt the string provided by him to compare it with my encrypted password in database below is my code , i dont know how to do it , plz help 2. one thing more i am storing IP addresses of my users as a "varchar" is there a better method to do it , if yes plz help me try { SqlConnection myConnection = new SqlConnection(); myConnection.ConnectionString = ConfigurationManager.ConnectionStrings["projectConnectionString"].ConnectionString; SqlDataAdapter myAdapter = new SqlDataAdapter("SELECT *From User_Info", myConnection); SqlCommandBuilder builder = new SqlCommandBuilder(myAdapter); DataSet myDataset = new DataSet(); myAdapter.Fill(myDataset, "User_Info"); //Adding New Row in User_Info Table DataRow myRow = myDataset.Tables["User_Info"].NewRow(); myRow["user_name"] = this.user_name.Text; myRow["password"] = this.password.Text; // shoule be encrypted //not known till now how to do it myRow["name"] = this.name.Text; myRow["ip_address"] = this.ip_address.Text; myDataset.Tables["User_Info"].Rows.Add(myRow); myAdapter.Update(myDataset, "User_Info"); myConnection.Close(); myConnection.Dispose(); } catch (Exception ex) { this.error.Text = "Error ocurred in Creating User : " + ex.Message; }
View 3 Replies
View Related
May 6, 2005
Hi,
I have two servers that i want to create a SQL RS report on.
On one server there is an HR database with our staff details, on the other server there is a database of assets.
In order to report on the assets assigned to each user i am thinking that i will have to :
1) link the servers
2) create a view in the HR database exposing the fields needed
3) create a view in the assets database exposing the assets information joined to the view from the other server
4) create my reports on the view on the assets server.
is this right or am i barking up the wrong tree?
View 9 Replies
View Related
Jul 26, 2007
Hi
We have a application running on Sql server 2005, which require to browse/search text field. Does anyone know if Sql server's search/browse performance on text field is better than oracle?
The table the application will search on is a customer table that has a 10000 records in it, does this size of table casue a performance problem for sql server 2005 if I index the text field?
Please advise, thanks for your help!
Li
View 4 Replies
View Related
Jun 10, 2015
I have recently upgraded to SQL2014 on Win2012. The Access front end program works fine.
But, previously created Excel reports with built in MS Queries now fail with the above error for users with MS 2013. The queries still work for users still using MS 2007.
I also cannot create any new queries and get the same error message. If I log on as myself on the domain to another PC with 2007 installed it works fine, so I don't think it is anything to do with AD groups or permissions.
View 6 Replies
View Related
Oct 30, 2007
Hi guys,
I've been developing desktop client-server and web apps and have used Access and SQL Server Standard most of the time.
I'm looking into using SQL CE, and had a few questions that I can't seem to get a clear picture on:
- The documentation for CE says that it supports 256 simultaneous connections and offers the Isolation levels, Transactions, Locking, etc with a 4GB DB. But most people say that CE is strictly a single-user DB and should not be used as a DB Server.
Could CE be extended for use as a multi-user DB Server by creating a custom server such as a .NET Remoting Server hosted through a Windows Service (or any other custom host) on a machine whereby the CE DB would run in-process with this server on the machine which would then be accessed by multiple users from multiple machines??
Clients PCs -> Server PC hosting Remoting Service -> ADO.NET -> SQL CE
- and further more can we use Enterprise Services (Serviced Components) to connect to SQL CE and further extend this model to offer a pure high-quality DB Server?
Clients PCs -> Server PC hosting Remoting Service -> Enterprise Services -> ADO.NET -> SQL CE
Seems quite doable to me, but I may be wrong..please let me know either ways
Thanks,
CP
View 3 Replies
View Related
Apr 18, 2007
Hello All,
I am new to SQL Server 2000. I am eager to learn what factors/parameters are key for obtaining good retrieval performance of SQL Server 2000 (prompt response to user query).
I recall that someone told me that a recordset with asOpenStatic cursor type has higher speed than that of a recordset with other cursor types.
Is this true or false. Are there really some key parameters for perfomance tuning .
Thanks
View 2 Replies
View Related
Apr 22, 2015
When i am trying to start our hospital software based on SQL server 2000, it shows Following Error.Search Condition is not valid, (DBNETLIB) Connection Open (connect()). SQL server does not exist or excess denied. Due to Fetch data.I run our software in Windows 8.1, while it smothly runs in previous version of Windows XP and 7.
View 2 Replies
View Related
Jun 20, 2006
Hi again.
How do I store in SQL SERVER with 2 decimal places?
I set Data Type to Decimal with Scale set to 4 and Precision 19. But this doesn't work.
Any ideas? Thanks.
View 1 Replies
View Related
Jul 16, 2006
CREATE TABLE [dbo].[blogs] (
[blog_title] [nvarchar] (500) ,
[blog_desc_full] [varchar] (8000) ,
[blogger_name] [nvarchar] (100) ,
[mailid] [nvarchar] (100) ,
[blogid] [numeric](10, 0) IDENTITY (1, 1) NOT NULL ,
[blog_desc] [nvarchar] (125) ,
[cat_name] [varchar] (100) ,
[b_url] [varchar] (250) ,
[b_date] [datetime] NULL ,
[author] [nvarchar] (250) ,
[approval] [char] (1)
) ON [PRIMARY]
GO
using this script i have created my blog table.
and a procedure given below. i am using to insert data in it.
CREATE PROCEDURE SP_BlogAdd
@blog_title nvarchar(500),
@blog_desc_full varchar(8000),
@blogger_name nvarchar(100),
@mailid nvarchar(100),
@blog_desc nvarchar(125),
@cat_name varchar(100),
@b_url varchar(250),
@author nvarchar(250)
AS
INSERT INTO blogs(blog_title, blog_desc_full, blogger_name, mailid, blog_desc, cat_name, b_url,author)
VALUES(@blog_title ,@blog_desc_full ,@blogger_name,@mailid ,@blog_desc ,@cat_name ,@b_url,@author)
GO
now, the problem i m facing is.
i am using varchar datatype for [blog_desc_full] [varchar] (8000).
i want more than this size to store data in it.
please give me some detailed code.
i tried text datatype but i didnt succeed. how to use text datatype.
i replaced with text datatype.but in length i couldnt type. it shows only 16.
Please help me out.
regards,
ASIF
View 1 Replies
View Related
Jul 16, 2006
CREATE TABLE [dbo].[blogs] (
[blog_title] [nvarchar] (500) ,
[blog_desc_full] [varchar] (8000) ,
[blogger_name] [nvarchar] (100) ,
[mailid] [nvarchar] (100) ,
[blogid] [numeric](10, 0) IDENTITY (1, 1) NOT NULL ,
[blog_desc] [nvarchar] (125) ,
[cat_name] [varchar] (100) ,
[b_url] [varchar] (250) ,
[b_date] [datetime] NULL ,
[author] [nvarchar] (250) ,
[approval] [char] (1)
) ON [PRIMARY]
GO
using this script i have created my blog table.
and a procedure given below. i am using to insert data in it.
CREATE PROCEDURE SP_BlogAdd
@blog_title nvarchar(500),
@blog_desc_full varchar(8000),
@blogger_name nvarchar(100),
@mailid nvarchar(100),
@blog_desc nvarchar(125),
@cat_name varchar(100),
@b_url varchar(250),
@author nvarchar(250)
AS
INSERT INTO blogs(blog_title, blog_desc_full, blogger_name, mailid, blog_desc, cat_name, b_url,author)
VALUES(@blog_title ,@blog_desc_full ,@blogger_name,@mailid ,@blog_desc ,@cat_name ,@b_url,@author)
GO
now, the problem i m facing is.
i am using varchar datatype for [blog_desc_full] [varchar] (8000).
i want more than this size to store data in it.
please give me some detailed code.
i tried text datatype but i didnt succeed. how to use text datatype.
i replaced with text datatype.but in length i couldnt type. it shows only 16.
Please help me out.
regards,
ASIF
View 1 Replies
View Related
Feb 5, 2007
is there a step by step paper to get there? here is what i need to consider. I Iwill have many customers that will need their own set of records and access pages "branded for their company" each customer will have many clients. I am hosting this application on a windows 2003 server with SQL 2005 server enterprise.
I am using windows authentication, I have created a username in windows, then i added the windows user in SQL management studio in security, granted "DB Read" and "DB write" and again under the database security tab. still from the web authentication fails. i must be nissing a step or two?
I expect to set up a username for each database as i setup new customers.
View 1 Replies
View Related
Jun 9, 2013
I have two database(MYDB1 , MYDB2) on two different server's(SERVER1 , SERVER2) . I want to create an store procedure in MYDB1 on SERVER1 and get some data from a table of MYDB2 on SERVER2. How can i do this?
View 5 Replies
View Related
Sep 22, 2015
I'm trying to re-write my database to de-couple the interface (MS Access) from the SQL Backend. As a result, I'm going to write a number of Stored Procedures to replace the MS Access code. My first attempt worked on a small sample, however, trying to move this on to a real table hasn't worked (I've amended the SP and code to try and get it to work on 2 fields, rather than the full 20 plus).It works in SQL Management console (supply a Client ID, it returns all the client details), but does not return anything (recordset closed) when trying to access via VBA code.The Stored procedure is:-
USE [VMSProd]
GO
/****** Object: StoredProcedure [Clients].[vms_Get_Specified_Client] Script Date: 22/09/2015 16:29:59 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
[code]....
View 4 Replies
View Related
Sep 10, 2007
I have one column in SQL Server 2005 of data type VARCHAR(4000).
I have imported sql Server 2005 database data into one mdb file.After importing a data into the mdb file, above column
data type converted into the memo type in the Access database.
now when I am trying to import a data from this MS Access File(db1.mdb) into the another SQL Server 2005 database, got the error of Unicode Converting a memo data type conversion in Export/Import data wizard.
Could you please let me know what is the reason?
I know that memo data type does not supported into the SQl Server 2005.
I am with SQL Server 2005 Standard Edition with SP2.
Please help me to understans this issue correctly?
View 4 Replies
View Related
Jan 22, 2007
I have a table for articles that I want as
the basis for a blog. I have a field of description where the actual
article will go, I have only ever really
used tables to put in 'blocks' of text, how would I go about storing/displaying
data that is in my database table in a more formatted way, for example line
breaks, indents etc?
View 4 Replies
View Related
May 11, 2007
Hi everyone,
I have some data which is in korean Language and i want to store that data in sql server 2000 table's row.But i am not able to store it.
When i try to store it then it display me square box in table.
Does anybody have any idea about this matter?
Plz reply me back as soon as possible.
Thanks
-------Nimesh Patel
View 6 Replies
View Related
Dec 19, 2007
Hi, I'm in the process of creating a database table and was wondering if it's better to store calculated values or recalculate them each time. So for example, I am creating a table that stores articles and then a table to store the pages to the article. If a new page is added should I update the pages field in the articles table or should I calculate the number of pages for an article when it's queried? Thanks,John
View 3 Replies
View Related