Simple Question, Set Length In A New Table

Jan 31, 2007

using SQL (server man studio) EXPRESS

when I create a table



I only see... (col-column)

col name ; Data type ; ALLOW NULLS



how can I set the length of an integer field



or is it because it is so express, I just have to set up the data type -- such as integer





M A N Y THANKS



View 4 Replies


ADVERTISEMENT

How To Alter Column Length Of The Master Table Along With The Slave Table?

Aug 13, 2006

In SQL Server 2005,here are two tables, created by the following SQL Statements:

CREATE TABLE student(
ID CHAR(6) PRIMARY KEY,
NAME VARCHAR(10),
AGE INT
);

CREATE TABLE score(
ID CHAR(6) PRIMARY KEY,
SCORE INT,
FOREIGN KEY(ID) REFERENCES student(ID)
);

For the length of Column ID is not enough, So I want to alter its length.The alter statement is:

ALTER TABLE student ALTER COLUMN ID CHAR(20)

For the table student is referenced by table score, the alter statement can not alter the column of the table student, and the SQL Server DBMS give the errors.

But, I can manually alter the length of the column ID in SQL SERVER Management Studio. How to alter column length of the master table(student) along with the slave table(score)?

Thanks!

View 2 Replies View Related

T-SQL (SS2K8) :: Procedure Parameter Length Declaration Less Than Column Length?

Jun 30, 2014

is there any way or a tool to identify if in procedure the Parameter length was declarated less than table Column length ..

I have a table

CREATE TABLE TEST001 (KeyName Varchar(100) ) a procedure
CREATE PROCEDURE SpFindNames ( @KeyName VARCHAR(40) )
AS
BEGIN
SELECT KeyName FROM TEST001
WHERE KeyName = @KeyName
END
KeyName = @KeyName

Here table Column with 100 char length "KeyName" was compared with SP parameter "@KeyName" with length 40 char ..

IS there any way to find out all such usage on the ALL Procedures in the Database ?

View 2 Replies View Related

BlobColumn.GetBlobData() With Data Length &&> Integer Length (32767)

Mar 27, 2008

For those of you who would like to reference my exact issue, I'm dealing with the RSExecution SSIS package at the "Update Parameters" data flow task, at the Script Component.

The script tries to split parameter data into name and value. Unfortunately, I have several reports that are passing parameters that are very large. One example has over 65,000 characters all in the normal "&paramname=value&parm2=value..." format.

The code in the script works fine until it gets to one of these very large parameter sets. I have figured out what is causing the issue. Here's some code:

Dim paramBlob as Byte()
paramBlob = Row.BlobColumn.GetBlobData(0, Row.BlobColumn.Length)

The second parameter of the .GetBlobData function takes an INTEGER as its count! Therefore, no matter what kind of datatype I pass to the string that the script will later split, it will be limited to 32767 characters.

THIS IS A PROBLEM!!!

Does anyone know a workaround for this issue? I need all of the parameter data to be reported, and I would hate to have to skip over rows like this. Also, if I'm missing something, please fill me in!

Thanks for your help in advance,
LOSTlover

View 6 Replies View Related

Measure The Table Length

Dec 28, 1999

I have created a table in the sql server 7.0 and I wanted to know the what is the size of the table, is there any storeprocedure or command that can be used to measure the space used by the table in the database

View 2 Replies View Related

Record(row)length Of A Table

Apr 26, 1999

Hi,

Does any one know how to find a record (row) length of a table?

View 3 Replies View Related

Variable Length CSV To Table

Oct 23, 2007

Hi,

I want to export one CSV file to a SQL table.

My problem is my Csv File is variable length file like :

000;1;amruth;20000
000;1;amruth;20000;praveen;shell;floor11
000;1;amruth;20000;praveen;shell;floor11;aaa;aa;aa;aa;aa;aa;aa



Sql Table is like col1- - - - - - - Col 15

I want to make a package to import that variable length Csv to This Sql table like

000 amruth 20000 Null Null Null Null Null Null Null Null Null Null
000 amruth 20000 Praveen shell floor11 Null Null Null Null Null Null Null
000 amruth 20000 Praveen shell floor11 aaa aa aa aa aa aa aa

I hope you got the problem.

I tried with BulkInsert using ; as column Delimiter and as Row Delimiter
and Flat File connection with Same Delimiters but its not working.

its importing like :

000 1 amruth 20000
000 1 amruth 20000;praveen;shell;floor11
000 1 amruth 20000;praveen;shell;floor11;aaa;aa;aa;aa;aa;aa;aa

its inserting like this in 4th column.

If any body can help me on this please reply Asap.

Thanks in advance


View 11 Replies View Related

CommandParameters.length Don't Match Parametervalues.length

Feb 24, 2008

I am trying to narrow down this problem.  Basically, I added 3 columns to my article table.  It holds the article id, article text, author and so on.  I tested my program before adding the additional field to the program.  The program works fine and I can add an article, and edit the same article even though it skips over the 3 new fields in the database.  It just puts nulls into those columns.So, now I have added one of the column names I added in the database to the code. I changed my businesslogic article.vb code and the addarticle.aspx, as well as the New article area in the addartivle.aspx.vb  page. The form now has an additional textbox field for the ShortDesc which is a short description of the article. This is the problem now:  The command parameters.length is 9 and there are 10 parameter values.  Right in the middle of the 10 values is the #4 value which I inserted into the code.  It says Nothing when I hover my mouse over the code after my program throws the exception in 17 below.  Why is  command parameters.length set to 9 instead of 10?  Why isn't it reading the information for value 4 like all the other values and placing it's value there and calculating 10 instead of 9? Where are these set in the program?  Sounds to me like they are hard coded in someplace and I need to change them to match everything else.  1 ' This method assigns an array of values to an array of SqlParameters.2 ' Parameters:3 ' -commandParameters - array of SqlParameters to be assigned values4 ' -array of objects holding the values to be assigned5 Private Overloads Shared Sub AssignParameterValues(ByVal commandParameters() As SqlParameter, ByVal parameterValues() As Object)6 7 Dim i As Integer8 Dim j As Integer9 10 If (commandParameters Is Nothing) AndAlso (parameterValues Is Nothing) Then11 ' Do nothing if we get no data12 Return13 End If14 15 ' We must have the same number of values as we pave parameters to put them in16 If commandParameters.Length <> parameterValues.Length Then17 Throw New ArgumentException("Parameter count does not match Parameter Value count.") 18 End If19 20 ' Value array21 j = commandParameters.Length - 122 For i = 0 To j23 ' If the current array value derives from IDbDataParameter, then assign its Value property24 If TypeOf parameterValues(i) Is IDbDataParameter Then25 Dim paramInstance As IDbDataParameter = CType(parameterValues(i), IDbDataParameter)26 If (paramInstance.Value Is Nothing) Then27 commandParameters(i).Value = DBNull.Value28 Else29 commandParameters(i).Value = paramInstance.Value30 End If31 ElseIf (parameterValues(i) Is Nothing) Then32 commandParameters(i).Value = DBNull.Value33 Else34 commandParameters(i).Value = parameterValues(i)35 End If36 Next37 End Sub ' AssignParameterValues38 39 40 41  

View 2 Replies View Related

SQL 2012 :: Length Of Columns In A Table?

Jan 20, 2015

I am working on a migration project and need to derive the total length of the columns for a particular table. I have the following query designed for the same:

select
t.name,
sum(c.max_length)
from sys.all_columns c
join sys.all_objects t
on t.object_id = c.object_id
where t.name='test_1'
group by t.name
;

This query gives me correct results except for data types varchar(max), nvarchar and xml for which the max_length is stored as -1 which causes my results to be incorrect when summed up. Is there any other way to find out the maximum data length for such type of columns?

Here is my table DDL:

CREATE TABLE [dbo].[TEST_1](
[COL_1] [bigint] NULL,
[COL_2] [bit] NULL,
[COL_3] [char](10) NULL,
[COL_4] [date] NULL,

[code]....

View 2 Replies View Related

How To Determine Length Of Table Row In Sql 2005

Sep 14, 2006

How, other than by doing the addition on my own, can I detemrine the length of a row in a table?



TIA,



barkingdog

View 7 Replies View Related

Get Max Length Of Every Column Of A Table In One Query

May 20, 2008

Hi,

I have a table with 500 columns, most of them are type of varchar. I would have the following data set:

ColumnName DataTypeLength MaxLength
-------------------- -------------------- -------------------
ColA 50 42
ColB 10 7
ColC 50 8
.... ... ...


I can have a query to get the data type length (hom many varchar) for each columns:

SELECT column_name, data_Type, character_maximum_length
FROM information_Schema.columns
WHERE table_name='***'
ORDER BY ordinal_position

but I have problem to get the actual maximum length of the each column. Anybody have the similar query?

thanks,

View 9 Replies View Related

Total Length Of Data Type In A Table

Oct 3, 2007

Folks:

I would like to know the total length of data type in a table. I ran the following query. Will this give me the correct information? I also ran sp_columns <table name> and it too give the length. But There is a difference in the numbers. Am I doing something wrong and which is the correct the query or sp_column.

select sum(length) from syscolumns
where id in (select id from sysobjects
where name = 'XYZABC')


sp_columns XYZABC



Thanks !

View 5 Replies View Related

Changing Column Length Of A Replicated Table

Jul 31, 2006



Can I increase the length of a varchar column of table involved in transactional replication without dropping and recreating publication/subscription?

Any help/short-cuts/undocumented features greatly appreciated.

Regards

Opal

View 6 Replies View Related

Simple Sort On A Table...

Jul 23, 2005

I am adding this to my c#.Net app...How can I sort all rows in a table?After it is sorted, will it remain so after i do a cnSQL.Close();so that when I then do a:string strSQL = "SELECT InvoiceNumber " +"FROM tblPrintInvoice " ;Is it still sorted for me to do a:drSQL.Read?Thanks,Trint

View 2 Replies View Related

HELP: Simple Table Question

Nov 28, 2007

I have a problem with getting SSRS to do exactly what I want it to do. My report is fairly simple in that it is a header a detail row and a footer for totals. I have an Oracle stored procedure pass the table of information to SSRS and no matter how I pass the information I cannot get SSRS to do what I want it to do. Heres the problem.

Lets say I have 3 pieces of information. The customers name, customers SSN, and their Institution. For every customer the name and SSN will stay the same but each customer can belong to multiple institutions. So, I wanted to have a basic table display their name, their SSN and their Institution on one row and if they belong to more than 1 institution the following institutions will be displayed on the following rows.

I've tried grouping by SSN but that just only displays the SSN once and only the first institution in that group and ignores showing the other institutions. I've also tried grouping the SSN and name in the group header and then played around with putting the Institutions in the details but I cant get that first Institution to appear on the first row with the Name and SSN.

I'm at a loss here and this seems like it should be a simple solution but I cant figure it out. I'm know there must be a way because this is a really basic fundamental that I'm trying to accomplish and is probably used in many reports.

Hope someone can help me.

-Evan

View 3 Replies View Related

Create A Simple Table

Feb 6, 2008

i realize this is a basic question, but i'd like advise on the best way to create a table to store financial time series data. i already have a table to store securityid which is the primary key. However, when i move over to the table to store time series, i will have many secid as well as different dates and types of data. what should my primary key-autonumbered or concatenated from secid and date etc...in addition, i want to have a good way to query the table to make sure there are no dupes (same secid and same data etc). many thanks

View 1 Replies View Related

Simple Table Update With Lookup

Feb 9, 2006

Hi i have three tables

T1 is a table of data imported by DTS, it has staff numbers and location names

T2 is a table that contains system data about staff and has a column for the location id

T3 is a table for the location names and their ID's

i am trying to write the sql to update T2 with the new location IDs for staff that have moved location but am not getting what i need.

so far i have :
update
T2
set T2.LocationId =T3.LocationID
from T3
inner join T1
on T3.departmentname = T1.contact_location

the update runs but sets all rows to the same value. am now burried deep in the [I've stared at this too long and cant see the wood for the trees] stage :mad:

Thanks
FatherJack

View 2 Replies View Related

Looking For Simple Purge Of Records From A Table

May 21, 2007

greets all, ive got a table with batches of records. each group of records has a batch id as part of the PK in the form BTCXXXX where XXXX is an auto-incremented number. so lets say i have 100 batches of 20k records per batch in the table. so the distinct batch ids are BTC0200 (oldest batch) through BTC0300 (newest batch).
i only want to keep the 90 most recent batches in the table at any given time.
is it ok to just subtract 90 from the last batch id and do something like:

DECLARE @batch_id char(10)
SET @batch_id = 'BTC' + batch_num-90

DELETE FROM ITEM_BATCH
WHERE BATCH_ID < @batch_id

i want to cover if the table has more than 90 batches and if the table has less then 90 batches. is this a feasible approach?

View 4 Replies View Related

T-SQL (SS2K8) :: Time Table For Simple ETL

Jun 17, 2014

I am trying to build a simple time table and pre-populate the rows for lets say 1 year. Basically, I will be extracting the data froma source based on the boundaries of this table. eg of this table as I can visualize:

Date StartTime Endtime IsProcessed
2014-06-17 2014-06-17 00:00:00 2014-06-17 01:00:00 0
2014-06-17 2014-06-17 01:00:00 2014-06-17 02:00:00 0
2014-06-17 2014-06-17 02:00:00 2014-06-17 03:00:00 0

Lets call this TimeTable and we have our souce and destination table..The ETL process will pick the start time and endtime, will pass these as parameters to the source and extract the data as follows:

Insert into Destination
select * from source where entrydate>=TimeTable.StartTime and entrydate<TimeTable.EndTime

Once this data gets loaded, the IsProcessed field is set to 1 so that next time it won't be considered.I am trying an incremental load process here.

View 5 Replies View Related

Simple 3 Table Query Failing.

Aug 25, 2005

I have a database with three tablestbl_listings - listings of houses on for saletbl_intersted - table which tracks if a user is interested in thelisting, it has two columns mls(the key for tbl_listings) and user(userlogin)tbl_review - table which trackes if a user has reviewed the listing.Like tbl_interested it has two columns (the key for tbl_listings) anduser(user login)How can I create a query on tbl_listings for reocords reviewed by oneuser?I am trying to create a query for listings that are revied by useruserid. I am using the query below. It works fine unless there is arecord in tbl_interested for a differnt user.In reality I am calling this query from the web. On the website I havean intersted dropdown with the choices All, interested, not interested.The website also has a reviewed dropdown with all, reviewed and notreviewed.I am using the query below as a starting point. my query works finewith one user, but if a user2 enters a record in tbl_intersted itthrows off the left join for user1. How can I fix this?SELECT COUNT(B.reviewed) AS review_count,Count(B.mls) as mls_count,A.mls,FROM mls.tbl_listings ALEFT OUTER JOIN mls.tbl_review B ON A.mls = B.mlsLEFT OUTER JOIN mls.tbl_interested D ON A.mls = D.mlswhere (B.reviewed = 'userid') and ((D.interested is null) or(D.interested = 'userid'))----My query works fine if there is one user, however once user2 reviews arecord from tbl_listing user1

View 2 Replies View Related

Simple System Table Question

Jul 20, 2005

Hi,Is there a way to hide the system tables created in each SQL serverdatabase (ie. dtproperties, sysindexes). It's not a big deal, but I'dlike to see only the tables I create.

View 5 Replies View Related

Simple (for Some) 2 Table Summary Query

Jul 10, 2006

...but apparently not me, I'm very new with this T-SQL stuff and am seeking the advice of the seasoned pros at this forum.

Description on my SQL-5 Environment:

Table I Sales:       Prod_ID, Prod_DT, Sales_DT, Buyer_Name, Buyer_State

Table II Repairs:   Prod_ID, Prod_DT, Sales_DT, Repair_DT

These 2 tables are joined by the common key Prod_ID & also and share the product's production & sales dates. What I would like to do is produce a rate summary similar to description below.

Production_YYYY, Production_MM,  Sales_Cnt, Repairs_Cnt, Repair_Rate((Repairs_CNT/Sales_CNT)*100)

Important to remember that not all products experience repairs, so the basis for Sales_CNT needs to be the Sales Table, even thou Prod_DT also appears in Repairs Table.





It's simple enough for novice like me to produce 2 tables independently and then merge back those resulting tables into the single table output described above. But my question is how do I write a single SQL "SELECT" request that will produce the results into just a single table.

Thanks in advance for your help!

 

View 6 Replies View Related

Simple SQL Query- Exchanging IntegerID With Name From Other Table.

Apr 17, 2008

 Hi Guys,I have the following query: SELECT DecisionSessionID, RuleID, Operator1, Criteria1, AttributeForCriteria1, Operator2, Criteria2, AttributeForCriteria2, Operator3, Criteria3,
AttributeForCriteria3, Result
FROM myTable
WHERE (SessionID = @SessionID) Now I want that instead of the complicated Criteria1, Crieria 2 and Criteria 3 values the users sees the names whichare defined in myCriteria. I though the query might then look like this SELECT
DecisionSessionID,
RuleID,
Operator1,
Criteria1 (SELECT CriteriaName FROM myCriteria WHERE Criteria1 = CriteriaID),
AttributeForCriteria1,
Operator2,
Criteria2 (SELECT CriteriaName FROM myCriteria WHERE Criteria2 = CriteriaID).
AttributeForCriteria2,
Operator3,
Criteria3 (SELECT CriteriaName FROM myCriteria WHERE Criteria3 = CriteriaID),
AttributeForCriteria3,
Result
FROM dbo.aspnet_FuzzyRules
WHERE (DecisionSessionID = @DecisionSessionID) I am not very familiar with the sql syntax and as you can imagine the above psyeudo version is not really working.Do you know how the correct syntax for such a nested query would look like?many thanks,polynaux

View 2 Replies View Related

Query To Search All Fields In Simple Table

Mar 1, 2006

I am trying to write a simple search page that will search all the fields in a database to find all records that match a user input string.  The string could happen anywhere in any of the fields.  I have a dataset and can write a query but am unsure what the format is for this simple task. I figured it would look like this:
 
SELECT Table.*
FROM Table
WHERE * = @USERINPUT 
But thats not working.  Can someone help.?  Thanks..

View 1 Replies View Related

Probable Bug In Stored Procedure That Deletes Row In Simple Table. Plz Help!

Apr 9, 2008

I suspect I have a but in a stored procedure that is used to delete records in a table. Here's the code for the gridview and its SQLDataSource
 1 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
2 DataKeyNames="table2_id" DataSourceID="SqlDataSource1">
3 <Columns>
4 <asp:CommandField ShowDeleteButton="True" ShowSelectButton="True" />
5 <asp:BoundField DataField="table2_id" HeaderText="table2_id"
6 InsertVisible="False" ReadOnly="True" SortExpression="table2_id" />
7 <asp:BoundField DataField="table1_id" HeaderText="table1_id"
8 SortExpression="table1_id" />
9 <asp:BoundField DataField="name_2" HeaderText="name_2"
10 SortExpression="name_2" />
11 <asp:CheckBoxField DataField="yesno" HeaderText="yesno"
12 SortExpression="yesno" />
13 <asp:BoundField DataField="MyArtificialColumn" HeaderText="MyArtificialColumn"
14 ReadOnly="True" SortExpression="MyArtificialColumn" />
15 </Columns>
16 </asp:GridView>
17 <asp:SqlDataSource ID="SqlDataSource1" runat="server"
18 ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>"
19 DeleteCommand="EraseIt" DeleteCommandType="StoredProcedure"
20 SelectCommand="StoredProcedure5" SelectCommandType="StoredProcedure">
21 </asp:SqlDataSource>
 Recently, "Wreck of u" kindly provided me with the stored procedure "StoredProcedure5" (line 20) which populates the gridview as shown. What I would like to now is write a stored procedure that DELETES a row. As like 19 shows, I attempted to write such an SP called EraseIt. However, when I click on Delete in the browser for a row, I get the error message "Procedure EraseIt has no parameters and arguments were supplied. The following is the code for EraseIt. Do I in fact have an error with specifying the input parameter "@table2_id", and or am I doing something else wrong? 1 ALTER PROCEDURE [dbo].[EraseIt]
2 AS
3 DECLARE @TABLE2_ID int
4 BEGIN
5 DELETE FROM DBO.TABLE2 WHERE TABLE2_ID = @TABLE2_ID
6 END
7
 Thanks!-Kurt

View 5 Replies View Related

Slow Performance With A Simple Query In A Small Table?

Jul 9, 2001

In my database/MY SERVER (SQL7/Win2K), I run a simple query with a Table/10000 rows (without cluster index):
SELECT * FROM TABLE
it take over 30s. Why it's slow? How can I check for reason? How to configure my server to improve performance?
Thanks in advance.
TH
----------------------------------
SP_CONFIGURE's RESULT in MY SERVER
----------------------------------

Table 'spt_values'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0.
name minimum maximum config_value run_value
----------------------------------- ----------- ----------- ------------ -----------
affinity mask 0 2147483647 0 0
allow updates 0 1 1 1
cost threshold for parallelism 0 32767 5 5
cursor threshold -1 2147483647 -1 -1
default language 0 9999 0 0
default sortorder id 0 255 52 52
extended memory size (MB) 0 2147483647 0 0
fill factor (%) 0 100 0 0
index create memory (KB) 704 1600000 0 0
language in cache 3 100 3 3
language neutral full-text 0 1 0 0
lightweight pooling 0 1 0 0
locks 5000 2147483647 0 0
max async IO 1 255 32 32
max degree of parallelism 0 32 0 0
max server memory (MB) 4 2147483647 2147483647 2147483647
max text repl size (B) 0 2147483647 65536 65536
max worker threads 10 1024 255 255
media retention 0 365 0 0
min memory per query (KB) 512 2147483647 1024 1024
min server memory (MB) 0 2147483647 0 0
nested triggers 0 1 1 1
network packet size (B) 512 65535 4096 4096
open objects 0 2147483647 0 0
priority boost 0 1 1 1
query governor cost limit 0 2147483647 0 0
query wait (s) -1 2147483647 -1 -1
recovery interval (min) 0 32767 0 0
remote access 0 1 1 1
remote login timeout (s) 0 2147483647 5 5
remote proc trans 0 1 0 0
remote query timeout (s) 0 2147483647 0 0
resource timeout (s) 5 2147483647 10 10
scan for startup procs 0 1 0 0
set working set size 0 1 0 0
show advanced options 0 1 1 1
spin counter 1 2147483647 10000 10000
time slice (ms) 50 1000 100 100
two digit year cutoff 1753 9999 2049 2049
Unicode comparison style 0 2147483647 196609 196609
Unicode locale id 0 2147483647 1033 1033
user connections 0 32767 0 0
user options 0 4095 0 0

Table 'spt_values'. Scan count 43, logical reads 108, physical reads 0, read-ahead reads 0.
Table 'sysconfigures'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 2.

View 4 Replies View Related

Simple Count Function - Show All Records For SSN In A Table

Jul 9, 2013

I want my query to list all SSNS that have more than one record in the table. I have this query:

Code:

SELECT SSN, name4, count(*) from [1099_PER]
group by SSN, name4
having count(SSN) > 1

It does retrieve the right SSNS and tells me how many times the SSN occurs in the table. However, I want my query results to display their full records.

For example

SSN NAME4 COUNT
123445555 WALTER - 4

I want the query to show me all four records for this SSN. I thought removing the count field would do this, but it still gives me only one instance of each SSN.

View 6 Replies View Related

Memory Issue With Simple CLR Based Table-Value-Function (TVF)

Dec 15, 2005

Hi,

We are seeing memory issues with a simple C# based TVF that splits an input string into a table based a delimiter.    Entries such as the following show up in the SQL log: 

AppDomain 8 (DBName.dbo[runtime].7) is marked for unload due to memory pressure.
AppDomain 8 (DBName.dbo[runtime].7) unloaded.



These entries only show up after the TVF has been called many times (~ half million times or more).

We encountered the same memory issues with June CTP, but they appeared to be fixed in Sepetmber CTP.  Somehow the issues come back for us in the SQL Server 2005 RTM version.   With June CTP after these errors show up many many times, the SQL server had to be re-started.  

I'd appreciate any comments/ideas regarding these error messages in the SQL log?

We are using the RTM version of SQL2005: Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)
Oct 14 2005 00:33:37
Copyright (c) 1988-2005 Microsoft Corporation
Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 1)




Thanks,
Wenbin Zhang

View 10 Replies View Related

SQL Server 2012 :: Simple XML To Table Resultset From Stored Procedure

Oct 29, 2014

I got some xml that is essentially an html table that I need to turn into a standard table resultset from a stored proc. If you take this xml and save it as html that is the desired resultset I am looking for. I realize the <td> tags repeat so I would just prefer 'col' + positional index for the col name. Keep in mind that <td> could be is 1 to n.

<table>
<tr>
<td>cell1</td>
<td>cell2</td>
<td>cell3</td>

[Code] .....

This is my attempt but I can't figure out how to get separate cols

declare @GridData xml = '<table><tr><td>cell1</td><td>cell2</td><td>cell3</td></tr><tr><td>cell4</td><td>cell5</td><td>cell6</td></tr><tr><td>cell7</td><td>cell8</td><td>cell8</td></tr></table>'
select T.C.value('.', 'nvarchar(max)')
from @GridData.nodes('//tr') T(C)

View 6 Replies View Related

WARNING. A Simple Cut And Paste Of 8 Records Can Distroy A SQL Server Table

Jul 20, 2005

Today I need to copy 8 records in a table. I have to use Access 200 becauseof the limitation of Enterprise Manager's inability to cope with field withmore than 900 characters. Selected records, cut, paste. I got an erroormessage about not being able to have a null Key_ID (I copied the reords andtried to paste the Key_ID as part of the records - normally I hide theKey_ID).Now I can't access either the new records or the originals that I was tryingto copy (because, it would seem, they have identical primary keys). I alsocannot export the table via DTS 'unspecified error' and 'integrityviolation'.Or delete the offending records with a Query Anaylyser delete query.Basically the entire SQL Server database has been destroyed with a couple ofkeystrokes.Now, I've being developing database applications for over 20years and theone thing, maybe the only thing I expect from a database server is toprotect the integrity of my data. SQL Server does not, it would seem. Theserecords aren't just any random unimportant records either. They contain the'create views' that my entire application require to function and each oneapproaches the 8000 record limit and have take years to perfect and justchecking that the table is valid could take me days.

View 5 Replies View Related

Very Simple Question: Cannot Create Table With Identity Fields Using SQL Sentences

Jan 26, 2007

Hi, I'm trying to build a several tables using sql ce 3.1
I refer to the manual on Create Table:
ms-help://MS.SSCE.v31.EN/ssmprog3/html/143cad25-5c1d-4c96-bd8b-6a95dbfb1b00.htm

The sample:
CREATE TABLE MyCustomers (CustID int IDENTITY (100,1) PRIMARY KEY,
CompanyName nvarchar (50))

just simply doesn't work displaying this error:

SQL Execution Error
Executed statement: CREATE TABLE MyCustomers (CustID int IDENTITY (100,1) PRIMARY KEY,
CompanyName nvarchar (50))

Error Source: SQL Server Compact Edition ADO.Net Data Provider
Error Message: There was an error parsing the query. [Token line number =1,
Token line offset 40, Token in error=IDENTITY]


I tested against a SQL Desktop, everything is OK.
What's wrong with the sentence?
Please some advise or workaround will be appreciated
Thanks
MSCD Fernando Zorrilla de San Martín

View 4 Replies View Related

Simple Copy Table Data Fails After 7973680 Rows

Nov 18, 2005

This is the error I get with a simple Data Reader Source (SELECT * FROM A) to SQL Server Destination copy between identical tables from a linked to a local server:

View 6 Replies View Related

Simple Simple Linking Tables & Perform Calculation

Mar 22, 2007

found it

View 3 Replies View Related







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