View Complete Post
I want to generate create table script using c#.net, I want to connect sql server 7.0 and generate table create script. Its urgent kindly help me urgently.
/****** Object: Table [dbo].[Password] Script Date: 10/26/2010 10:17:30 ******/
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING ON
CREATE TABLE [dbo].[Password](
[user_id] [int] NOT NULL,
[password] [varchar](30) COLLATE SQL_Latin1_General_CP850_BIN2 NULL,
[response1] [varchar](40) COLLATE SQL_Latin1_General_CP850_BIN2 NULL,
[response2] [varchar](40) COLLATE SQL_Latin1_General_CP850_BIN2 NULL,
[response3] [varchar](40) COLLATE SQL_Latin1_General_CP850_BIN2 NULL,
CONSTRAINT [Password_PK] PRIMARY KEY CLUSTERED
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
SET ANSI_PADDING OFF
ALTER TABLE [dbo].[Password] WITH CHECK ADD CONSTRAINT [User_Password_FK1] FOREIGN KEY([user_id])
REFERENCES [dbo].[User] ([id])
ALTER TABLE [dbo].[Password] CHECK CONSTRAINT [User_Password_FK1]
When trying to generate a "CREATE TO" script from a SQL Server 2008 table containing either DATE or DateTime2 data types, I get the following error:
Script failed for Table 'dbo.tMyTable'. (Microsoft.SqlServer.Smo)
Column SnapshotDate in object tMyTable contains type DateTime2, which is not supported in the target server version, SQL Server 2005. (Microsoft.SqlServer.Smo)
However, I've checked all my databases (including master, tempdb, etc.) and ALL are cmptlevel=100.
I have read the data of a excle file and captured the data into the dataset to a datatable, now that data is to be inserted into a SQL Server table using bulk copy option. I am using -
public bool BulkEnterData(DataTable dt, string tblName)
SqlBulkCopy bulk = new SqlBulkCopy(con);
bulk.DestinationTableName = tblName;
ERROR Getting-A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The pipe has been ended.)
How to resolve the above problem or any other solution is available.
There's always been disagreement about whether large blobs, such as document and multimedia items, should be stored in the database or file system. In SQL Server 2008 you don't have to choose; filestream storage provides the best of both approaches.
MSDN Magazine May 2009
New spatial data support in SQL Server 2008 opens the door to mapping and querying geometric and geographic data, allowing you to build exciting new applications.
MSDN Magazine February 2009